{"openapi":"3.1.0","info":{"title":"Rivya Public API","version":"v1","description":"Rivya API v1 for model discovery, generation, chat, reference uploads, credits, and webhooks."},"servers":[{"url":"https://rivya.ai"}],"security":[{"bearerAuth":[]}],"paths":{"/api/v1/models":{"get":{"summary":"List models and their Public API availability","security":[],"responses":{"200":{"description":"Model list, including entries that are not currently callable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}}}}},"/api/v1/generations":{"post":{"summary":"Submit an asynchronous generation","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationRequest"}}}},"responses":{"200":{"description":"Generation task details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicGeneration"}}}},"400":{"$ref":"#/components/responses/PublicApiError"},"401":{"$ref":"#/components/responses/PublicApiError"},"402":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"},"409":{"$ref":"#/components/responses/PublicApiError"},"429":{"$ref":"#/components/responses/PublicApiError"},"500":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/files":{"post":{"summary":"Upload a reference file","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/FileUploadRequest"}}}},"responses":{"200":{"description":"Metadata for the uploaded reference file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiFile"}}}},"400":{"$ref":"#/components/responses/PublicApiError"},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"},"429":{"$ref":"#/components/responses/PublicApiError"},"500":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/files/{fileId}":{"get":{"summary":"Get stored reference file metadata","description":"Requires the `files:read` API key scope. Returns the account's stored file record, without restoring signed image or video metadata.","security":[{"bearerAuth":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Stored file metadata; signed image and video fields are `null`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiFile"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/chat/completions":{"post":{"summary":"Create a non-streaming chat completion","description":"Requires the `chat:create` API key scope.","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"Assistant message, usage, and credit settlement status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}}}},"400":{"$ref":"#/components/responses/PublicApiError"},"401":{"$ref":"#/components/responses/PublicApiError"},"402":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"},"409":{"$ref":"#/components/responses/PublicApiError"},"429":{"$ref":"#/components/responses/PublicApiError"},"500":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/chat/completions/stream":{"post":{"summary":"Create a streaming chat completion","description":"Requires the `chat:create` API key scope. Responses use Server-Sent Events once streaming starts; earlier errors use the HTTP error format. GPT-5.2 sends its complete answer in one text event after the response is ready; it does not send progressive text updates.","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"Stream of chat completion events","content":{"text/event-stream":{"schema":{"type":"string","description":"The stream can include `session.created`, `message.delta`, `message.completed`, `usage.completed`, `heartbeat`, `error`, and `done` events."}}}},"400":{"$ref":"#/components/responses/PublicApiError"},"401":{"$ref":"#/components/responses/PublicApiError"},"402":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"},"409":{"$ref":"#/components/responses/PublicApiError"},"429":{"$ref":"#/components/responses/PublicApiError"},"500":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/chat/sessions":{"get":{"summary":"List API-created chat sessions","description":"Requires the `chat:read` API key scope.","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Chat session list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionList"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/chat/sessions/{sessionId}":{"get":{"summary":"Get an API-created chat session","description":"Requires the `chat:read` API key scope.","security":[{"bearerAuth":[]}],"parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Chat session with saved messages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionDetail"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/generations/{taskId}":{"get":{"summary":"Get generation status","security":[{"bearerAuth":[]}],"parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Generation task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicGeneration"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/credits":{"get":{"summary":"Get account credit balance","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current credit balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalance"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/webhooks":{"get":{"summary":"List webhook endpoints","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Webhook endpoint list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}},"post":{"summary":"Create a webhook endpoint","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}}},"responses":{"201":{"description":"Created webhook endpoint. Save the returned `signing_secret`; later retrieval responses omit it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"$ref":"#/components/responses/PublicApiError"},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/webhooks/{endpointId}":{"get":{"summary":"Get a webhook endpoint","security":[{"bearerAuth":[]}],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}},"patch":{"summary":"Update a webhook endpoint","security":[{"bearerAuth":[]}],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"}}}},"responses":{"200":{"description":"Updated webhook endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"$ref":"#/components/responses/PublicApiError"},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}},"delete":{"summary":"Disable a webhook endpoint","security":[{"bearerAuth":[]}],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Disabled webhook endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/webhooks/{endpointId}/rotate-secret":{"post":{"summary":"Rotate a webhook endpoint signing secret","security":[{"bearerAuth":[]}],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook endpoint with its new `signing_secret`. Save it; later retrieval responses omit it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"},"503":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/webhook-events":{"get":{"summary":"List recent webhook events","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Webhook event list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventList"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/webhooks/{endpointId}/deliveries":{"get":{"summary":"List recent deliveries for a webhook endpoint","security":[{"bearerAuth":[]}],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Webhook delivery list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}}},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"}}}},"/api/v1/webhooks/{endpointId}/test":{"post":{"summary":"Send a test webhook event","security":[{"bearerAuth":[]}],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Test delivery result. No generation task is created and no Rivya credits are spent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResult"}}}},"400":{"$ref":"#/components/responses/PublicApiError"},"401":{"$ref":"#/components/responses/PublicApiError"},"403":{"$ref":"#/components/responses/PublicApiError"},"404":{"$ref":"#/components/responses/PublicApiError"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"rvya_sk"}},"schemas":{"ModelList":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PublicApiModel"}}}},"PublicApiModel":{"type":"object","required":["id","display_name","category","runtime","base_credits","billing_type","pricing","supported_modes","prompt_length_unit","params","supports_direct_generation","api_status","api_input_status","supported_api_inputs","requires_files_api","requires_upload_for_modes","url_input_supported","file_kinds","notices"],"properties":{"id":{"type":"string","enum":["gpt-image-2-6-flare","gpt-image-2-6-sunburst","gpt-image-2-6-economy","gpt-image-2-5-flare","gpt-image-2-5-sunburst","gpt-image-2","gpt-image-1-5","z-image","nano-banana-2-1","nano-banana-2","nano-banana-2-lite","nano-banana-pro","nano-banana","4o-image","seedream-5-5-text-to-image","seedream-5-5-image-to-image","seedream-5-5-layer-decomposition","seedream-5-lite","seedream-5-pro","seedream-5-pro-layer-decomposition","seedream-5-flash","seedream-5-flash-layer-decomposition","seedream-4-5","seedream-4-0","seedream-3-0","grok-imagine-image-2-0","grok-imagine","flux-3","flux-2-pro","flux-2-flex","flux-kontext-max","flux-kontext-pro","qwen-image-3","qwen-image-3-pro","qwen2-1-image","qwen2-image","qwen-image","qwen-image-edit","midjourney","recraft-remove-background","recraft-crisp-upscale","wan-2-7-image-pro","wan-2-7-image","google-imagen4-ultra","google-imagen4","google-imagen4-fast","topaz-image-upscale","ideogram-v3","ideogram-v3-reframe","ideogram-v3-remix","ideogram-character","image-upscale","minimax-h3-image","seedance-2-5","seedance-2","seedance-2-fast","seedance-2-mini","seedance-1-5-pro","seedance-1-0-pro","seedance-1-0-pro-fast","seedance-1-0-lite","happyhorse-1-1","happyhorse-1-0","wan-3-0-video","wan-2-7-video","wan-2-6","wan-2-6-flash","wan-2-5-video","wan-2-2-a14b-turbo","wan-2-2-animate-replace","wan-animate-2","minimax-h3","hailuo-2-3","hailuo-pro","hailuo-standard","kling-4-0","kling-4-0-flash","kling-3-0","kling-3-0-motion-control","kling-3-turbo","kling-o3","kling-2-6","kling-2-6-motion-control","kling-v2-5-turbo-pro","kling-v2-1-master","kling-v2-1-pro","kling-v2-1-standard","kling-ai-avatar-pro","kling-ai-avatar-standard","infinitalk","runway","runway-aleph","luma-modify-video","grok-imagine-video","grok-imagine-video-original","sora-2-pro","sora-2","sora-watermark-remover","topaz-video-upscale","veo3-1-quality","veo3-1-fast","veo3-1-lite","vidu-q4","gemini-omni-flash-1-2","gemini-omni-flash-1-1","gemini-omni-video","omnihuman-2-0","omnihuman-1-5","volcengine-video-lip-sync","pixverse-v6","pixverse-v6-max","video-upscale","suno-music","suno-sounds","suno-lyrics","suno-speech","elevenlabs-dialogue-v3","elevenlabs-turbo-2-5","elevenlabs-multilingual-v2","elevenlabs-sound-effect-v2","elevenlabs-audio-isolation","gemini-3-8-flash-tts","gemini-3-8-flash-lite-tts","gemini-3-1-flash-tts","gemini-2-5-pro-tts","nemotron-3-5-transcribe","gpt-6-1-sol-chat","gpt-6-1-terra-chat","gpt-6-astra-chat","gpt-6-sol-chat","gpt-6-luna-chat","gpt-5-6-luna-chat","gpt-5-6-terra-chat","gpt-5-6-sol-chat","gpt-5-5-chat","gpt-5-4-chat","gpt-5.4-codex-chat","gpt-5-3-codex-chat","gpt-5-2-chat","gpt-5-2-codex-chat","gpt-5-1-codex-chat","gpt-5-codex-chat","gemini-4-argon-chat","gemini-4-carbon-chat","gemini-3-8-flash-chat","gemini-3-7-flash-chat","gemini-3-6-flash-chat","gemini-3-5-flash-chat","gemini-3-1-pro-chat","gemini-3-pro-chat","gemini-3-flash-chat","gemini-2-5-pro-chat","gemini-2-5-flash-chat","claude-opus-5-5-chat","claude-sonnet-5-5-chat","claude-haiku-5-5-chat","claude-fable-5-2-chat","claude-fable-5-1-chat","claude-fable-5-chat","claude-sonnet-5-chat","claude-opus-5-chat","claude-opus-4-8-chat","claude-opus-4-7-chat","claude-opus-4-6-chat","claude-sonnet-4-6-chat","claude-opus-4-5-chat","claude-sonnet-4-5-chat","claude-haiku-4-5-chat","grok-4-7-chat","grok-4-6-chat","grok-4-5-chat","grok-4-3-chat","kimi-k3-1-pro-chat","kimi-k3-chat","deepseek-v4-1-flash-chat"]},"display_name":{"type":"string"},"category":{"type":"string","enum":["image","video","audio","chat"]},"runtime":{"anyOf":[{"type":"null"},{"type":"string","enum":["async_task","chat_completions","responses"]}]},"base_credits":{"anyOf":[{"type":"null"},{"type":"integer","minimum":0}]},"billing_type":{"anyOf":[{"type":"null"},{"type":"string","enum":["FIXED","METERED","TOKEN_BASED"]}]},"pricing":{"anyOf":[{"type":"null"},{"$ref":"#/components/schemas/ModelPricing"}]},"supported_modes":{"type":"array","items":{"type":"string"}},"max_prompt_length":{"type":["integer","null"],"description":"Configured prompt limit. Read prompt_length_unit for its unit. A null limit does not mean the model accepts unlimited or optional text; check its input requirements."},"prompt_length_unit":{"description":"Unit of max_prompt_length: utf8_bytes counts the original UTF-8 text bytes, including spaces and line breaks; utf16_code_units counts JavaScript UTF-16 code units. Null means no configured public prompt limit is exposed.","anyOf":[{"type":"null"},{"type":"string","enum":["utf8_bytes","utf16_code_units"]}]},"max_images":{"type":["integer","null"]},"max_videos":{"type":["integer","null"]},"max_audios":{"type":["integer","null"]},"reference_media":{"anyOf":[{"type":"null"},{"$ref":"#/components/schemas/ReferenceMedia"}]},"params":{"type":"array","items":{"$ref":"#/components/schemas/ModelParam"}},"supports_direct_generation":{"type":"boolean"},"api_status":{"type":"string","enum":["available","temporarily_unavailable","coming_soon","studio_only"]},"api_input_status":{"type":"string","enum":["available_text","available_url_input","partial_requires_files","requires_files_api","temporarily_unavailable","coming_soon","studio_only"]},"supported_api_inputs":{"type":"array","items":{"type":"string","enum":["text","url","file"]}},"requires_files_api":{"type":"boolean"},"requires_upload_for_modes":{"type":"array","items":{"type":"string"}},"url_input_supported":{"type":"boolean"},"file_kinds":{"type":"array","items":{"type":"string","enum":["image","video","audio"]}},"chat_capabilities":{"anyOf":[{"type":"null"},{"$ref":"#/components/schemas/ChatCapabilities"}]},"notices":{"type":"array","items":{"type":"string"}}}},"ModelPricing":{"type":"object","required":["unit","rates","formula","local_rounding","final_settlement"],"properties":{"unit":{"type":"string","enum":["per_image","per_image_plus_reference_image","per_output_plus_input_image","per_request","per_video","per_output_megapixel","per_output_second","per_input_second","per_input_and_output_second","per_1000_characters","per_million_tokens"]},"rates":{"type":"object","additionalProperties":{"type":"number","minimum":0}},"formula":{"type":"string"},"local_rounding":{"type":"string","const":"ceil_total"},"final_settlement":{"type":"string","enum":["creditsConsumed","credits_consumed","credits_consumed_or_decoded_audio_duration","credits_consumed_or_confirmed_token_usage"]}}},"ChatCapabilities":{"type":"object","required":["non_streaming","streaming","web_search","image_attachments","thoughts","reasoning_efforts"],"properties":{"non_streaming":{"type":"boolean"},"streaming":{"type":"boolean"},"web_search":{"type":"boolean"},"image_attachments":{"type":"boolean"},"thoughts":{"type":"boolean"},"reasoning_efforts":{"type":"array","items":{"type":"string","enum":["minimal","low","medium","high","xhigh"]}}}},"ReferenceMedia":{"type":"object","required":["kind","accepted_kinds","max_files"],"properties":{"kind":{"type":"string","enum":["image","video","audio"]},"accepted_kinds":{"type":"array","items":{"type":"string","enum":["image","video","audio"]}},"max_files":{"type":"integer","minimum":1}}},"ModelParam":{"type":"object","required":["key","type","label","required"],"properties":{"key":{"type":"string"},"type":{"type":"string","enum":["select","number","text"]},"label":{"type":"string"},"help_text":{"type":"string"},"required":{"type":"boolean"},"hide_when_modes":{"type":"array","items":{"type":"string"}},"default_value":{},"min":{"type":"number"},"max":{"type":"number"},"max_length":{"type":"integer","minimum":1},"step":{"type":"number"},"placeholder":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/ModelParamOption"}}}},"ModelParamOption":{"type":"object","required":["value","label"],"properties":{"value":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"FileUploadRequest":{"type":"object","required":["file","kind"],"properties":{"file":{"type":"string","format":"binary"},"kind":{"type":"string","enum":["image","video","audio"]},"model":{"type":"string","enum":["gpt-image-2-6-economy","gpt-image-2-5-flare","gpt-image-2-5-sunburst","gpt-image-2","gpt-image-1-5","nano-banana-2-1","nano-banana-2","nano-banana-2-lite","nano-banana-pro","nano-banana","seedream-5-5-image-to-image","seedream-5-5-layer-decomposition","seedream-5-lite","seedream-5-pro","seedream-5-pro-layer-decomposition","seedream-5-flash","seedream-5-flash-layer-decomposition","seedream-4-5","seedream-4-0","grok-imagine-image-2-0","grok-imagine","flux-3","flux-2-pro","flux-2-flex","flux-kontext-max","flux-kontext-pro","qwen-image-3","qwen-image-3-pro","qwen2-1-image","qwen2-image","qwen-image","qwen-image-edit","recraft-remove-background","recraft-crisp-upscale","wan-2-7-image-pro","wan-2-7-image","topaz-image-upscale","ideogram-v3-remix","ideogram-character","image-upscale","seedance-2-5","seedance-2","seedance-2-fast","seedance-2-mini","seedance-1-5-pro","seedance-1-0-pro","seedance-1-0-pro-fast","seedance-1-0-lite","happyhorse-1-1","happyhorse-1-0","wan-3-0-video","wan-2-7-video","wan-2-6","wan-2-6-flash","wan-2-5-video","wan-2-2-a14b-turbo","wan-2-2-animate-replace","minimax-h3","hailuo-2-3","hailuo-pro","hailuo-standard","kling-4-0","kling-4-0-flash","kling-3-0","kling-3-0-motion-control","kling-3-turbo","kling-o3","kling-2-6","kling-2-6-motion-control","kling-v2-5-turbo-pro","kling-v2-1-master","kling-v2-1-pro","kling-v2-1-standard","kling-ai-avatar-pro","kling-ai-avatar-standard","infinitalk","runway","grok-imagine-video","grok-imagine-video-original","topaz-video-upscale","veo3-1-quality","veo3-1-fast","veo3-1-lite","vidu-q4","gemini-omni-flash-1-2","gemini-omni-flash-1-1","gemini-omni-video","omnihuman-2-0","omnihuman-1-5","volcengine-video-lip-sync","pixverse-v6","pixverse-v6-max","video-upscale","nemotron-3-5-transcribe"]},"client_request_id":{"type":"string","maxLength":128}}},"GenerationRequest":{"type":"object","required":["model"],"allOf":[{"if":{"properties":{"model":{"const":"wan-2-6"}},"required":["model"]},"then":{"properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000,"description":"Text requests require at least 1 character. Image and video requests require at least 2 characters."},"params":{"$ref":"#/components/schemas/WanTwoSixParams"}}}},{"if":{"properties":{"model":{"const":"seedance-1-5-pro"}},"required":["model"]},"then":{"properties":{"prompt":{"type":"string","minLength":3,"maxLength":2500},"params":{"$ref":"#/components/schemas/SeedanceOneFiveParams"}}}},{"if":{"properties":{"model":{"const":"happyhorse-1-0"}},"required":["model"]},"then":{"properties":{"prompt":{"type":"string","maxLength":5000,"description":"Required for text and multi-image reference requests. With exactly one image, the prompt is optional. Prompts containing Han characters are limited to 2,500 characters."},"params":{"$ref":"#/components/schemas/HappyHorseOneParams"}}}}],"properties":{"model":{"type":"string","enum":["gpt-image-2-6-economy","gpt-image-2-5-flare","gpt-image-2-5-sunburst","gpt-image-2","gpt-image-1-5","z-image","nano-banana-2-1","nano-banana-2","nano-banana-2-lite","nano-banana-pro","nano-banana","4o-image","seedream-5-5-text-to-image","seedream-5-5-image-to-image","seedream-5-5-layer-decomposition","seedream-5-lite","seedream-5-pro","seedream-5-pro-layer-decomposition","seedream-5-flash","seedream-5-flash-layer-decomposition","seedream-4-5","seedream-4-0","seedream-3-0","grok-imagine-image-2-0","grok-imagine","flux-3","flux-2-pro","flux-2-flex","flux-kontext-max","flux-kontext-pro","qwen-image-3","qwen-image-3-pro","qwen2-1-image","qwen2-image","qwen-image","qwen-image-edit","recraft-remove-background","recraft-crisp-upscale","wan-2-7-image-pro","wan-2-7-image","google-imagen4-ultra","google-imagen4","google-imagen4-fast","topaz-image-upscale","ideogram-v3","ideogram-v3-remix","ideogram-character","image-upscale","seedance-2-5","seedance-2","seedance-2-fast","seedance-2-mini","seedance-1-5-pro","seedance-1-0-pro","seedance-1-0-pro-fast","seedance-1-0-lite","happyhorse-1-1","happyhorse-1-0","wan-3-0-video","wan-2-7-video","wan-2-6","wan-2-6-flash","wan-2-5-video","wan-2-2-a14b-turbo","wan-2-2-animate-replace","minimax-h3","hailuo-2-3","hailuo-pro","hailuo-standard","kling-4-0","kling-4-0-flash","kling-3-0","kling-3-0-motion-control","kling-3-turbo","kling-o3","kling-2-6","kling-2-6-motion-control","kling-v2-5-turbo-pro","kling-v2-1-master","kling-v2-1-pro","kling-v2-1-standard","kling-ai-avatar-pro","kling-ai-avatar-standard","infinitalk","runway","grok-imagine-video","grok-imagine-video-original","topaz-video-upscale","veo3-1-quality","veo3-1-fast","veo3-1-lite","vidu-q4","gemini-omni-flash-1-2","gemini-omni-flash-1-1","gemini-omni-video","omnihuman-2-0","omnihuman-1-5","volcengine-video-lip-sync","pixverse-v6","pixverse-v6-max","video-upscale","suno-music","suno-sounds","suno-lyrics","suno-speech","elevenlabs-dialogue-v3","elevenlabs-turbo-2-5","elevenlabs-multilingual-v2","gemini-3-8-flash-tts","gemini-3-8-flash-lite-tts","gemini-3-1-flash-tts","gemini-2-5-pro-tts","nemotron-3-5-transcribe"]},"prompt":{"type":"string","maxLength":30000},"params":{"type":"object","additionalProperties":true,"properties":{"referenceMediaItems":{"type":"array","items":{"$ref":"#/components/schemas/ReferenceMediaItem"}},"referenceMediaUrl":{"type":"string","description":"Legacy single-reference URL. Use `referenceMediaItems` for new integrations, following the selected model's input rules."},"referenceMediaKind":{"type":"string","enum":["image","video","audio"],"description":"Media kind for the legacy `referenceMediaUrl` field."},"seedance_scene":{"type":"string","enum":["text","frames","reference"],"description":"Choose one scene: `text`, `frames`, or `reference`. Text sends no media; frames needs a first image and may include a last image; reference needs at least one supported input. Seedance 2 uses `seedance_first_frame_url` and `seedance_last_frame_url` for frames, while Wan 3.0 uses `referenceMediaItems`."},"seedance_first_frame_url":{"type":"string","description":"Required first-frame image URL for the Seedance 2 `frames` scene. Use the URL from the original Files API upload for this model."},"seedance_last_frame_url":{"type":"string","description":"Optional last-frame image URL for the Seedance 2 `frames` scene. Use the URL from the original Files API upload for this model."},"seedance_reference_images":{"type":"array","maxItems":9,"items":{"type":"string"},"description":"Image URLs for the Seedance 2 `reference` scene. Each URL needs exactly one matching `imageMetadata` entry from its original Files API upload for this model."},"seedance_reference_videos":{"type":"array","maxItems":3,"items":{"$ref":"#/components/schemas/SeedanceTimedReferenceInput"},"description":"Video inputs for the Seedance 2 `reference` scene. Each clip must be 2–15 seconds, with no more than 15 seconds across all videos. Each URL needs exactly one matching `videoMetadata` entry. For `seedance-2`, video references require 1080p or 4K output."},"seedance_reference_audios":{"type":"array","maxItems":3,"items":{"$ref":"#/components/schemas/SeedanceTimedReferenceInput"},"description":"Audio inputs for the Seedance 2 `reference` scene. Each clip must be 2–15 seconds, with no more than 15 seconds across all audio inputs."},"imageMetadata":{"type":"array","items":{"$ref":"#/components/schemas/SignedUploadMetadataInput"},"description":"Signed image metadata for Seedance 2. Each current frame or reference-image URL needs exactly one matching entry, with no missing or extra URLs."},"videoMetadata":{"type":"array","items":{"$ref":"#/components/schemas/SignedUploadMetadataInput"},"description":"Signed video metadata for Seedance 2. Each current reference-video URL needs exactly one matching entry, with no missing or extra URLs."}}},"client_request_id":{"type":"string","maxLength":128}}},"WanTwoSixParams":{"type":"object","additionalProperties":false,"properties":{"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p"},"duration":{"type":"string","enum":["5","10","15"],"default":"5","description":"Text and image requests support 5, 10, or 15 seconds. Video requests support only 5 or 10 seconds."},"multi_shots":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["false","true"]}],"default":false},"nsfw_checker":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["false","true"]}],"default":true},"referenceMediaItems":{"description":"Omit for text-to-video. Provide exactly one signed image for image-to-video, or one to three signed videos for video editing. Images and videos cannot be mixed.","oneOf":[{"type":"array","maxItems":0},{"type":"array","minItems":1,"maxItems":1,"items":{"$ref":"#/components/schemas/WanTwoSixReferenceImage"}},{"type":"array","minItems":1,"maxItems":3,"items":{"$ref":"#/components/schemas/WanTwoSixReferenceVideo"}}]}}},"WanTwoSixReferenceImage":{"type":"object","additionalProperties":false,"required":["url","kind","mimeType","width","height","sizeBytes","imageDimensionsToken"],"properties":{"url":{"type":"string","format":"uri"},"kind":{"const":"image"},"name":{"type":"string"},"mimeType":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"width":{"type":"integer","minimum":256},"height":{"type":"integer","minimum":256},"sizeBytes":{"type":"integer","minimum":1,"maximum":10485760},"imageDimensionsToken":{"type":"string","minLength":1}}},"WanTwoSixReferenceVideo":{"type":"object","additionalProperties":false,"required":["url","kind","mimeType","width","height","sizeBytes","framesPerSecond","videoBitrateMbps","videoMetadataToken"],"properties":{"url":{"type":"string","format":"uri"},"kind":{"const":"video"},"name":{"type":"string"},"mimeType":{"type":"string","enum":["video/mp4","video/quicktime"]},"durationSeconds":{"type":"number","exclusiveMinimum":0},"durationToken":{"type":"string"},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1},"sizeBytes":{"type":"integer","minimum":1,"maximum":10485760},"framesPerSecond":{"type":["number","null"],"exclusiveMinimum":0},"videoBitrateMbps":{"type":["number","null"],"exclusiveMinimum":0},"videoMetadataToken":{"type":"string","minLength":1}}},"HappyHorseOneParams":{"type":"object","additionalProperties":false,"properties":{"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p"},"duration":{"type":"integer","minimum":3,"maximum":15,"default":5},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"Use for text and multi-image reference requests. Omit when supplying exactly one image."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"default":0},"referenceMediaItems":{"type":"array","maxItems":9,"items":{"$ref":"#/components/schemas/HappyHorseOneReferenceImage"},"description":"Use no images for text-to-video, exactly one for image-to-video, or 2–9 for multi-image reference generation. Existing-video editing is not currently available."}}},"HappyHorseOneReferenceImage":{"type":"object","additionalProperties":false,"required":["url","kind","mimeType","width","height","sizeBytes","imageDimensionsToken"],"properties":{"url":{"type":"string","format":"uri"},"kind":{"const":"image"},"name":{"type":"string"},"mimeType":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1},"sizeBytes":{"type":"integer","minimum":1,"maximum":10485760},"imageDimensionsToken":{"type":"string","minLength":1},"durationSeconds":{"type":["number","null"]},"durationToken":{"type":["string","null"]},"framesPerSecond":{"type":["number","null"]},"videoBitrateMbps":{"type":["number","null"]},"videoMetadataToken":{"type":["string","null"]}}},"SeedanceOneFiveParams":{"type":"object","additionalProperties":false,"properties":{"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"720p"},"duration":{"type":"integer","minimum":4,"maximum":12,"default":8},"generate_audio":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["false","true"]}],"default":false},"aspectRatio":{"type":"string","enum":["1:1","4:3","3:4","16:9","9:16","21:9"],"default":"1:1","description":"Text-to-video only. Image-to-video follows the uploaded reference dimensions."},"fixed_lens":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["false","true"]}],"default":false},"nsfw_checker":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["false","true"]}],"default":false},"referenceMediaItems":{"type":"array","maxItems":2,"items":{"$ref":"#/components/schemas/SeedanceOneFiveReferenceImage"}}}},"SeedanceOneFiveReferenceImage":{"type":"object","additionalProperties":false,"required":["url","kind","mimeType","width","height","sizeBytes","imageDimensionsToken"],"properties":{"url":{"type":"string","format":"uri"},"kind":{"const":"image"},"name":{"type":"string"},"mimeType":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1},"sizeBytes":{"type":"integer","minimum":1,"maximum":10485760},"imageDimensionsToken":{"type":"string","minLength":1}}},"ReferenceMediaItem":{"type":"object","required":["url","kind"],"properties":{"url":{"type":"string","description":"URL from `/api/v1/files`, or another public URL accepted by the selected model. Models that require signed metadata need the original upload URL for that model."},"kind":{"type":"string","enum":["image","video","audio"]},"name":{"type":"string"},"mimeType":{"type":"string"},"durationSeconds":{"type":"number"},"durationToken":{"type":"string","description":"Use `duration_token` from the original Files API upload for the same model. Required for audio or video inputs whose model verifies duration. Wan 3.0 audio tokens also bind MIME type and file size."},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1},"sizeBytes":{"type":"integer","minimum":1},"imageDimensionsToken":{"type":"string","description":"Use `image_dimensions_token` from the original upload for the same model. It is required for signed image references, including those for Seedream 5.0 Pro, Seedream 5.0 Pro Layer Decomposition, Nano Banana 2 Lite, Qwen Image 3.0, Qwen Image 3.0 Pro, Grok Imagine Image 2.0, Seedance 1.5 Pro, Wan 2.6, Wan 3.0, and PixVerse V6. The token binds the account, model, URL, MIME type, detected dimensions, and file size."},"framesPerSecond":{"type":"number","exclusiveMinimum":0},"videoBitrateMbps":{"type":"number","exclusiveMinimum":0},"videoMetadataToken":{"type":"string","description":"Use `video_metadata_token` from the original upload for the same model. It is required for signed video references, including those for Seedance 2 Mini, Seedance 2.5, MiniMax H3, Gemini Omni Video, Gemini Omni 1.1 Flash, Volcengine Video Lip Sync, Wan 2.6, and Wan 3.0. The token binds the account, model, URL, MIME type, dimensions, frame rate, bitrate, and file size. Supply `durationToken` separately when the model requires it."}}},"SeedanceTimedReferenceInput":{"type":"object","additionalProperties":false,"required":["url","durationSeconds","durationToken","sizeBytes","mimeType"],"properties":{"url":{"type":"string"},"durationSeconds":{"type":"number","minimum":2,"maximum":15},"durationToken":{"type":"string","description":"`duration_token` from the original Files API upload for the same model."},"sizeBytes":{"type":"integer","minimum":1},"mimeType":{"type":"string"}}},"SignedUploadMetadataInput":{"type":"object","additionalProperties":false,"required":["url","token","sizeBytes"],"properties":{"url":{"type":"string"},"token":{"type":"string","description":"`image_dimensions_token` or `video_metadata_token` from the original Files API upload for the same model and URL."},"sizeBytes":{"type":"integer","minimum":1}}},"PublicApiFile":{"type":"object","required":["id","object","kind","file_name","mime_type","size_bytes","url","duration_seconds","duration_token","width","height","image_dimensions_token","video_width","video_height","frames_per_second","video_bitrate_mbps","video_file_size_bytes","video_metadata_token","created_at","expires_at"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"file"},"kind":{"type":"string","enum":["image","video","audio"]},"file_name":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":0},"url":{"type":"string"},"duration_seconds":{"type":["number","null"]},"duration_token":{"type":["string","null"]},"width":{"type":["integer","null"],"minimum":1},"height":{"type":["integer","null"],"minimum":1},"image_dimensions_token":{"type":["string","null"],"description":"Signed image metadata from the original upload. File-retrieval responses return `null` here. If the model requires this proof, keep the original token and matching metadata; re-upload the image if the token is missing or expired."},"video_width":{"type":["integer","null"],"minimum":1},"video_height":{"type":["integer","null"],"minimum":1},"frames_per_second":{"type":["number","null"],"exclusiveMinimum":0},"video_bitrate_mbps":{"type":["number","null"],"exclusiveMinimum":0},"video_file_size_bytes":{"type":["integer","null"],"minimum":1},"video_metadata_token":{"type":["string","null"],"description":"Signed video metadata from the original upload for this model. File-retrieval responses return `null` here. If the model requires this proof, keep the original token and matching metadata; re-upload the video if the token is missing or expired."},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"}}},"ChatCompletionRequest":{"type":"object","required":["model","message"],"properties":{"model":{"type":"string","enum":["gpt-6-1-sol-chat","gpt-6-1-terra-chat","gpt-6-astra-chat","gpt-6-sol-chat","gpt-6-luna-chat","gpt-5-6-luna-chat","gpt-5-6-terra-chat","gpt-5-6-sol-chat","gpt-5-5-chat","gpt-5-2-chat","gemini-4-argon-chat","gemini-4-carbon-chat","gemini-3-8-flash-chat","gemini-3-6-flash-chat","gemini-3-1-pro-chat","gemini-3-pro-chat","claude-opus-5-5-chat","claude-sonnet-5-5-chat","claude-haiku-5-5-chat","claude-fable-5-chat","claude-sonnet-5-chat","claude-opus-5-chat","claude-opus-4-8-chat","claude-opus-4-7-chat","claude-opus-4-6-chat","claude-sonnet-4-6-chat","claude-opus-4-5-chat","claude-sonnet-4-5-chat","claude-haiku-4-5-chat","kimi-k3-1-pro-chat","kimi-k3-chat","deepseek-v4-1-flash-chat"]},"session_id":{"type":"string"},"message":{"type":"string","minLength":1,"maxLength":8000},"tool_slug":{"type":"string"},"enable_web_search":{"type":"boolean"},"reasoning_effort":{"type":"string","enum":["default","minimal","low","medium","high","xhigh"]},"thought_mode":{"type":"string","enum":["default","on","off"]},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/ChatAttachmentInput"},"maxItems":6,"description":"If the selected model supports image attachments, use `file_id` values from `/api/v1/files`. Check `chat_capabilities.image_attachments` before sending them."},"client_request_id":{"type":"string","maxLength":128}}},"ChatAttachmentInput":{"type":"object","required":["file_id"],"properties":{"file_id":{"type":"string"}}},"ChatCompletion":{"type":"object","required":["id","object","session_id","model","created_at","message","usage","credits"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"chat.completion"},"session_id":{"type":"string"},"model":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"message":{"$ref":"#/components/schemas/ChatMessage"},"usage":{"$ref":"#/components/schemas/ChatUsage"},"credits":{"$ref":"#/components/schemas/ChatCredits"}}},"ChatStreamSessionCreatedEvent":{"type":"object","required":["request_id","session_id","model"],"properties":{"request_id":{"type":"string"},"session_id":{"type":"string"},"model":{"type":"string"}}},"ChatStreamDeltaEvent":{"type":"object","required":["request_id","session_id","delta","index"],"properties":{"request_id":{"type":"string"},"session_id":{"type":"string"},"delta":{"type":"string"},"index":{"type":"integer","minimum":0}}},"ChatStreamMessageCompletedEvent":{"type":"object","required":["request_id","session_id","message"],"properties":{"request_id":{"type":"string"},"session_id":{"type":"string"},"message":{"$ref":"#/components/schemas/ChatMessage"}}},"ChatStreamUsageCompletedEvent":{"type":"object","required":["request_id","session_id","usage","credits"],"properties":{"request_id":{"type":"string"},"session_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/ChatUsage"},"credits":{"$ref":"#/components/schemas/ChatCredits"}}},"ChatStreamHeartbeatEvent":{"type":"object","required":["request_id","ts"],"properties":{"request_id":{"type":"string"},"ts":{"type":"integer"}}},"ChatStreamDoneEvent":{"type":"object","required":["request_id","ok"],"properties":{"request_id":{"type":"string"},"ok":{"type":"boolean","const":true}}},"ChatSessionList":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatSession"}}}},"ChatSessionDetail":{"allOf":[{"$ref":"#/components/schemas/ChatSession"},{"type":"object","required":["messages"],"properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}}}]},"ChatSession":{"type":"object","required":["id","object","model","tool_slug","title","controls","created_at","updated_at","last_message_at"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"chat.session"},"model":{"type":"string"},"tool_slug":{"type":["string","null"]},"title":{"type":["string","null"]},"controls":{"$ref":"#/components/schemas/ChatControls"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"last_message_at":{"type":"string","format":"date-time"}}},"ChatControls":{"type":"object","required":["enable_web_search","reasoning_effort","thought_mode"],"properties":{"enable_web_search":{"type":"boolean"},"reasoning_effort":{"type":["string","null"]},"thought_mode":{"type":["string","null"]}}},"ChatMessage":{"type":"object","required":["id","role","content","created_at"],"properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"ChatUsage":{"type":"object","required":["input_tokens","output_tokens","total_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0}}},"ChatCredits":{"type":"object","required":["reserved","final","settlement_status"],"properties":{"reserved":{"type":"integer","minimum":0},"final":{"type":"integer","minimum":0},"settlement_status":{"type":"string","enum":["PENDING","RESERVED","SUBMITTING","SUBMISSION_UNKNOWN","SETTLED","REFUNDED","FAILED","RECONCILIATION_REQUIRED"]}}},"PublicGeneration":{"type":"object","required":["id","status","model","reserved_credits","final_credits","settlement_status","created_at","updated_at","result","error"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","processing","succeeded","failed"]},"model":{"type":"string"},"reserved_credits":{"type":"integer"},"final_credits":{"type":"integer"},"settlement_status":{"type":"string","enum":["PENDING","RESERVED","SUBMITTING","SUBMISSION_UNKNOWN","SETTLED","REFUNDED","FAILED","RECONCILIATION_REQUIRED"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"result":{"anyOf":[{"type":"null"},{"$ref":"#/components/schemas/GenerationResult"}]},"error":{"anyOf":[{"type":"null"},{"$ref":"#/components/schemas/GenerationError"}]}}},"GenerationResult":{"type":"object","required":["primary_url","urls"],"properties":{"layers":{"type":"array","description":"Ordered layer outputs when returned by an image decomposition task. z_index 0 is the base image. Each layer keeps its URL, size, name, description and absolute or normalized bounding box when supplied. The urls array includes all returned layer files.","items":{"type":"object","required":["z_index","url"],"properties":{"z_index":{"type":"integer","minimum":0},"url":{"type":"string","format":"uri"},"size":{"type":"string"},"output_format":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"bounding_box":{"type":"object","properties":{"absolute":{"type":"array","minItems":4,"maxItems":4,"items":{"type":"number"}},"normalized":{"type":"array","minItems":4,"maxItems":4,"items":{"type":"number"}}}}}}},"primary_url":{"type":["string","null"]},"urls":{"type":"array","items":{"type":"string"}},"text_results":{"type":"array","description":"Text results, including transcriptions and lyrics. A completed result may contain an empty text string.","items":{"type":"object","properties":{"title":{"type":"string"},"text":{"type":"string"},"status":{"type":"string"}}}}}},"GenerationError":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"CreditBalance":{"type":"object","required":["current_credits"],"properties":{"current_credits":{"type":"integer","minimum":0}}},"WebhookEndpointList":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"WebhookEndpointCreate":{"type":"object","required":["name","url"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","format":"uri","maxLength":2048,"description":"Use an HTTPS URL without embedded credentials or a fragment. Localhost names and blocked IP ranges are not allowed."},"event_types":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}}}},"WebhookEndpointUpdate":{"type":"object","minProperties":1,"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","format":"uri","maxLength":2048},"event_types":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"status":{"type":"string","enum":["active","disabled"]}}},"WebhookEndpoint":{"type":"object","required":["id","object","name","url","event_types","status","secret_preview","last_success_at","last_failure_at","failure_count","created_at","updated_at","disabled_at","revoked_at"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"webhook_endpoint"},"name":{"type":"string"},"url":{"type":"string"},"event_types":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"status":{"type":"string","enum":["active","disabled","revoked"]},"secret_preview":{"type":"string"},"signing_secret":{"type":"string","description":"Returned in create and rotate-secret responses; omitted from other endpoint responses."},"last_success_at":{"type":["string","null"],"format":"date-time"},"last_failure_at":{"type":["string","null"],"format":"date-time"},"failure_count":{"type":"integer","minimum":0},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"disabled_at":{"type":["string","null"],"format":"date-time"},"revoked_at":{"type":["string","null"],"format":"date-time"}}},"WebhookEventType":{"type":"string","enum":["generation.succeeded","generation.failed"]},"WebhookEventList":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}}}},"WebhookEvent":{"type":"object","required":["id","object","type","api_version","status","attempts_count","next_attempt_at","last_attempt_at","delivered_at","failed_at","created_at","updated_at"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"webhook_event"},"type":{"$ref":"#/components/schemas/WebhookEventType"},"api_version":{"type":"string"},"status":{"type":"string","enum":["pending","delivering","delivered","failed"]},"attempts_count":{"type":"integer","minimum":0},"next_attempt_at":{"type":["string","null"],"format":"date-time"},"last_attempt_at":{"type":["string","null"],"format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"failed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"WebhookDeliveryList":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"WebhookDelivery":{"type":"object","required":["id","object","endpoint_id","event_id","attempt_number","request_id","status","http_status","response_snippet","error_code","error_message","duration_ms","attempted_at","created_at"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"webhook_delivery"},"endpoint_id":{"type":"string"},"event_id":{"type":"string"},"attempt_number":{"type":"integer","minimum":1},"request_id":{"type":"string"},"status":{"type":"string","enum":["success","failed","timeout","skipped"]},"http_status":{"type":["integer","null"]},"response_snippet":{"type":["string","null"],"maxLength":2048},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"duration_ms":{"type":["integer","null"],"minimum":0},"attempted_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"WebhookTestResult":{"type":"object","required":["id","object","type","endpoint_id","request_id","status","http_status","response_snippet","error_code","error_message","duration_ms"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"webhook_test"},"type":{"type":"string","const":"webhook.test"},"endpoint_id":{"type":"string"},"request_id":{"type":"string"},"status":{"type":"string","enum":["success","failed","timeout","skipped"]},"http_status":{"type":["integer","null"]},"response_snippet":{"type":["string","null"],"maxLength":2048},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"duration_ms":{"type":["integer","null"],"minimum":0}}},"PublicApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["public_api_disabled","api_key_missing","api_key_invalid","api_key_revoked","api_key_expired","api_scope_denied","rate_limited","validation_failed","not_found","webhook_url_rejected","chat_model_not_supported","chat_session_conflict","chat_attachment_not_supported","idempotency_conflict","insufficient_credits","internal_error"]},"message":{"type":"string"},"requestId":{"type":"string"}}}}},"ApiKeyScope":{"type":"string","enum":["models:read","generations:create","generations:read","files:create","files:read","credits:read","webhooks:manage","chat:create","chat:read"]}},"responses":{"PublicApiError":{"description":"Public API error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}}}}