export type GoogleFlowFetchLike = (url: string, init: { method: string; headers: Record; body?: string; }) => Promise<{ ok: boolean; status: number; text(): Promise; /** * Optional so test fakes can omit it; real fetch always provides it. Without * it a 503's stated `Retry-After` is invisible and the caller falls back to a * fixed 10 s — which is exactly the tight retry loop that lengthens a Google * link block rather than shortening it. */ headers?: { get(name: string): string | null; }; }>; export declare const GOOGLE_FLOW_BASE = "https://api.useapi.net/v1/google-flow"; /** * Upscale targets. `720p` arrived with Omni 1.1 Flash (2026-08-26) to PROMOTE a * clip generated at `resolution: 360p`; `720p` and `1080p` are both FREE on a * paid Google AI plan, and a 360p clip can go straight to `1080p` without * stopping at 720p. `4K` costs 50 credits and needs Ultra. * * Case: the API spells it `4K`. We accept `4k` from operators/CLI (the sidecar * and our own cli-schema have long documented lowercase) and normalize on the * wire — see {@link normalizeFlowUpscaleResolution}. */ export type GoogleFlowUpscaleResolution = '720p' | '1080p' | '4K'; /** Free on any paid plan: no credits, so it needs no spend gate. */ export declare const FREE_FLOW_UPSCALE_RESOLUTIONS: readonly GoogleFlowUpscaleResolution[]; /** * Accept either casing of 4K and either free tier, and return the spelling the * API expects. Throws on anything else rather than defaulting — a silent fall * back to 1080p would hide an operator asking for 4K and quietly not get it. */ export declare function normalizeFlowUpscaleResolution(value: string): GoogleFlowUpscaleResolution; export interface UpscaleFlowVideoInput { /** Bearer token (USEAPI_API_TOKEN). */ apiToken: string; /** A Flow-GENERATED video id (`user:..-email:..-video:..`). NOT an uploaded/edited file. */ mediaGenerationId: string; /** Target resolution. '720p'/'1080p' (default) are free; '4K' costs 50 credits + Ultra. */ resolution?: GoogleFlowUpscaleResolution; fetchImpl?: GoogleFlowFetchLike; /** * Transient-retry budget for 429/5xx/network errors (default 2). Retrying is * SAFE here: useapi Flow endpoints throttle routinely, and re-upscaling the * same mediaGenerationId is cached server-side (no extra credits). */ maxRetries?: number; /** Base backoff between retries, ms (default 1000; grows linearly). */ retryBackoffMs?: number; /** * captcha-retry auto-solve count (`captchaRetry`). Omit → VCLAW_FLOW_CAPTCHA_RETRY * (default 5); 0 opts out (no field sent). */ captchaRetry?: number; /** * Ceiling on re-asking for a withheld download link after a successful upscale * (default 3 min). Its own budget — a Google link block can outlast any sane * in-process wait. */ urlRecoveryMaxWaitMs?: number; } export interface UpscaleFlowVideoResult { /** Signed MP4 URL of the upscaled video (download promptly — it expires). */ videoUrl: string; /** The upscaled clip's own Flow media id (re-upscale/chain target). */ mediaGenerationId: string | null; /** Credits left after the call (1080p leaves it unchanged — it's free). */ remainingCredits: number | null; raw: unknown; } /** * Upscale a Flow-generated video (synchronous; 30–60s). Throws on a non-2xx * response or a body without a video URL. The `mediaGenerationId` MUST be a Flow * generation — an external/edited clip is rejected by the API. */ export declare function upscaleFlowVideo(input: UpscaleFlowVideoInput): Promise; //# sourceMappingURL=google-flow.d.ts.map