{"openapi":"3.1.0","info":{"title":"Kerox API","version":"0.1.0","description":"Image and video generation API. One task shape for every model; each model's `input` uses the model maker's own parameters (see `GET /v1/models/{id}` → `input_schema`)."},"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_…`"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","balance_error","permission_error","not_found_error","conflict_error","rate_limit_error","api_error"]},"code":{"type":"string","description":"Stable; see the error table in docs"},"message":{"type":"string"},"param":{"type":"string","description":"Offending field, e.g. input.duration"},"request_id":{"type":"string"},"doc_url":{"type":"string","format":"uri"}},"required":["type","code","message","request_id"]}},"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"},"output":{"anyOf":[{"$ref":"#/components/schemas/TaskOutput"},{"type":"null"}]},"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"}},"required":["id","object","model","status","source","format","input","output","error","cost","metadata","warnings","created_at","started_at","completed_at","expires_at"]},"TaskStatus":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"TaskOutput":{"type":"object","properties":{"images":{"type":"array","items":{"$ref":"#/components/schemas/OutputFile"}},"videos":{"type":"array","items":{"$ref":"#/components/schemas/OutputFile"}},"audios":{"type":"array","items":{"$ref":"#/components/schemas/OutputFile"}}}},"OutputFile":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"content_type":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"duration":{"type":"number","description":"Seconds (video and audio)"}},"required":["url","content_type"]},"TaskError":{"type":"object","properties":{"code":{"type":"string","enum":["content_policy_violation","invalid_input","input_fetch_failed","generation_failed","timeout","model_unavailable","internal_error"]},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"]},"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. Native format by default; validated against the model's `input_schema`."},"format":{"type":"string","enum":["native","unified"],"default":"native"},"webhook_url":{"type":"string","pattern":"^https:\\/\\/"},"metadata":{"type":"object","additionalProperties":{},"description":"Returned as-is. At most 4 KB when serialized."},"wait_seconds":{"type":"integer","minimum":0,"maximum":60,"default":0}},"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)."},"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"},"mapping":{"type":"object","additionalProperties":{},"description":"Unified field → native parameter (and value conversion, if any)."}},"required":["supported"]},"pricing":{"$ref":"#/components/schemas/ModelPricing"},"typical_seconds":{"type":["integer","null"],"description":"Median time of recent successful tasks"},"timeout_seconds":{"type":"integer"}},"required":["id","object","name","maker","type","status","description","input_schema","schema_version","param_renames","unified","pricing","typical_seconds","timeout_seconds"]},"ModelPricing":{"type":"object","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 (resolution, pixel tier). Key \"default\" when there are no tiers."},"official_prices":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Money"},"description":"The model maker's list prices, for comparison."},"input_images":{"type":"object","properties":{"free_count":{"type":"integer"},"price":{"$ref":"#/components/schemas/Money"},"official_price":{"$ref":"#/components/schemas/Money"}},"required":["free_count","price","official_price"],"description":"Each reference image beyond `free_count` adds `price`."},"video_input_prices":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Money"},"description":"Token models: price per million tokens when the input has a reference video."},"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"]},"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 and canceled, 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"]},"url":{"type":"string","format":"uri"},"upload_url":{"type":"string","format":"uri"},"upload_headers":{"type":"object","additionalProperties":{"type":"string"}},"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. With `wait_seconds` > 0 the task may already be finished.","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"}}}},"422":{"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. Sent with `rate_limited`, not with `concurrency_limited`."},"required":false,"description":"Seconds to wait. Sent with `rate_limited`, not with `concurrency_limited`."}},"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,"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"}}}},"422":{"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"}}}},"422":{"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}/cancel":{"post":{"operationId":"cancelTask","summary":"Cancel a queued task (full refund)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^task_","example":"task_01JD8X9B4Q2M7T8N3K5P6R1S0V"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The canceled 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"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"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) × width × height × 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"}}}},"422":{"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.","security":[{},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["image","video"]},"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":{"$ref":"#/components/schemas/Model"}}},"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"}}}},"422":{"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":{"$ref":"#/components/schemas/Model"}}}},"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"}}}},"422":{"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 and canceled 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"}}}},"422":{"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"}}}},"422":{"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"}}}},"422":{"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"}}}}}}}},"webhooks":{}}