/**
 * Dynamic model catalog from BlockRun Gateway.
 *
 * Pulls GET /api/v1/models once on first use, caches for 5 minutes, and
 * exposes estimators + category filters. This replaces the hardcoded
 * pricing/model tables Franklin used to carry — adding a new model or
 * changing a price on BlockRun's side no longer requires a Franklin
 * release. Gateway is the single source of truth.
 *
 * Per gateway team (2026-04-22): every model returns `billing_mode` and
 * a mode-specific `pricing` object. Dispatch on billing_mode to compute
 * an estimated charge. x402 adds a fixed 5% margin on top of base price,
 * so actual charge = base * 1.05 (confirmed against a live 402 response
 * on seedance-2.0-fast: 5s × $0.15 × 1.05 = $0.7875).
 */
export type BillingMode = 'paid' | 'free' | 'flat' | 'per_image' | 'per_second' | 'per_track';
export interface PaidPricing {
    input: number;
    output: number;
}
export interface FlatPricing {
    flat: number;
}
export interface PerImagePricing {
    per_image: number;
}
export interface PerSecondPricing {
    per_second: number;
    default_duration_seconds?: number;
    max_duration_seconds?: number;
}
export interface PerTrackPricing {
    per_track: number;
}
export type ModelPricing = PaidPricing | FlatPricing | PerImagePricing | PerSecondPricing | PerTrackPricing;
export interface GatewayModel {
    id: string;
    name: string;
    description?: string;
    owned_by?: string;
    billing_mode: BillingMode;
    categories: string[];
    context_window?: number;
    max_output?: number;
    pricing: ModelPricing;
}
/** Test / reset helper. */
export declare function clearGatewayModelsCache(): void;
/**
 * Fetch the model catalog, honoring the 5-minute cache. Concurrent callers
 * during a cold cache share a single in-flight promise so we don't stampede
 * the gateway at process start.
 */
export declare function getGatewayModels(): Promise<GatewayModel[]>;
/** Return models filtered to a specific category (e.g. 'image', 'video', 'music'). */
export declare function getModelsByCategory(category: string): Promise<GatewayModel[]>;
/** Find a single model by ID, or null if it's not in the current catalog. */
export declare function findModel(id: string): Promise<GatewayModel | null>;
/** x402 gateway's fixed margin percentage applied on top of the base price. */
export declare const GATEWAY_MARGIN = 1.05;
export interface EstimateContext {
    /** Number of images (per_image). Default 1. */
    quantity?: number;
    /** Clip length in seconds (per_second). Falls back to model's default_duration_seconds, then 8. */
    duration_seconds?: number;
}
/**
 * Estimated USD charge to generate one response from this model under the
 * given context. Includes the 5% gateway margin. Returns 0 for free and
 * token-metered (paid) models where a pre-call estimate isn't meaningful.
 */
export declare function estimateCostUsd(model: GatewayModel, ctx?: EstimateContext): number;
/** Effective default duration for a per_second model (falls back to 8s). */
export declare function defaultDurationSeconds(model: GatewayModel): number;
/** Max duration the gateway will accept for a per_second model. */
export declare function maxDurationSeconds(model: GatewayModel): number | null;
