import { type ReapiResolution } from './providers/reapi-seedance.js'; import type { VideoExecutionPayload } from './types.js'; export interface ReapiRateRow { resolution: ReapiResolution; /** USD per billable second. */ usdPerSecond: number; /** The fewest seconds a task is billed for. */ minimumSeconds: number; } export interface ReapiCostTable { rows: ReapiRateRow[]; /** treg's own provenance stamp for the table, when present. */ checked: string | null; source: string | null; } /** * Read the per-second rows out of a treg catalog endpoint document (the JSON * `GET /catalog/endpoints/` returns, or the `endpoint` object inside it). * Reserve rows (`body.duration: -1`) are skipped: the route never sends -1. * Throws when no per-second row exists, because a quote with no rate is a guess. */ export declare function parseTregCostTable(document: unknown): ReapiCostTable; /** reAPI's billable seconds for one task (docs/seedance-2-5 "Pricing"). */ export declare function reapiBillableSeconds(durationSeconds: number, referenceVideoSeconds: number): number; /** The credits reAPI settles a task at: ceil(rate × seconds × 1000). */ export declare function reapiCreditsFor(usdPerSecond: number, billableSeconds: number): number; export interface ReapiTaskQuote { sceneIndex: number; resolution: ReapiResolution; durationSeconds: number; referenceVideoSeconds: number; billableSeconds: number; usdPerSecond: number; credits: number; usd: number; } export interface ReapiPayloadQuote { /** Total in USD, the currency `actualCost` is stated in. */ unitCostUsd: number; totalCredits: number; perTask: ReapiTaskQuote[]; } export interface QuoteReapiPayloadOptions { /** `VCLAW_REAPI_SEEDANCE_RESOLUTION` when set — the same override the transport reads. */ resolutionOverride?: string; /** Measured length of every reference VIDEO per scene, in seconds (0 when none). */ referenceVideoSecondsByScene: Map; } /** * Price every task of a payload exactly as reAPI will settle it. A duration * that is not a whole second 4–30 is refused here too (the transport refuses * it as well; a quote for a render that cannot submit is worthless), as is a * resolution the table does not price. */ export declare function quoteReapiPayload(table: ReapiCostTable, payload: VideoExecutionPayload, options: QuoteReapiPayloadOptions): ReapiPayloadQuote; //# sourceMappingURL=reapi-quote.d.ts.map