{"openapi":"3.1.0","info":{"title":"Kerox API","version":"0.1.0","description":"Same image and video models, lower prices, billed per successful call. One task shape across models; read each model's input schema with `GET \/v1\/models\/{id}`."},"servers":[{"url":"https:\/\/api.kerox.ai\/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key from the console, e.g. `kx_live_\u2026`"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","unauthorized","forbidden","insufficient_balance","not_found","model_unavailable","rate_limited","internal_error"],"description":"One of eight; what to do next. The message says which case it was."},"message":{"type":"string"},"param":{"type":"string","description":"Offending field, e.g. input.duration"}},"required":["code","message"]}},"required":["error"]},"Task":{"type":"object","properties":{"id":{"type":"string","example":"task_01JD8X9B4Q2M7T8N3K5P6R1S0V"},"object":{"type":"string","enum":["task"]},"model":{"type":"string"},"status":{"$ref":"#\/components\/schemas\/TaskStatus"},"source":{"type":"string","enum":["api","studio","mcp"]},"format":{"type":"string","enum":["native","unified"]},"input":{"type":"object","additionalProperties":{},"description":"Native parameters actually used. An expired (after seven days) or unavailable inline image is null in its original position."},"outputs":{"type":"array","items":{"$ref":"#\/components\/schemas\/Output"},"description":"Result files, the main result first (a video before its last frame). Empty until the task succeeds, and again once the files are deleted."},"outputs_deleted":{"type":"boolean","description":"True once the result files are gone: deleted with `DELETE \/v1\/tasks\/{id}\/outputs` or past `expires_at`. `outputs` is then empty; the task, its cost and its charges stay."},"error":{"anyOf":[{"$ref":"#\/components\/schemas\/TaskError"},{"type":"null"}]},"cost":{"$ref":"#\/components\/schemas\/TaskCost"},"metadata":{"type":["object","null"],"additionalProperties":{}},"warnings":{"type":"array","items":{"$ref":"#\/components\/schemas\/Warning"}},"created_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time","description":"Output files stop working after this. Moves up to the deletion time when the files are deleted."}},"required":["id","object","model","status","source","format","input","outputs","outputs_deleted","error","cost","metadata","warnings","created_at","started_at","completed_at","expires_at"]},"TaskStatus":{"type":"string","enum":["processing","succeeded","failed"],"description":"`processing` until the task ends `succeeded` or `failed`; a submitted task always ends in one of the two."},"Output":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","audio"]},"url":{"type":"string","format":"uri"},"content_type":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"duration":{"type":"number","description":"Seconds (video and audio)"}},"required":["type","url","content_type"]},"TaskError":{"type":"object","properties":{"code":{"type":"string","enum":["content_violation","moderation_unavailable","input_fetch_failed","invalid_input","timeout","generation_failed"]},"message":{"type":"string"}},"required":["code","message"]},"TaskCost":{"type":"object","properties":{"amount":{"$ref":"#\/components\/schemas\/Money"},"currency":{"type":"string","enum":["USD"]},"status":{"type":"string","enum":["held","settled","refunded"],"description":"held = estimate is on hold; settled = actual charge; refunded = 0.0000"}},"required":["amount","currency","status"]},"Money":{"type":"string","pattern":"^-?\\d+\\.\\d{4}$","description":"US dollars with 4 decimals.","example":"0.0300"},"Warning":{"type":"object","properties":{"code":{"type":"string","enum":["param_renamed"]},"message":{"type":"string"},"param":{"type":"string"},"replacement":{"type":"string"},"sunset":{"type":"string","format":"date"}},"required":["code","message"]},"TaskCreate":{"type":"object","properties":{"model":{"type":"string","minLength":1,"example":"bytedance\/seedance-2.5"},"input":{"type":"object","additionalProperties":{},"description":"Model parameters. Unified format by default: the model's `unified.input_schema`. With `format: \"native\"`, the maker's own parameters: the model's `input_schema`."},"format":{"type":"string","enum":["native","unified"],"default":"unified","description":"How `input` is written. Left out means `unified` (a model without unified support takes `native`). `native` is for requests written against the maker\u2019s own API."},"webhook_url":{"type":"string","pattern":"^https:\\\/\\\/","description":"Gets the task object once, when it ends `succeeded` or `failed`. Without it nothing is pushed; poll `GET \/v1\/tasks\/{id}`."},"metadata":{"type":"object","additionalProperties":{},"description":"Returned as-is. At most 4 KB when serialized."},"enable_content_filter":{"type":"boolean","default":true,"description":"Kerox checks the prompt, input images and generated images, and fails a task that does not pass with `content_violation` (refunded in full). `false` turns this filter off for the task; the model maker's own moderation still applies. Studio always checks."}},"required":["model","input"],"additionalProperties":false},"Estimate":{"type":"object","properties":{"object":{"type":"string","enum":["estimate"]},"model":{"type":"string"},"amount":{"$ref":"#\/components\/schemas\/Money"},"currency":{"type":"string","enum":["USD"]},"exact":{"type":"boolean","description":"false when the final charge depends on the result (token-billed models are charged by the tokens reported for the result); the hold is this amount."},"breakdown":{"type":"object","properties":{"unit":{"type":"string","enum":["image","second","token"]},"quantity":{"type":"number"},"unit_price":{"$ref":"#\/components\/schemas\/Money"},"per":{"type":"integer","description":"`unit_price` is per this many units (1000000 for tokens)."},"tier":{"type":"string"}},"required":["unit","quantity","unit_price","per"]},"warnings":{"type":"array","items":{"$ref":"#\/components\/schemas\/Warning"}}},"required":["object","model","amount","currency","exact","breakdown","warnings"]},"Model":{"type":"object","properties":{"id":{"type":"string","example":"bytedance\/seedance-2.5"},"object":{"type":"string","enum":["model"]},"name":{"type":"string","example":"Seedance 2.5"},"maker":{"type":"string","example":"ByteDance"},"type":{"type":"string","enum":["image","video"]},"status":{"type":"string","enum":["live","coming_soon"]},"description":{"type":"string"},"input_schema":{"type":"object","additionalProperties":{},"description":"JSON Schema (2020-12) of the native parameters. Properties carry x-label-en, x-label-zh and x-tier (common | advanced). `x-ignored` on the schema lists maker parameters a request may carry in either format and the model drops."},"schema_version":{"type":"integer"},"param_renames":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"sunset":{"type":"string","format":"date"}},"required":["from","to","sunset"]}},"unified":{"type":"object","properties":{"supported":{"type":"boolean"},"input_schema":{"type":"object","additionalProperties":{},"description":"JSON Schema (2020-12) of the unified-format parameters: what `input` takes when `format` is left out or `unified`. Same annotations as `input_schema`."},"mapping":{"type":"object","additionalProperties":{},"description":"How unified parameters reach the native ones: `fields` (unified name \u2192 native parameter it is converted to, null when the model does not support it) and `passthrough` (the maker\u2019s parameters kept under their own name)."}},"required":["supported"]},"pricing":{"$ref":"#\/components\/schemas\/ModelPricing"},"typical_seconds":{"type":["integer","null"],"description":"Median time of recent successful tasks"},"timeout_seconds":{"type":"integer","example":43200,"description":"Model deadline after which a task accepted for generation or awaiting result storage fails with a full refund. In-progress tasks without a confirmed submission or result have a separate 10-minute limit."}},"required":["id","object","name","maker","type","status","description","input_schema","schema_version","param_renames","unified","pricing","typical_seconds","timeout_seconds"]},"ModelPricing":{"type":["object","null"],"properties":{"unit":{"type":"string","enum":["image","second","token"]},"per":{"type":"integer","description":"Prices are per this many units: 1, or 1000000 (per million tokens) when `unit` is `token`."},"currency":{"type":"string","enum":["USD"]},"prices":{"type":"object","additionalProperties":{"$ref":"#\/components\/schemas\/Money"},"description":"Price per `per` units for this account, keyed by tier or image token category (text_input, cached_text_input, image_input, cached_image_input, image_output). Key \"default\" when there are no tiers."},"regular_prices":{"type":"object","additionalProperties":{"$ref":"#\/components\/schemas\/Money"}},"sale_ends_at":{"type":"string","format":"date-time"},"official_prices":{"type":"object","additionalProperties":{"$ref":"#\/components\/schemas\/Money"},"description":"The model maker's list prices, for comparison. Empty when the maker publishes none."},"input_images":{"type":"object","properties":{"free_count":{"type":"integer"},"price":{"$ref":"#\/components\/schemas\/Money"},"official_price":{"$ref":"#\/components\/schemas\/Money"}},"required":["free_count","price"],"description":"Each reference image beyond `free_count` adds `price`."},"output_prices_with_video":{"type":"object","additionalProperties":{"$ref":"#\/components\/schemas\/Money"},"description":"Output price per second when reference video is provided, by resolution."},"minimum_reference_seconds_is_output":{"type":"boolean","description":"Bill at least the output duration for reference video."},"input_video_seconds_billed":{"type":"boolean","description":"Per-second models: the length of reference videos is billed too, at the same rate as the output unless `video_input_prices` lists their own rate."},"video_input_prices":{"type":"object","additionalProperties":{"$ref":"#\/components\/schemas\/Money"},"description":"Token models: price per million tokens when the input has a reference video. Per-second models: price per second of reference video, by output resolution, when it differs from the output rate."},"official_video_input_prices":{"type":"object","additionalProperties":{"$ref":"#\/components\/schemas\/Money"}},"approx_per_second":{"type":"object","additionalProperties":{"$ref":"#\/components\/schemas\/Money"},"description":"Token models: approx. price per output second at 16:9 without a reference video, by resolution. Other ratios differ by under 5%; audio does not change the price."},"approx_per_second_video_input":{"type":"object","additionalProperties":{"$ref":"#\/components\/schemas\/Money"},"description":"Token models: approx. price per second of output plus reference video, at 16:9."},"token_formula":{"type":"string","description":"Token models: how billed tokens are counted. Use POST \/v1\/estimate for the price of a request."}},"required":["unit","per","currency","prices","official_prices"]},"ChatModel":{"allOf":[{"$ref":"#\/components\/schemas\/Model"},{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"status":{"type":"string","enum":["live"]},"pricing":{"type":"object","properties":{"prices":{"type":"object","properties":{"input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cached_input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"output":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cache_write":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$","description":"Rate for prompt tokens written to the prompt cache. Omitted when they cost the same as input."}},"required":["input","cached_input","output"]},"official_prices":{"type":"object","properties":{"input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cached_input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"output":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cache_write":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$","description":"Rate for prompt tokens written to the prompt cache. Omitted when they cost the same as input."}},"required":["input","cached_input","output"]},"unit":{"type":"string","enum":["token"]},"currency":{"type":"string","enum":["USD"]},"per":{"type":"number","enum":[1000000]},"long_context":{"type":"object","properties":{"prices":{"type":"object","properties":{"input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cached_input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"output":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cache_write":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$","description":"Rate for prompt tokens written to the prompt cache. Omitted when they cost the same as input."}},"required":["input","cached_input","output"]},"official_prices":{"type":"object","properties":{"input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cached_input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"output":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cache_write":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$","description":"Rate for prompt tokens written to the prompt cache. Omitted when they cost the same as input."}},"required":["input","cached_input","output"]},"min_prompt_tokens":{"type":"integer","exclusiveMinimum":0}},"required":["prices","official_prices","min_prompt_tokens"]},"off_peak":{"type":"object","properties":{"prices":{"type":"object","properties":{"input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cached_input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"output":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cache_write":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$","description":"Rate for prompt tokens written to the prompt cache. Omitted when they cost the same as input."}},"required":["input","cached_input","output"]},"official_prices":{"type":"object","properties":{"input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cached_input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"output":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cache_write":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$","description":"Rate for prompt tokens written to the prompt cache. Omitted when they cost the same as input."}},"required":["input","cached_input","output"]},"peak_utc":{"type":"array","items":{"type":"object","properties":{"days":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"from":{"type":"string"},"to":{"type":"string"}},"required":["days","from","to"]}},"long_context":{"type":"object","properties":{"prices":{"type":"object","properties":{"input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cached_input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"output":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cache_write":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$","description":"Rate for prompt tokens written to the prompt cache. Omitted when they cost the same as input."}},"required":["input","cached_input","output"]},"official_prices":{"type":"object","properties":{"input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cached_input":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"output":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$"},"cache_write":{"type":"string","pattern":"^\\d+\\.\\d{4,14}$","description":"Rate for prompt tokens written to the prompt cache. Omitted when they cost the same as input."}},"required":["input","cached_input","output"]}},"required":["prices","official_prices"]}},"required":["prices","official_prices","peak_utc"]}},"required":["prices","official_prices","unit","currency","per"]},"chat":{"type":"object","properties":{"context_tokens":{"type":"integer","exclusiveMinimum":0},"max_output_tokens":{"type":"integer","exclusiveMinimum":0},"streaming":{"type":"boolean","enum":[true]},"image_input":{"type":"boolean"},"parameters":{"type":"array","items":{"type":"string","enum":["temperature","top_p","stop","presence_penalty","frequency_penalty","thinking","reasoning_effort","tool_stream","do_sample","prompt_cache_key","tools","tool_choice","response_format"]}},"reasoning_efforts":{"type":"array","items":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max","ultra"]},"description":"Values `reasoning_effort` takes on this model; empty when it takes no `reasoning_effort`."}},"required":["context_tokens","max_output_tokens","streaming","image_input","parameters","reasoning_efforts"]}},"required":["chat"]}]},"Account":{"type":"object","properties":{"object":{"type":"string","enum":["account"]},"currency":{"type":"string","enum":["USD"]},"balance":{"$ref":"#\/components\/schemas\/Money"},"held":{"$ref":"#\/components\/schemas\/Money"},"available":{"$ref":"#\/components\/schemas\/Money"},"running_tasks":{"type":"integer"},"limits":{"type":"object","properties":{"max_concurrent":{"type":"integer"},"max_per_minute":{"type":"integer"}},"required":["max_concurrent","max_per_minute"]}},"required":["object","currency","balance","held","available","running_tasks","limits"]},"Usage":{"type":"object","properties":{"object":{"type":"string","enum":["usage"]},"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"model":{"type":"string"},"tasks":{"type":"integer"},"succeeded":{"type":"integer"},"failed":{"type":"integer","description":"Failed tasks, all refunded"},"spent":{"$ref":"#\/components\/schemas\/Money"}},"required":["tasks","succeeded","failed","spent"]}},"total":{"type":"object","properties":{"tasks":{"type":"integer"},"spent":{"$ref":"#\/components\/schemas\/Money"}},"required":["tasks","spent"]}},"required":["object","start","end","data","total"]},"File":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["file"]},"filename":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"integer"},"status":{"type":"string","enum":["pending","ready","deleted"],"description":"`deleted` once deleted with `DELETE \/v1\/files\/{id}` or past `expires_at`"},"url":{"type":["string","null"],"format":"uri","description":"Use this in task input once ready. `null` once deleted"},"upload_url":{"type":"string","format":"uri"},"upload_headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Send exactly these with the PUT: Content-Type and If-None-Match: *. The URL uploads once; a PUT when the file is already there, or was deleted, gets 412"},"expires_at":{"type":"string","format":"date-time"}},"required":["id","object","status","url","expires_at"]}},"parameters":{}},"paths":{"\/tasks":{"post":{"operationId":"createTask","summary":"Create a task","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Same key within 24 hours creates at most one task and charges once."},"required":false,"description":"Same key within 24 hours creates at most one task and charges once.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskCreate"}}}},"responses":{"200":{"description":"Same Idempotency-Key and same body as an earlier request; the earlier task is returned.","headers":{"x-ratelimit-limit":{"schema":{"type":"integer","description":"Submits allowed per minute"},"required":true,"description":"Submits allowed per minute"},"x-ratelimit-remaining":{"schema":{"type":"integer","description":"Submits left in this minute"},"required":true,"description":"Submits left in this minute"},"x-ratelimit-reset":{"schema":{"type":"integer","description":"Seconds until the window resets"},"required":true,"description":"Seconds until the window resets"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Task"}}}},"201":{"description":"Task created, `processing`. Poll `GET \/v1\/tasks\/{id}` or wait for the webhook.","headers":{"x-ratelimit-limit":{"schema":{"type":"integer","description":"Submits allowed per minute"},"required":true,"description":"Submits allowed per minute"},"x-ratelimit-remaining":{"schema":{"type":"integer","description":"Submits left in this minute"},"required":true,"description":"Submits left in this minute"},"x-ratelimit-reset":{"schema":{"type":"integer","description":"Seconds until the window resets"},"required":true,"description":"Seconds until the window resets"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Task"}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"402":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"409":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"413":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"429":{"description":"Too many requests","headers":{"x-ratelimit-limit":{"schema":{"type":"integer","description":"Submits allowed per minute"},"required":true,"description":"Submits allowed per minute"},"x-ratelimit-remaining":{"schema":{"type":"integer","description":"Submits left in this minute"},"required":true,"description":"Submits left in this minute"},"x-ratelimit-reset":{"schema":{"type":"integer","description":"Seconds until the window resets"},"required":true,"description":"Seconds until the window resets"},"retry-after":{"schema":{"type":"integer","description":"Seconds to wait, when over the per-minute limit. Not sent when the limit on tasks in progress is reached."},"required":false,"description":"Seconds to wait, when over the per-minute limit. Not sent when the limit on tasks in progress is reached."}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}},"get":{"operationId":"listTasks","summary":"List tasks, newest first","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"$ref":"#\/components\/schemas\/TaskStatus"},"required":false,"description":"`processing` until the task ends `succeeded` or `failed`; a submitted task always ends in one of the two.","name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"model","in":"query"},{"schema":{"type":"string","enum":["api","studio","mcp"]},"required":false,"name":"source","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of tasks.","content":{"application\/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Task"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}}},"\/tasks\/{id}":{"get":{"operationId":"getTask","summary":"Get a task","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^task_","example":"task_01JD8X9B4Q2M7T8N3K5P6R1S0V"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The task.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Task"}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}}},"\/tasks\/{id}\/outputs":{"delete":{"operationId":"deleteTaskOutputs","summary":"Delete the result files of a finished task","description":"Deletes the task's generated files now, from storage and from the CDN cache; they can't be recovered. The task itself stays: status, model, input, cost, metadata and times are kept, and nothing is refunded. Afterwards `outputs` is empty and `outputs_deleted` is true. Only finished tasks (`succeeded` or `failed`); a task still `processing` returns 400. Deleting again returns the same task.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^task_","example":"task_01JD8X9B4Q2M7T8N3K5P6R1S0V"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The task after the delete.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Task"}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}}},"\/estimate":{"post":{"operationId":"estimate","summary":"Estimate the price of a task without creating it","description":"Same body as `POST \/v1\/tasks`; returns what submitting it would hold, at this account's prices. No task is created and nothing is charged. Token-billed video models (Seedance) are charged by tokens: tokens = (output seconds + reference video seconds) \u00d7 width \u00d7 height \u00d7 fps \/ 1024, with width and height from the requested resolution and ratio; the estimate applies that formula to this request (`exact: false`, the charge follows the tokens of the result).","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskCreate"}}}},"responses":{"200":{"description":"The estimate.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Estimate"}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"413":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}}},"\/models":{"get":{"operationId":"listModels","summary":"List models with parameter schemas and prices","description":"Works without a key (list prices). With a key, `pricing` shows this account's prices. Use `type=text` for published text models. The default list contains image and video models.","security":[{},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["image","video","text"]},"required":false,"name":"type","in":"query"}],"responses":{"200":{"description":"All live and coming-soon models.","content":{"application\/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"anyOf":[{"$ref":"#\/components\/schemas\/Model"},{"$ref":"#\/components\/schemas\/ChatModel"}]}}},"required":["object","data"]}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}}},"\/models\/{maker}\/{name}":{"get":{"operationId":"getModel","summary":"Get one model (e.g. \/models\/bytedance\/seedance-2.5)","security":[{},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","example":"bytedance"},"required":true,"name":"maker","in":"path"},{"schema":{"type":"string","example":"seedance-2.5"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The model.","content":{"application\/json":{"schema":{"anyOf":[{"$ref":"#\/components\/schemas\/Model"},{"$ref":"#\/components\/schemas\/ChatModel"}]}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}}},"\/account":{"get":{"operationId":"getAccount","summary":"Balance, held amount and limits","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The account.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Account"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}}},"\/usage":{"get":{"operationId":"getUsage","summary":"Usage and spend by day and model","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"date","description":"UTC date, inclusive"},"required":true,"description":"UTC date, inclusive","name":"start","in":"query"},{"schema":{"type":"string","format":"date","description":"UTC date, inclusive; at most 92 days after start"},"required":true,"description":"UTC date, inclusive; at most 92 days after start","name":"end","in":"query"},{"schema":{"type":"string","enum":["day","model","day_model"],"default":"day_model"},"required":false,"name":"group_by","in":"query"}],"responses":{"200":{"description":"Usage rows. Failed tasks count in `failed` but not in `spent`.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Usage"}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}}},"\/files":{"post":{"operationId":"createFile","middleware":[null,null,null],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"content_type":{"type":"string","enum":["image\/jpeg","image\/jpg","image\/png","image\/webp","image\/bmp","image\/tiff","image\/gif","image\/avif","image\/heic","image\/heif","video\/mp4","video\/quicktime","video\/webm","audio\/wav","audio\/x-wav","audio\/wave","audio\/vnd.wave","audio\/mpeg","audio\/mp4"]},"size":{"type":"integer","minimum":1,"maximum":209715200}},"required":["filename","content_type","size"]}},"multipart\/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"The upload and its expiry.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/File"}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"413":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"429":{"description":"Upload rate limit reached","headers":{"retry-after":{"schema":{"type":"integer","description":"Seconds to wait"},"required":true,"description":"Seconds to wait"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}}},"\/files\/{id}":{"get":{"operationId":"getFile","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The upload and its expiry.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/File"}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"404":{"description":"File not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}},"delete":{"operationId":"deleteFile","summary":"Delete an uploaded file","description":"Deletes the file now, from storage and from the CDN cache; it can't be recovered. The old link serves an empty file, and a PUT to `upload_url` still in progress or made later gets 412. The file object stays with `status` `deleted` and no `url`. A task still running with this file as input may fail with `input_fetch_failed`. Deleting again returns the same object.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The file after the delete.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/File"}}}},"400":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"404":{"description":"File not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"500":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}},"503":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"}}}}}}}},"webhooks":{}}