{"openapi":"3.1.0","info":{"title":"eWest API","version":"2026-11-01","summary":"One OpenAI-compatible API for video, image, audio and language models.","description":"Video, image, audio and language models behind one API at `https://api.ewest.ai`. Chat speaks the OpenAI (`/v1/chat/completions`, `/v1/responses`) and Anthropic (`/v1/messages`) formats, so their SDKs work with a changed base URL. Model names are `ewest/*`; `GET /v1/catalog` lists them.\n\n**Errors** have two shapes. `POST /v1/messages` and `POST /v1/messages/count_tokens` use Anthropic's envelope, `{\"type\": \"error\", \"error\": {\"type\", \"message\", \"code\", \"param\"}, \"request_id\"}` (see the `AnthropicError` schema), with Anthropic's `error.type` names (`authentication_error` for 401, `billing_error` for 402, `rate_limit_error` for 429, ...). Every other route uses the OpenAI-style `{\"error\": {\"message\", \"type\", \"code\", \"param\"}}` (see the `Error` schema). The HTTP status and `code` are the same on both. Model errors are the same everywhere: unknown model 404 `model_not_found`, a model of another type 400 `model_not_supported`, a model the key may not use 403 `permission_error`, no model 400 \"model is required.\" with `param: model`: on the chat-type endpoints (`/v1/chat/completions`, `/v1/completions`, `/v1/messages`, `/v1/responses`, `/v1/rerank`) the code is `missing_required_parameter`; other endpoints still use code `\"400\"` for a missing model. The wrong-type 400 holds whatever models the key is limited to, is checked before the model runs, and covers every endpoint, including embedding and image models sent to a chat endpoint; a wrong-type model in `models` is the same 400 with `param: models`.\n\n**Trace ids:** every response carries `x-request-id`; paste it into Console → Requests. For jobs it is the job id.\n\nOperations and fields marked `x-ewest-stability: beta` may still change. The uptime checks `/health/liveliness` and `/health/readiness` are public but left out of this spec on purpose. Docs: https://ewest.ai/docs","contact":{"name":"eWest","url":"https://ewest.ai/docs"}},"servers":[{"url":"https://api.ewest.ai","description":"Production"}],"externalDocs":{"description":"eWest docs","url":"https://ewest.ai/docs"},"security":[{"bearer":[]},{"apiKey":[]}],"tags":[{"name":"Chat","description":"Language models in the OpenAI and Anthropic formats."},{"name":"Embeddings","description":"Vectors and reranking."},{"name":"Images","description":"Image generation and editing."},{"name":"Audio","description":"Speech and transcription."},{"name":"Jobs","description":"Video, music and sound run as asynchronous jobs."},{"name":"Models","description":"Which models exist and what they accept."},{"name":"Account","description":"The calling key's budget and balance."}],"paths":{"/v1/chat/completions":{"post":{"operationId":"createChatCompletion","tags":["Chat"],"summary":"Chat completion","description":"OpenAI-compatible chat completions, with streaming and tool calling. Also served at `/chat/completions`. The answer's `model` is the model that answered; `x-ewest-fallback: true` marks an answer from a fallback in `models`. On Gemini models, tool calls for tools you didn't declare in `tools` (and built-in tool output such as code execution) are removed from the answer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"},"example":{"model":"ewest/gemini-flash","messages":[{"role":"user","content":"Hello!"}],"stream":true}}}},"responses":{"200":{"description":"The completion (JSON), or with `stream: true` a stream of `chat.completion.chunk` events ending with `data: [DONE]`.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"},"x-ewest-fallback":{"$ref":"#/components/headers/Fallback"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}},"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events; each `data:` is a ChatCompletionChunk, then `data: [DONE]`."},"x-ewest-sse-data":{"$ref":"#/components/schemas/ChatCompletionChunk"}}}},"400":{"description":"Invalid request (see the shared `BadRequest` response). A malformed `response_format` is caught before the model runs.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"message":"Missing required parameter: 'response_format.json_schema.schema'.","type":"invalid_request_error","param":"response_format.json_schema.schema","code":"missing_required_parameter"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/completions":{"post":{"operationId":"createCompletion","tags":["Chat"],"summary":"Text completion (legacy)","description":"The legacy OpenAI completions format, for older tools. Prefer `/v1/chat/completions`. Also served at `/completions`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionRequest"}}}},"responses":{"200":{"description":"The completion.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Completion"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/messages":{"post":{"operationId":"createMessage","tags":["Chat"],"summary":"Message (Anthropic format)","description":"The Anthropic Messages API for any `ewest/*` chat model, so the Anthropic SDKs and tools built on them work with base URL `https://api.ewest.ai`. Send the key as `x-api-key` or `Authorization: Bearer`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesRequest"},"example":{"model":"ewest/claude-haiku","max_tokens":1024,"messages":[{"role":"user","content":"Hello!"}]}}}},"responses":{"200":{"description":"The message, or with `stream: true` Anthropic stream events.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"},"x-ewest-fallback":{"$ref":"#/components/headers/Fallback"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}},"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events in the Anthropic format (`event:` + `data:`)."},"x-ewest-sse-data":{"$ref":"#/components/schemas/MessageStreamEvent"}}}},"400":{"$ref":"#/components/responses/MessagesBadRequest"},"401":{"$ref":"#/components/responses/MessagesUnauthorized"},"402":{"$ref":"#/components/responses/MessagesPaymentRequired"},"403":{"$ref":"#/components/responses/MessagesPermissionDenied"},"404":{"$ref":"#/components/responses/MessagesNotFound"},"429":{"$ref":"#/components/responses/MessagesRateLimited"},"500":{"$ref":"#/components/responses/MessagesServerError"},"502":{"$ref":"#/components/responses/MessagesBadGateway"},"503":{"$ref":"#/components/responses/MessagesServiceUnavailable"},"504":{"$ref":"#/components/responses/MessagesTimeout"}}}},"/v1/messages/count_tokens":{"post":{"operationId":"countMessageTokens","tags":["Chat"],"summary":"Count message tokens (Anthropic format)","description":"Counts the input tokens of a Messages request without running it. Free.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountTokensRequest"},"example":{"model":"ewest/claude-haiku","messages":[{"role":"user","content":"Hello, world"}]}}}},"responses":{"200":{"description":"The token count.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountTokensResponse"},"example":{"input_tokens":10}}}},"400":{"$ref":"#/components/responses/MessagesBadRequest"},"401":{"$ref":"#/components/responses/MessagesUnauthorized"},"402":{"$ref":"#/components/responses/MessagesPaymentRequired"},"403":{"$ref":"#/components/responses/MessagesPermissionDenied"},"404":{"$ref":"#/components/responses/MessagesNotFound"},"429":{"$ref":"#/components/responses/MessagesRateLimited"},"500":{"$ref":"#/components/responses/MessagesServerError"},"502":{"$ref":"#/components/responses/MessagesBadGateway"},"503":{"$ref":"#/components/responses/MessagesServiceUnavailable"},"504":{"$ref":"#/components/responses/MessagesTimeout"}}}},"/v1/responses":{"post":{"operationId":"createResponse","tags":["Chat"],"summary":"Response (OpenAI Responses format)","description":"The OpenAI Responses API for any `ewest/*` chat model. Conversations are stored by default (`store: true`, 30 days after the last turn) and continued with `previous_response_id`; send `store: false` to keep nothing and send the full conversation in `input`. `GET`/`DELETE /v1/responses/{id}` and `input_items` are available (docs: /docs/responses). Also served at `/responses`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"},"example":{"model":"ewest/gemini-flash","input":"Hello!"}}}},"responses":{"200":{"description":"The response, or with `stream: true` Responses stream events.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"},"x-ewest-fallback":{"$ref":"#/components/headers/Fallback"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}},"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events in the Responses format."},"x-ewest-sse-data":{"$ref":"#/components/schemas/ResponseStreamEvent"}}}},"400":{"description":"Invalid request (see the shared `BadRequest` response). A malformed `text.format` is caught before the model runs.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"message":"Invalid 'text.format.name': must be 1 to 64 letters, digits, underscores or dashes.","type":"invalid_request_error","param":"text.format.name","code":"invalid_value"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/embeddings":{"post":{"operationId":"createEmbeddings","tags":["Embeddings"],"summary":"Embeddings","description":"OpenAI-compatible embeddings. Also served at `/embeddings`. `x-request-id` is the call's trace id.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingsRequest"},"example":{"model":"ewest/gemini-embedding","input":["How do I reset my password?","Billing questions"]}}}},"responses":{"200":{"description":"One vector per input, in input order.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/rerank":{"post":{"operationId":"rerank","tags":["Embeddings"],"summary":"Rerank documents","description":"Orders `documents` by relevance to `query`. Also served at `/rerank`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RerankRequest"},"example":{"model":"ewest/semantic-ranker","query":"How do I get a refund?","top_n":2,"documents":["Refunds are issued within 5 days.","Our office is in Yerevan."]}}}},"responses":{"200":{"description":"Results, best first.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RerankResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/images/generations":{"post":{"operationId":"createImage","tags":["Images"],"summary":"Generate images","description":"OpenAI-compatible image generation. Images are stored on `cdn.ewest.ai` for 7 days. Also served at `/images/generations`. `x-request-id` is the call's trace id (`req_…` or a UUID).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageGenerationRequest"},"example":{"model":"ewest/flux-schnell","prompt":"a cozy cabin in the snow"}}}},"responses":{"200":{"description":"The images.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImagesResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/images/edits":{"post":{"operationId":"editImage","tags":["Images"],"summary":"Edit images","description":"Image editing for models whose catalog entry has `max_input_images` > 0: multipart with `image` files (OpenAI's images.edit) or JSON with `image_urls`. Models with `requires_image_input` are edit-only: background removal takes exactly one image and no prompt (`prompt_optional`); others take a prompt (instruction-based editors; `prompt_optional` is `false` when the catalog says so) and 1 to `max_input_images` images (1 for some). `supports_mask` models take a mask for single-image edits. Also served at `/images/edits`.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ImageEditMultipartRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/ImageEditJsonRequest"},"example":{"model":"ewest/nano-banana-2.1","prompt":"make it night","image_urls":["https://example.com/cabin.png"]}}}},"responses":{"200":{"description":"The edited images.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImagesResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/audio/speech":{"post":{"operationId":"createSpeech","tags":["Audio"],"summary":"Text to speech","description":"OpenAI-compatible speech. Returns the audio bytes, or with `response_format: \"url\"` a JSON link on `cdn.ewest.ai` (7 days).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechRequest"},"example":{"model":"ewest/eleven-v4-turbo","input":"Welcome to eWest."}}}},"responses":{"200":{"description":"The audio file (`content-type` is the model's format), or JSON with `response_format: \"url\"`.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"},"x-audio-url":{"description":"The same audio on `cdn.ewest.ai` (7 days).","schema":{"type":"string","format":"uri"}}},"content":{"audio/mpeg":{"schema":{"type":"string","contentMediaType":"audio/mpeg"}},"audio/wav":{"schema":{"type":"string","contentMediaType":"audio/wav"}},"application/json":{"schema":{"$ref":"#/components/schemas/SpeechUrlResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/audio/transcriptions":{"post":{"operationId":"createTranscription","tags":["Audio"],"summary":"Speech to text","description":"OpenAI-compatible transcription: an audio `file` (multipart) or a public `audio_url` (JSON). Billed per second of audio.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/TranscriptionMultipartRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptionJsonRequest"}}}},"responses":{"200":{"description":"`json` (default) and `verbose_json` return JSON, `text` plain text.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Transcription"},{"$ref":"#/components/schemas/TranscriptionVerbose"}]}},"text/plain":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/videos/generations":{"post":{"operationId":"createVideoJob","tags":["Jobs"],"summary":"Generate video (job)","description":"Starts a video job and returns `202` with the job at once. Follow it with `GET /v1/jobs/{id}/events` (Server-Sent Events), by polling `GET /v1/jobs/{id}`, or with a `webhook_url`. `x-request-id` is the job id.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGenerationRequest"},"example":{"model":"ewest/veo-3.1-fast","prompt":"A red fox walks through fresh snow","duration":6}}}},"callbacks":{"jobFinished":{"{$request.body#/webhook_url}":{"post":{"summary":"Job finished","description":"Sent once when the job succeeds or fails, with the final job as the body (`user-agent: ewest-webhooks/1`). Answer with a 2xx. Signed deliveries with retries (Standard Webhooks headers `webhook-id`, `webhook-timestamp`, `webhook-signature`) are coming: until then deliveries are unsigned and sent once, so poll `GET /v1/jobs/{id}` if you miss one.","x-ewest-stability":"beta","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"responses":{"200":{"description":"Received (any 2xx)."}}}}}},"responses":{"202":{"description":"The job, queued.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/audio/generations":{"post":{"operationId":"createAudioJob","tags":["Jobs"],"summary":"Generate music or sound (job)","description":"Starts a music or sound-effect job; works exactly like video jobs. The finished MP3 is on `cdn.ewest.ai` for 7 days.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudioGenerationRequest"},"example":{"model":"ewest/eleven-music-v2.5","prompt":"upbeat lo-fi beat with warm piano","duration":30}}}},"callbacks":{"jobFinished":{"{$request.body#/webhook_url}":{"post":{"summary":"Job finished","description":"Sent once when the job succeeds or fails, with the final job as the body (`user-agent: ewest-webhooks/1`). Answer with a 2xx. Signed deliveries with retries (Standard Webhooks headers `webhook-id`, `webhook-timestamp`, `webhook-signature`) are coming: until then deliveries are unsigned and sent once, so poll `GET /v1/jobs/{id}` if you miss one.","x-ewest-stability":"beta","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"responses":{"200":{"description":"Received (any 2xx)."}}}}}},"responses":{"202":{"description":"The job, queued.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/3d/generations":{"post":{"operationId":"createThreeDJob","tags":["Jobs"],"summary":"Generate a 3D model (job)","description":"Starts a 3D job from a text prompt or an image; works exactly like video jobs. The finished files (GLB, OBJ, ...) are on `cdn.ewest.ai` for 7 days; `output.files` lists them by format.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreeDGenerationRequest"},"example":{"model":"ewest/hunyuan-3d-3.1-pro","prompt":"a ceramic teapot with a bamboo handle","enable_pbr":true}}}},"callbacks":{"jobFinished":{"{$request.body#/webhook_url}":{"post":{"summary":"Job finished","description":"Sent once when the job succeeds or fails, with the final job as the body (`user-agent: ewest-webhooks/1`). Answer with a 2xx. Signed deliveries with retries (Standard Webhooks headers `webhook-id`, `webhook-timestamp`, `webhook-signature`) are coming: until then deliveries are unsigned and sent once, so poll `GET /v1/jobs/{id}` if you miss one.","x-ewest-stability":"beta","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"responses":{"200":{"description":"Received (any 2xx)."}}}}}},"responses":{"202":{"description":"The job, queued.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/PermissionDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/Timeout"}}}},"/v1/jobs":{"get":{"operationId":"listJobs","tags":["Jobs"],"summary":"List jobs","description":"The jobs this API key created, newest first.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"The jobs.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/responses/{id}":{"get":{"operationId":"getResponse","tags":["Chat"],"summary":"Get a stored response","description":"Answered from your organization's stored conversations (any key of the organization). Unknown, deleted, expired or another organization's ids, and a wrong key, get 404 `not_found`. `instructions` is null and `tools` is empty: they aren't stored.","parameters":[{"name":"id","in":"path","required":true,"description":"A stored response id (`resp_` and 32 hex digits).","schema":{"type":"string","pattern":"^resp_[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"The stored response.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"delete":{"operationId":"deleteResponse","tags":["Chat"],"summary":"Delete a stored response","description":"Answered from your organization's stored conversations (any key of the organization). Unknown, deleted, expired or another organization's ids, and a wrong key, get 404 `not_found`. Deletes the response and every response continued from it; earlier turns stay.","parameters":[{"name":"id","in":"path","required":true,"description":"A stored response id (`resp_` and 32 hex digits).","schema":{"type":"string","pattern":"^resp_[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"Deleted.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["id","object","deleted"],"properties":{"id":{"type":"string"},"object":{"const":"response"},"deleted":{"const":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/responses/{id}/input_items":{"get":{"operationId":"listResponseInputItems","tags":["Chat"],"summary":"List a stored response's input items","description":"Answered from your organization's stored conversations (any key of the organization). Unknown, deleted, expired or another organization's ids, and a wrong key, get 404 `not_found`. Message items use `type: \"message\"` with `input_text` parts.","parameters":[{"name":"id","in":"path","required":true,"description":"A stored response id (`resp_` and 32 hex digits).","schema":{"type":"string","pattern":"^resp_[A-Za-z0-9_-]+$"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"name":"after","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"The input items.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["object","data","has_more"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","required":["id","type"],"properties":{"id":{"type":"string"},"type":{"type":"string"}}}},"first_id":{"type":["string","null"]},"last_id":{"type":["string","null"]},"has_more":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/jobs/{id}":{"get":{"operationId":"getJob","tags":["Jobs"],"summary":"Get a job","description":"A job is visible only to the API key that created it (others get 404).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^job_[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"The job.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/jobs/{id}/cancel":{"post":{"operationId":"cancelJob","tags":["Jobs"],"summary":"Cancel a job","description":"Cancels a job that has not started yet. The job then ends `failed` with `error.code: \"cancelled\"` and is not charged; its webhook and event stream report it as usual. A job that has already started can't be stopped: the answer is 409 `job_running`, and the job finishes and is charged only if it succeeds. Most jobs start within seconds, so cancel early. No body.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^job_[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"The cancelled job.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/JobConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/jobs/{id}/events":{"get":{"operationId":"streamJobEvents","tags":["Jobs"],"summary":"Follow a job (Server-Sent Events)","description":"A `job` event with the full job whenever its public view changes (progress included), a `: heartbeat` comment every 10 s, and the stream ends after `succeeded` or `failed`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^job_[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"`event: job` with `data:` = the Job.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events: `event: job`, `data:` = the job as JSON."},"x-ewest-sse-data":{"$ref":"#/components/schemas/Job"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/key":{"get":{"operationId":"getKey","tags":["Account"],"summary":"The calling key's budget and balance","description":"What this API key may still spend: its own budget, spend and limits, and its organisation's prepaid balance. A key sees only itself and its own organisation. Free; useful before a large request.","responses":{"200":{"description":"The key.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/models":{"get":{"operationId":"listModels","tags":["Models"],"summary":"List models","description":"The models this API key may use (OpenAI `models.list`). Also served at `/models`. For every model with its options, see `GET /v1/catalog`.","responses":{"200":{"description":"The models.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/models/{model}":{"get":{"operationId":"retrieveModel","tags":["Models"],"summary":"Get a model","description":"One model with its capabilities (OpenAI `models.retrieve`). A model the key may not use is a 404, like an unknown one. Also served at `/models/{model}`.","parameters":[{"name":"model","in":"path","required":true,"description":"The model name. The slash may be sent raw (`/v1/models/ewest/gemini-flash`) or encoded (`ewest%2Fgemini-flash`, as the OpenAI SDKs do).","schema":{"$ref":"#/components/schemas/ModelId"}}],"responses":{"200":{"description":"The model.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelDetail"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/public/performance":{"get":{"operationId":"getPerformance","tags":["Models"],"summary":"Performance of every model","description":"Availability, time to first token, latency and speed of every public model. No key needed; cached for 60 seconds; at most 60 requests a minute per address.","security":[],"parameters":[{"name":"window","in":"query","required":false,"description":"Time window (default `24h`). Any other query parameter is a 400.","schema":{"type":"string","enum":["1h","24h","7d","30d"],"default":"24h"}}],"responses":{"200":{"description":"Figures per model.","headers":{"cache-control":{"schema":{"type":"string"},"example":"public, max-age=60"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerformanceList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/public/models/{model}/performance":{"get":{"operationId":"getModelPerformance","tags":["Models"],"summary":"Performance of one model","description":"The model's figures plus a series for charts. No key needed; cached for 60 seconds.","security":[],"parameters":[{"name":"model","in":"path","required":true,"description":"The model name. The slash may be sent raw (`/v1/models/ewest/gemini-flash`) or encoded (`ewest%2Fgemini-flash`, as the OpenAI SDKs do).","schema":{"$ref":"#/components/schemas/ModelId"}},{"name":"window","in":"query","required":false,"description":"Time window (default `24h`). Any other query parameter is a 400.","schema":{"type":"string","enum":["1h","24h","7d","30d"],"default":"24h"}}],"responses":{"200":{"description":"The model's figures.","headers":{"cache-control":{"schema":{"type":"string"},"example":"public, max-age=60"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelPerformanceDetail"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/catalog":{"get":{"operationId":"getCatalog","tags":["Models"],"summary":"Model catalog","description":"Every public model and the options it accepts. No key needed; cached for 5 minutes. Sent with your API key, and your organisation has a discount, each model also has `your_price` and `your_discount_pct` (not cached).","security":[],"responses":{"200":{"description":"The catalog.","headers":{"cache-control":{"schema":{"type":"string"},"example":"public, max-age=300"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Your eWest API key: `Authorization: Bearer sk-…`."},"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"The same key, sent as `x-api-key` (the Anthropic SDKs do this). Works on every endpoint."}},"headers":{"RequestId":{"description":"The trace id of this request: a UUID, the call id (`req_…`) for image and audio calls, or the job id (`job_…`) for jobs. Find it in Console → Requests.","schema":{"type":"string"}},"Fallback":{"description":"`true` when a fallback model from `models` answered.","schema":{"type":"string","enum":["true"]}}},"schemas":{"ModelId":{"type":"string","pattern":"^ewest/[A-Za-z0-9._-]+$","description":"A public model name. `GET /v1/catalog` lists them all.","examples":["ewest/gemini-flash"]},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string","description":"What went wrong, readable by people."},"type":{"type":"string","description":"Error class: `invalid_request_error`, `invalid_api_key`, `insufficient_budget`, `insufficient_balance`, `permission_error`, `not_found_error`, `content_policy`, `model_unavailable`, `timeout_error` or `api_error`."},"code":{"type":"string","description":"A specific code when there is one (`model_not_found`, `model_not_supported`, `missing_required_parameter`, `invalid_type`, `invalid_value`, `unsupported_parameter`, `unsupported_value`, `previous_response_not_stored`, `model_unavailable`, `not_found`), otherwise the HTTP status as a string (`\"400\"`)."},"param":{"type":["string","null"],"description":"The request field the error is about, when there is one (`model`, `duration`, `key`, ...)."}}}},"examples":[{"error":{"message":"The model 'ewest/…' does not exist. GET /v1/catalog lists the available models.","type":"not_found_error","param":"model","code":"model_not_found"}}]},"AnthropicError":{"type":"object","required":["type","error"],"description":"The error body of `POST /v1/messages` and `POST /v1/messages/count_tokens` only: Anthropic's envelope, which the Anthropic SDKs read. Every other route uses the `Error` schema. The HTTP status is the same on both; only `error.type` differs (Anthropic's names: 400 `invalid_request_error`, 401 `authentication_error`, 402 `billing_error`, 403 `permission_error`, 404 `not_found_error`, 413 `request_too_large`, 429 `rate_limit_error`, 500 and 502 `api_error`, 503 `overloaded_error`, 504 `timeout_error`). eWest's own `code` and `param` stay inside `error` as extra fields (the SDKs ignore them), so `model_not_found` and the like still work. A failure after a streamed answer has started is an `error` event in the same shape.","properties":{"type":{"const":"error"},"error":{"type":"object","required":["type","message"],"properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error","timeout_error"],"description":"Anthropic's error type, chosen by the HTTP status (see the schema description)."},"message":{"type":"string","description":"What went wrong, readable by people. Don't branch on it."},"code":{"type":"string","description":"eWest's specific code when there is one (`model_not_found`, `model_not_supported`, `missing_required_parameter`, `unsupported_value`, ...), otherwise the HTTP status as a string (`\"401\"`)."},"param":{"type":["string","null"],"description":"The request field the error is about, when there is one (`model`, `output_config.effort`, `key`, ...)."}}},"request_id":{"type":"string","description":"The trace id, the same as the `x-request-id` response header."}},"examples":[{"type":"error","error":{"type":"authentication_error","message":"Invalid API key. Check the key you are using, or create a new one in the console.","code":"401","param":"key"},"request_id":"req_example"}]},"ProviderPreferences":{"type":"object","description":"Routing preferences. eWest always chooses the serving route itself: fields that would pick one (`order`, `only`, `ignore`, `routing.providers`, a `model:suffix`) and fields not honoured yet (`data_collection`, `zdr`, `quantizations`, `require_parameters`, `max_price`) are rejected with 400.","additionalProperties":false,"properties":{"fallback":{"$ref":"#/components/schemas/ModelId","description":"One fallback model; send either this or `models`."},"sort":{"description":"What to optimise for. Every value currently behaves like `latency`.","oneOf":[{"type":"string","enum":["latency","throughput","price"]},{"type":"object","required":["by"],"additionalProperties":false,"properties":{"by":{"type":"string","enum":["latency","throughput","price"]},"partition":{"type":"string","enum":["model","none"]}}}]},"routing":{"type":"object","required":["type","primary_factor"],"additionalProperties":false,"properties":{"type":{"const":"priority"},"primary_factor":{"type":"string","enum":["latency","throughput","price"]}}},"allow_fallbacks":{"type":"boolean","description":"`false` makes eWest try only one route for each model instead of retrying another route if it fails. It applies to chat completions only; `/v1/messages` and `/v1/responses` ignore it for now. Fallback models in `models` are still tried on all three endpoints. Default `true`."},"preferred_max_latency":{"oneOf":[{"type":"number","minimum":0},{"$ref":"#/components/schemas/Percentiles"}]},"preferred_min_throughput":{"oneOf":[{"type":"number","minimum":0},{"$ref":"#/components/schemas/Percentiles"}]}}},"Percentiles":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"p50":{"type":"number","minimum":0},"p75":{"type":"number","minimum":0},"p90":{"type":"number","minimum":0},"p99":{"type":"number","minimum":0}}},"ChatMessage":{"type":"object","required":["role"],"description":"An OpenAI chat message. `content` is a string or a list of content parts (`text`, `image_url`, ...).","properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}},{"type":"null"}]},"name":{"type":"string"},"tool_calls":{"type":"array","items":{"$ref":"#/components/schemas/ToolCall"}},"tool_call_id":{"type":"string"}}},"Tool":{"type":"object","required":["type","function"],"properties":{"type":{"const":"function"},"function":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object","description":"JSON Schema of the arguments."},"strict":{"type":"boolean"}}}}},"ToolCall":{"type":"object","required":["function"],"properties":{"id":{"type":"string","description":"Id of the call; send it back as `tool_call_id` in the tool's result message."},"index":{"type":"integer","description":"Position of the call in the list."},"type":{"const":"function","description":"The kind of tool; only functions exist."},"function":{"type":"object","description":"The function to run.","properties":{"name":{"type":"string","description":"Name of the function."},"arguments":{"type":"string","description":"JSON-encoded arguments."}}}}},"ChatCompletionRequest":{"type":"object","required":["model","messages"],"properties":{"model":{"$ref":"#/components/schemas/ModelId"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"minItems":1},"stream":{"type":"boolean","description":"Stream the answer as Server-Sent Events. Use it for long answers: a request without streaming is cut off after about 100 seconds."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}}},"max_tokens":{"type":"integer","description":"Maximum output tokens. A value above the model's `max_output_tokens` (from the catalog) is lowered to it.","minimum":1},"max_completion_tokens":{"type":"integer","description":"Maximum output tokens (newer OpenAI name). Lowered to the model's `max_output_tokens` like `max_tokens`.","minimum":1},"temperature":{"type":"number","description":"Sampling temperature.","minimum":0,"maximum":2},"top_p":{"type":"number","description":"Nucleus sampling.","minimum":0,"maximum":1},"stop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"tools":{"type":"array","items":{"$ref":"#/components/schemas/Tool"}},"tool_choice":{"oneOf":[{"type":"string","enum":["none","auto","required"]},{"type":"object"}]},"parallel_tool_calls":{"type":"boolean"},"response_format":{"$ref":"#/components/schemas/ResponseFormat"},"reasoning_effort":{"type":"string","description":"For models with `supports_reasoning`: one of the model's `reasoning_efforts`. Any other value is a 400 `unsupported_value` (`param: reasoning_effort`) listing the supported ones. On Claude Haiku 4.5 the effort needs room in the output limit: a `max_tokens` that is too small is a 400 `unsupported_value` naming the smallest that works (`low` 1025, `medium` and `high` 1366; only `ewest/claude-haiku`)."},"seed":{"type":"integer"},"user":{"type":"string"},"models":{"type":"array","items":{"$ref":"#/components/schemas/ModelId"},"maxItems":3,"description":"Fallback models, tried in order after `model` until one answers (at most 3 models in total, counting `model`). A fallback that answered sets the `x-ewest-fallback: true` response header."},"provider":{"$ref":"#/components/schemas/ProviderPreferences"}}},"ChatCompletionUsage":{"type":"object","description":"Token counts of the request, as billed.","properties":{"prompt_tokens":{"type":"integer","description":"Tokens in the input."},"completion_tokens":{"type":"integer","description":"Tokens in the output, reasoning tokens included."},"total_tokens":{"type":"integer","description":"`prompt_tokens` plus `completion_tokens`."},"prompt_tokens_details":{"type":["object","null"],"description":"Breakdown of the input tokens (for example cached or audio tokens), where the model reports one."},"completion_tokens_details":{"type":["object","null"],"description":"Breakdown of the output tokens (for example reasoning tokens), where the model reports one."},"cache_creation_input_tokens":{"type":["integer","null"],"description":"Input tokens written to the prompt cache, for models with prompt caching."},"cache_read_input_tokens":{"type":["integer","null"],"description":"Input tokens read from the prompt cache, for models with prompt caching."}}},"ChatCompletion":{"type":"object","required":["id","object","created","model","choices"],"properties":{"id":{"type":"string","description":"Unique id of the completion.","examples":["chatcmpl-…"]},"object":{"const":"chat.completion","description":"Always `chat.completion`."},"created":{"type":"integer","description":"Unix seconds when the completion was created."},"model":{"$ref":"#/components/schemas/ModelId","description":"The model that answered (a fallback, if one did)."},"choices":{"type":"array","description":"The answers, one per requested choice.","items":{"type":"object","required":["index","message"],"properties":{"index":{"type":"integer","description":"Position of this choice."},"finish_reason":{"type":["string","null"],"description":"Why the model stopped: `stop`, `length`, `tool_calls`, `content_filter`."},"message":{"type":"object","required":["role"],"description":"The assistant's answer.","properties":{"role":{"const":"assistant"},"content":{"type":["string","null"],"description":"The text of the answer; null when the model answered with tool calls only."},"refusal":{"type":["string","null"],"description":"The model's refusal text, when it declined to answer."},"tool_calls":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ToolCall"},"description":"Tools the model asks you to run."},"function_call":{"type":["object","null"],"description":"The call of a legacy `functions` request; newer requests use `tool_calls`.","properties":{"name":{"type":"string","description":"Name of the function."},"arguments":{"type":"string","description":"JSON-encoded arguments."}}},"audio":{"type":["object","null"],"description":"Spoken answer, for models that can reply with audio.","properties":{"id":{"type":"string","description":"Id of the audio."},"data":{"type":"string","description":"Base64-encoded audio bytes."},"expires_at":{"type":"integer","description":"Unix seconds after which the audio can no longer be referenced."},"transcript":{"type":"string","description":"Text of the spoken answer."}}},"reasoning_content":{"type":["string","null"],"description":"The model's reasoning text, for models that return it."},"thinking_blocks":{"type":["array","null"],"items":{"type":"object"},"description":"Reasoning blocks, for models that return them."},"annotations":{"type":["array","null"],"items":{"type":"object"},"description":"Annotations on the text, such as URL citations, where the model gives them."},"images":{"type":["array","null"],"items":{"type":"object"},"description":"Images the model generated, for models with image output."}}},"logprobs":{"type":["object","null"],"description":"Token log probabilities, when requested."}}}},"usage":{"$ref":"#/components/schemas/ChatCompletionUsage","description":"Token usage of the request."},"system_fingerprint":{"type":["string","null"],"description":"Identifies the model configuration that answered, when the model reports one."},"service_tier":{"type":["string","null"],"description":"The service tier that handled the request, when the model reports one."}}},"ChatCompletionChunk":{"type":"object","description":"The `data` of one Server-Sent Event of a streamed chat completion. The stream ends with `data: [DONE]`.","required":["id","object","created","model","choices"],"properties":{"id":{"type":"string"},"object":{"const":"chat.completion.chunk"},"created":{"type":"integer"},"model":{"$ref":"#/components/schemas/ModelId"},"choices":{"type":"array","items":{"type":"object","required":["index","delta"],"properties":{"index":{"type":"integer"},"delta":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":["string","null"]},"tool_calls":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ToolCall"}},"reasoning_content":{"type":["string","null"]}}},"finish_reason":{"type":["string","null"]}}}},"usage":{"oneOf":[{"$ref":"#/components/schemas/ChatCompletionUsage"},{"type":"null"}]}}},"CompletionRequest":{"type":"object","required":["model","prompt"],"description":"Legacy text completions (OpenAI format). Fill-in-the-middle (`suffix`) is not supported.","properties":{"model":{"$ref":"#/components/schemas/ModelId"},"prompt":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"max_tokens":{"type":"integer","minimum":1,"description":"Lowered to the model's `max_output_tokens` when higher."},"temperature":{"type":"number"},"top_p":{"type":"number"},"stop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"stream":{"type":"boolean"}}},"Completion":{"type":"object","required":["id","object","model","choices"],"properties":{"id":{"type":"string"},"object":{"const":"text_completion"},"created":{"type":"integer"},"model":{"$ref":"#/components/schemas/ModelId"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"text":{"type":"string"},"finish_reason":{"type":["string","null"]}}}},"usage":{"$ref":"#/components/schemas/ChatCompletionUsage"}}},"MessagesRequest":{"type":"object","required":["model","max_tokens","messages"],"description":"The Anthropic Messages format. Works with the Anthropic SDKs (base URL `https://api.ewest.ai`).","properties":{"model":{"$ref":"#/components/schemas/ModelId"},"max_tokens":{"type":"integer","minimum":1,"description":"Lowered to the model's `max_output_tokens` when higher."},"output_config":{"type":"object","description":"`{\"effort\": ...}` is checked before the model runs; a value the model doesn't take is a 400 `unsupported_value` (`param: output_config.effort`) listing the supported ones. Claude models: the model's `reasoning_efforts` (Claude Haiku 4.5 takes no effort here: set `thinking.budget_tokens` instead). Gemini models: `low`, `medium` or `high`."},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]}}}},"system":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"stream":{"type":"boolean"},"temperature":{"type":"number"},"top_p":{"type":"number"},"top_k":{"type":"integer"},"stop_sequences":{"type":"array","items":{"type":"string"},"description":"Known limitation on Gemini models: the text is cut at the sequence, but the message reports `stop_reason: \"end_turn\"` and `stop_sequence: null` instead of `stop_sequence` and the sequence, so don't rely on those two fields there. Claude models report them correctly."},"tools":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"input_schema":{"type":"object"}}}},"tool_choice":{"type":"object"},"thinking":{"type":"object","description":"Extended thinking, for models with `supports_reasoning`."},"models":{"type":"array","items":{"$ref":"#/components/schemas/ModelId"},"maxItems":3,"description":"Fallback models, tried in order after `model` until one answers (at most 3 models in total, counting `model`). A fallback that answered sets the `x-ewest-fallback: true` response header."},"provider":{"$ref":"#/components/schemas/ProviderPreferences"}}},"CountTokensRequest":{"type":"object","required":["model","messages"],"description":"The same body as `POST /v1/messages` (without `max_tokens`); `models` and `provider` are accepted and ignored.","properties":{"model":{"$ref":"#/components/schemas/ModelId"},"messages":{"type":"array","items":{"type":"object"}},"system":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"tools":{"type":"array","items":{"type":"object"}}}},"CountTokensResponse":{"type":"object","required":["input_tokens"],"properties":{"input_tokens":{"type":"integer"}}},"Message":{"type":"object","required":["id","type","role","content","model"],"properties":{"id":{"type":"string","examples":["msg_…"]},"type":{"const":"message"},"role":{"const":"assistant"},"content":{"type":"array","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"`text`, `tool_use`, `thinking`, ..."},"text":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"input":{"type":"object"}}}},"model":{"$ref":"#/components/schemas/ModelId"},"stop_reason":{"type":["string","null"]},"stop_sequence":{"type":["string","null"]},"container":{"type":["object","null"]},"usage":{"type":"object","required":["input_tokens","output_tokens"],"properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"cache_creation_input_tokens":{"type":["integer","null"]},"cache_read_input_tokens":{"type":["integer","null"]},"cache_creation":{"type":["object","null"]},"server_tool_use":{"type":["object","null"]},"service_tier":{"type":["string","null"]}}}}},"MessageStreamEvent":{"type":"object","required":["type"],"description":"One Server-Sent Event of a streamed message: `message_start`, `content_block_start`, `content_block_delta`, `content_block_stop`, `message_delta`, `message_stop`, `ping` or `error`.","properties":{"type":{"type":"string"},"message":{"type":"object"},"index":{"type":"integer"},"content_block":{"type":"object"},"delta":{"type":"object"},"usage":{"type":"object"}}},"ResponsesRequest":{"type":"object","required":["model","input"],"description":"The OpenAI Responses format. `store` (default true) keeps the conversation for 30 days after its last turn so `previous_response_id` continues it with its full history; `store: false` keeps nothing (docs: /docs/responses). Continuing a response that wasn't stored gives 400 `previous_response_not_stored`; an unknown, deleted, expired or other-organization id gives 404 `not_found` with `param: previous_response_id`. `GET`/`DELETE /v1/responses/{id}` and `GET /v1/responses/{id}/input_items` read and delete stored responses.","properties":{"model":{"$ref":"#/components/schemas/ModelId"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"instructions":{"type":"string"},"max_output_tokens":{"type":"integer","minimum":1,"description":"Maximum output tokens. A value above the model's `max_output_tokens` (from the catalog) is lowered to it; the response shows the value used."},"previous_response_id":{"type":"string","description":"The `id` of an earlier response to continue; its stored history is added before `input`. A response that wasn't stored is a 400 `previous_response_not_stored`; an id that can't be opened is a 404 `not_found` with `param: previous_response_id`."},"store":{"type":"boolean","default":true,"description":"Keep the conversation for 30 days after its last turn so `previous_response_id` and `GET /v1/responses/{id}` work. `false` keeps nothing. If the organization has turned off storing its conversations, every request is treated as `store: false`; the final response object shows the effective value."},"temperature":{"type":"number"},"top_p":{"type":"number"},"tools":{"type":"array","items":{"type":"object"}},"tool_choice":{"oneOf":[{"type":"string"},{"type":"object"}]},"text":{"$ref":"#/components/schemas/ResponsesText"},"reasoning":{"type":"object","description":"`{\"effort\": ...}` takes the model's `reasoning_efforts`; any other value is a 400 `unsupported_value` (`param: reasoning.effort`) listing the supported ones."},"stream":{"type":"boolean"},"models":{"type":"array","items":{"$ref":"#/components/schemas/ModelId"},"maxItems":3,"description":"Fallback models, tried in order after `model` until one answers (at most 3 models in total, counting `model`). A fallback that answered sets the `x-ewest-fallback: true` response header."},"provider":{"$ref":"#/components/schemas/ProviderPreferences"}}},"ResponseFormat":{"type":"object","required":["type"],"description":"The shape of the answer on chat completions. `text` is plain text (the default), `json_object` is any valid JSON, `json_schema` is JSON that follows `json_schema.schema`. The shape is checked before the model runs: a mistake is a 400 `invalid_request_error` with `param` naming the field (for example `response_format.json_schema.schema`) and `code` `invalid_type`, `invalid_value` or `missing_required_parameter`. The JSON Schema itself is not checked at that point.","properties":{"type":{"type":"string","enum":["text","json_object","json_schema"]},"json_schema":{"type":"object","description":"Required when `type` is `json_schema`.","required":["name","schema"],"properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$","description":"A name for the schema: 1 to 64 letters, digits, underscores or dashes."},"schema":{"type":"object","description":"The JSON Schema the answer follows. Required here (OpenAI treats it as optional)."},"strict":{"type":"boolean","description":"Ask the model to follow the schema exactly."},"description":{"type":"string","description":"What the answer is for."}}}},"examples":[{"type":"json_schema","json_schema":{"name":"city","schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"strict":true}}]},"ResponsesText":{"type":"object","description":"Output options on the Responses API. `format` has the same `type` values as chat's `response_format`, but for `json_schema` the fields sit directly on `format`.","properties":{"format":{"type":"object","required":["type"],"description":"The shape of the answer. Checked before the model runs, like `response_format` on chat completions: a mistake is a 400 `invalid_request_error` with `param` such as `text.format.schema`.","properties":{"type":{"type":"string","enum":["text","json_object","json_schema"]},"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$","description":"Required when `type` is `json_schema`: 1 to 64 letters, digits, underscores or dashes."},"schema":{"type":"object","description":"Required when `type` is `json_schema`: the JSON Schema the answer follows (OpenAI treats it as optional)."},"strict":{"type":"boolean"},"description":{"type":"string"}}}}},"Response":{"type":"object","required":["id","object","created_at","status","model","output"],"properties":{"id":{"type":"string","examples":["resp_…"]},"object":{"const":"response"},"created_at":{"type":"integer"},"status":{"type":"string","description":"`completed`, `incomplete`, `failed`, `in_progress`."},"error":{"type":["object","null"]},"incomplete_details":{"type":["object","null"]},"model":{"$ref":"#/components/schemas/ModelId"},"output":{"type":"array","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"id":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"},"content":{"type":"array","items":{"type":"object"}}}}},"output_text":{"type":"string"},"usage":{"type":["object","null"],"properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"input_tokens_details":{"type":["object","null"]},"output_tokens_details":{"type":["object","null"]}}},"previous_response_id":{"type":["string","null"],"description":"The response this one continues, or null."}}},"ResponseStreamEvent":{"type":"object","required":["type","sequence_number"],"description":"One Server-Sent Event of a streamed response (`response.created`, `response.output_text.delta`, `response.completed`, ...). Every event carries an integer `sequence_number`, starting at 0 and increasing by 1.","properties":{"type":{"type":"string"},"sequence_number":{"type":"integer","minimum":0,"description":"The event's position in the stream: 0 for the first event, then 1, 2, ... with no gaps."},"response":{"type":"object"},"delta":{"type":"string"}}},"EmbeddingsRequest":{"type":"object","required":["model","input"],"properties":{"model":{"$ref":"#/components/schemas/ModelId"},"input":{"description":"One string, or a list (at most 100 items for `ewest/gemini-embedding`). Each comes back as one vector, in the same order.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1},{"type":"array","items":{"type":"integer"}},{"type":"array","items":{"type":"array","items":{"type":"integer"}}}]},"encoding_format":{"type":"string","enum":["float","base64"],"default":"float","description":"`base64`: each vector is base64 of its little-endian float32 bytes, like OpenAI (the OpenAI SDKs ask for this by default and decode it). Any other value is a 400."},"dimensions":{"type":"integer","minimum":1,"description":"Where the model supports it; otherwise 400 `unsupported_parameter`."},"user":{"type":"string"}}},"EmbeddingsResponse":{"type":"object","required":["object","data","model"],"properties":{"object":{"const":"list"},"model":{"$ref":"#/components/schemas/ModelId","description":"The model that produced the embeddings."},"data":{"type":"array","description":"One embedding per input, in order.","items":{"type":"object","required":["index","embedding"],"properties":{"object":{"const":"embedding"},"index":{"type":"integer","description":"Position of the input this embedding belongs to."},"embedding":{"description":"The vector: a list of numbers, or a base64 string with `encoding_format: \"base64\"`.","oneOf":[{"type":"array","items":{"type":"number"}},{"type":"string","contentEncoding":"base64","description":"With `encoding_format: \"base64\"`."}]}}}},"usage":{"type":"object","description":"Token usage of the request.","properties":{"prompt_tokens":{"type":"integer","description":"Tokens in the input."},"total_tokens":{"type":"integer","description":"Total tokens billed."}}}}},"RerankRequest":{"type":"object","required":["model","query","documents"],"properties":{"model":{"$ref":"#/components/schemas/ModelId"},"query":{"type":"string"},"documents":{"type":"array","items":{"type":"string"},"minItems":1,"description":"At most `max_documents` of the model (see the catalog)."},"top_n":{"type":"integer","minimum":1,"description":"Return only the best `top_n` results."},"return_documents":{"type":"boolean","description":"Add each document's text to its result as `document.text`. Without it, results carry no `document`."}}},"RerankResponse":{"type":"object","required":["results"],"properties":{"id":{"type":"string","description":"Unique id of the request."},"results":{"type":"array","description":"Ordered by `relevance_score`, best first.","items":{"type":"object","required":["index","relevance_score"],"properties":{"index":{"type":"integer","description":"Position in `documents`."},"relevance_score":{"type":"number","description":"How well the document matches the query; higher is better."},"document":{"type":"object","description":"The document (`{\"text\": ...}`). Present on every result when the request set `return_documents: true`, absent otherwise (use `index` to find the document in your own list).","properties":{"text":{"type":"string","description":"The document text."}}}}}},"meta":{"type":"object","description":"Usage information of the request.","properties":{"billed_units":{"type":"object","description":"What the request was billed for.","properties":{"search_units":{"type":"integer","description":"Number of search units billed."}}}}}}},"ImageGenerationRequest":{"type":"object","required":["model","prompt"],"description":"Options a model takes are listed in its catalog entry (`sizes`, `aspect_ratios`, `resolutions`, `qualities`, `max_images`, `max_input_images`).","properties":{"model":{"$ref":"#/components/schemas/ModelId"},"prompt":{"type":"string","maxLength":10000},"n":{"type":"integer","minimum":1,"description":"Number of images, up to the model's `max_images`."},"size":{"type":"string","description":"One of the model's `sizes`, e.g. `1024x1024`, or `auto`."},"aspect_ratio":{"type":"string","description":"One of the model's `aspect_ratios`."},"resolution":{"type":"string","description":"One of the model's `resolutions`, e.g. `2K`."},"quality":{"type":"string","description":"One of the model's `qualities`, or `auto`."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"Input images (public https URLs) for models with `max_input_images` > 0."},"image_url":{"type":"string","format":"uri","description":"One input image; same as `image_urls` with one item."},"mask_url":{"type":"string","format":"uri","description":"Public https URL of a mask, for edit models with `supports_mask`, with exactly one input image: white where the model may change the image, black where it stays, the same pixel size as the image (PNG, JPEG or WebP). Not OpenAI's transparency masks."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"`b64_json` also returns the bytes; the URL is always there."}}},"ImageEditJsonRequest":{"allOf":[{"$ref":"#/components/schemas/ImageGenerationRequest"}],"required":["model","prompt","image_urls"]},"ImageEditMultipartRequest":{"type":"object","required":["model","prompt"],"description":"OpenAI's images.edit shape: one or more `image` (or `image[]`) files, PNG, JPEG or WebP, at most 20 MB each. Other fields as in the JSON body.","properties":{"model":{"$ref":"#/components/schemas/ModelId"},"prompt":{"type":"string"},"image":{"oneOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"array","items":{"type":"string","contentMediaType":"application/octet-stream"}}]},"image[]":{"type":"array","items":{"type":"string","contentMediaType":"application/octet-stream"}},"mask":{"type":"string","contentMediaType":"application/octet-stream","description":"A mask file for edit models with `supports_mask`: white where the model may change the image, black where it stays; the same pixel size as the single `image`. Or send `mask_url`."},"mask_url":{"type":"string"},"n":{"type":"integer"},"size":{"type":"string"},"aspect_ratio":{"type":"string"},"resolution":{"type":"string"},"quality":{"type":"string"},"response_format":{"type":"string","enum":["url","b64_json"]}}},"ImagesResponse":{"type":"object","required":["data"],"properties":{"created":{"type":"integer","description":"Unix seconds when the images were created."},"data":{"type":"array","description":"The generated images, in order.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"Link to the image, on `cdn.ewest.ai`, kept for 7 days.","examples":["https://cdn.ewest.ai/img/2026/11/01/….png"]},"b64_json":{"type":"string","contentEncoding":"base64","description":"The image bytes, base64-encoded; only with `response_format: b64_json`."},"revised_prompt":{"type":["string","null"],"description":"The prompt as the model rewrote it, where it does that; otherwise null or absent."},"width":{"type":"integer","description":"Width of the image in pixels; present for models that report the size of the stored image."},"height":{"type":"integer","description":"Height of the image in pixels; present together with `width`."}}}},"background":{"type":["string","null"],"description":"Background setting reported by the model, if any."},"output_format":{"type":["string","null"],"description":"File format reported by the model, if any."},"quality":{"type":["string","null"],"description":"Quality level reported by the model, if any."},"size":{"type":["string","null"],"description":"Size reported by the model, if any."},"usage":{"type":"object","description":"Token usage, for models that bill by tokens; zeros otherwise.","properties":{"total_tokens":{"type":"integer","description":"Input plus output tokens."},"input_tokens":{"type":"integer","description":"Tokens in the input."},"output_tokens":{"type":"integer","description":"Tokens in the output."},"input_tokens_details":{"type":"object","description":"Breakdown of the input tokens.","properties":{"image_tokens":{"type":"integer","description":"Tokens from input images."},"text_tokens":{"type":"integer","description":"Tokens from the prompt."}}}}}}},"SpeechRequest":{"type":"object","required":["model","input"],"properties":{"model":{"$ref":"#/components/schemas/ModelId"},"input":{"type":"string","description":"The text, at most the model's `max_characters`."},"voice":{"type":"string","description":"One of the model's `voices`; default `default_voice`."},"speed":{"type":"number","minimum":0.5,"maximum":2,"description":"Models with `supports_speed`."},"instructions":{"type":"string","description":"Models with `supports_instructions`."},"response_format":{"type":"string","description":"`url` returns JSON with a `cdn.ewest.ai` link; otherwise only the model's own `format` (e.g. `mp3`) is accepted."}}},"SpeechUrlResponse":{"type":"object","required":["url","content_type"],"properties":{"url":{"type":"string","description":"Link to the audio file on `cdn.ewest.ai`, kept for 7 days.","format":"uri","examples":["https://cdn.ewest.ai/aud/2026/11/01/….mp3"]},"content_type":{"type":"string","description":"Media type of the audio file, e.g. `audio/mpeg`.","examples":["audio/mpeg"]}}},"TranscriptionFields":{"type":"object","required":["model"],"properties":{"model":{"$ref":"#/components/schemas/ModelId"},"response_format":{"type":"string","enum":["json","text","verbose_json"],"default":"json"},"language":{"type":"string","description":"ISO-639 code such as `en` (one of the model's `languages`, if it lists them)."},"diarize":{"type":"boolean","description":"Speaker labels, for models with `supports_diarization`."}}},"TranscriptionMultipartRequest":{"allOf":[{"$ref":"#/components/schemas/TranscriptionFields"}],"required":["model","file"],"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","description":"mp3, wav, m4a, ogg, flac or webm; at most 25 MB and the model's `max_minutes`."}}},"TranscriptionJsonRequest":{"allOf":[{"$ref":"#/components/schemas/TranscriptionFields"}],"required":["model","audio_url"],"properties":{"audio_url":{"type":"string","format":"uri","description":"A public https URL of the audio (at most 25 MB)."}}},"Transcription":{"type":"object","required":["text"],"properties":{"text":{"type":"string","description":"The transcript."}}},"TranscriptionVerbose":{"type":"object","required":["task","text","duration"],"properties":{"task":{"const":"transcribe"},"language":{"type":["string","null"],"description":"ISO-639 code of the spoken language; null when the model does not report it."},"duration":{"type":"number","description":"Length of the audio in seconds."},"text":{"type":"string","description":"The transcript."},"words":{"type":"array","description":"Word timestamps, where the model provides them.","items":{"type":"object","required":["word","start","end"],"properties":{"word":{"type":"string","description":"The word."},"start":{"type":"number","description":"Start time in seconds."},"end":{"type":"number","description":"End time in seconds."},"speaker":{"type":["string","null"],"description":"Speaker label, for models with diarization when `diarize` is set; otherwise null."}}}}}},"WebhookUrl":{"type":"string","format":"uri","description":"A public https URL. When the job finishes (succeeded or failed) eWest sends it a `POST` with the final job (see the `jobFinished` callback)."},"VideoGenerationRequest":{"type":"object","required":["model","prompt"],"description":"Allowed values per model are in its catalog entry (`durations`, `resolutions`, `aspect_ratios`, `defaults`, `supports_*`).","properties":{"model":{"$ref":"#/components/schemas/ModelId"},"prompt":{"type":"string","minLength":1,"maxLength":4000},"duration":{"type":"integer","description":"Seconds; one of the model's `durations`."},"resolution":{"type":"string","description":"One of the model's `resolutions`, e.g. `720p`."},"aspect_ratio":{"type":"string","description":"One of the model's `aspect_ratios`, e.g. `16:9`."},"audio":{"type":"boolean","description":"Generate sound (default true where the model makes audio). `false` only where `supports_audio_toggle`."},"image_url":{"type":["string","null"],"format":"uri","description":"First frame (https), for models with `supports_image_input`; required where `requires_image_input`."},"end_image_url":{"type":["string","null"],"format":"uri","description":"Last frame, for models with `supports_end_image`; needs `image_url`."},"webhook_url":{"oneOf":[{"$ref":"#/components/schemas/WebhookUrl"},{"type":"null"}]}}},"ThreeDGenerationRequest":{"type":"object","required":["model"],"description":"Send `prompt` (text to 3D) or `image_url` (image to 3D), never both. Limits per model are in its catalog entry (`max_prompt_chars`, `face_count`, `view_images`, `generate_types`, `options`). An option the model does not take is a 400.","properties":{"model":{"$ref":"#/components/schemas/ModelId"},"prompt":{"type":"string","minLength":1,"maxLength":1024,"description":"What to build, as text. Not with `image_url`."},"image_url":{"type":["string","null"],"format":"uri","description":"Front view (public https URL; JPEG, PNG or WebP; the size limits per model are in its catalog entry and docs: Hunyuan 3D 128 to 5,000 px and 8 MB, Tripo H3.1 20 MB). Not with `prompt`."},"view_images":{"type":["object","null"],"additionalProperties":false,"description":"Hunyuan 3D only: extra views of the same object, each a public https URL (JPEG or PNG). Needs `image_url`. Adds a fixed amount to the price however many views you send.","properties":{"back":{"type":"string","format":"uri"},"left":{"type":"string","format":"uri"},"right":{"type":"string","format":"uri"},"top":{"type":"string","format":"uri"},"bottom":{"type":"string","format":"uri"},"left_front":{"type":"string","format":"uri"},"right_front":{"type":"string","format":"uri"}}},"generate_type":{"type":"string","enum":["normal","geometry"],"default":"normal","description":"`normal` is a textured model; `geometry` an untextured one (not with `enable_pbr`)."},"enable_pbr":{"type":"boolean","description":"Add PBR material textures. Default: off for Hunyuan 3D (adds a fixed amount to the price), on for Tripo H3.1 (no extra charge); the model's `pbr_default` says which. Not with `generate_type: geometry`."},"face_count":{"type":["integer","null"],"minimum":1000,"maximum":2000000,"description":"Target polygon count; the range and default are per model (`face_count` in its catalog entry: Hunyuan 3D 40,000 to 1,500,000, default 500,000, any other value adds a fixed amount to the price; Tripo H3.1 1,000 to 2,000,000, the model chooses when omitted, free; above 1,500,000 needs `geometry_quality: detailed`, at most 150,000 with `quad`)."},"texture_quality":{"type":"string","enum":["standard","detailed"],"description":"Tripo H3.1 only (the catalog `options` list says which models take it). `detailed` makes higher-resolution (HD) textures and costs more. Needs `generate_type: normal`. Default `standard`."},"geometry_quality":{"type":"string","enum":["standard","detailed"],"description":"Tripo H3.1 only. `detailed` makes finer geometry and costs more. Default `standard`."},"quad":{"type":"boolean","description":"Tripo H3.1 only. A quad (four-sided) mesh instead of triangles; costs more. The mesh then comes as an FBX file (`output.url` is the FBX and there is no GLB). Without `face_count` it has 10,000 faces; the most is 150,000. Default false."},"negative_prompt":{"type":"string","maxLength":255,"description":"Tripo H3.1 only: what to avoid. Text input only (with `prompt`)."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Tripo H3.1 only: makes the geometry and the textures repeatable."},"auto_size":{"type":"boolean","description":"Tripo H3.1 only: scale the model to real-world size in meters. Default false."},"orientation":{"type":"string","enum":["default","align_image"],"description":"Tripo H3.1 only, with `image_url`: `align_image` turns the model to match the image."},"texture_alignment":{"type":"string","enum":["original_image","geometry"],"description":"Tripo H3.1 only, with `image_url`: match the textures to the image (default) or to the generated geometry."},"webhook_url":{"oneOf":[{"$ref":"#/components/schemas/WebhookUrl"},{"type":"null"}]}}},"AudioGenerationRequest":{"type":"object","required":["model","prompt"],"properties":{"model":{"$ref":"#/components/schemas/ModelId"},"prompt":{"type":"string","minLength":1,"maxLength":4000},"duration":{"type":["integer","null"],"description":"Seconds; one of the model's `durations`. Leave it out for models whose `durations` is empty (they choose the length)."},"instrumental":{"type":"boolean","description":"Models with `supports_instrumental`."},"loop":{"type":"boolean","description":"Sound effects with `supports_loop`."},"webhook_url":{"oneOf":[{"$ref":"#/components/schemas/WebhookUrl"},{"type":"null"}]}}},"Job":{"type":"object","required":["id","object","type","model","status","progress","eta_seconds","created_at","started_at","completed_at","input","output","error","usage"],"description":"A video, music, sound or 3D job. `type` decides the shape of `input`, `output` and `usage`: `video` is a `VideoJob`, `audio` an `AudioJob`, `3d` a `ThreeDJob`. The properties below list every field either type can have.","oneOf":[{"$ref":"#/components/schemas/VideoJob"},{"$ref":"#/components/schemas/AudioJob"},{"$ref":"#/components/schemas/ThreeDJob"}],"discriminator":{"propertyName":"type","mapping":{"video":"#/components/schemas/VideoJob","audio":"#/components/schemas/AudioJob","3d":"#/components/schemas/ThreeDJob"}},"properties":{"id":{"type":"string","pattern":"^job_[A-Za-z0-9_-]+$","description":"Also the trace id (`x-request-id`).","examples":["job_…"]},"object":{"const":"job"},"type":{"type":"string","enum":["video","audio","3d"],"description":"`video` for `/v1/videos/generations`, `audio` for `/v1/audio/generations` (music and sound effects), `3d` for `/v1/3d/generations`."},"model":{"$ref":"#/components/schemas/ModelId","description":"The model that runs the job."},"status":{"type":"string","enum":["queued","running","succeeded","failed"],"description":"`queued` and `running` are in progress; `succeeded` and `failed` are final."},"progress":{"type":"integer","minimum":0,"maximum":100,"description":"Estimated from elapsed time; 0 for failed jobs."},"eta_seconds":{"type":["integer","null"],"description":"Expected seconds left; null when finished or when the job runs longer than usual."},"created_at":{"type":"integer","description":"Unix seconds when the job was created."},"started_at":{"type":["integer","null"],"description":"Unix seconds when the model started generating; null while the job is queued."},"completed_at":{"type":["integer","null"],"description":"Unix seconds when the job reached `succeeded` or `failed`; null while it is in progress."},"input":{"type":"object","description":"The parameters the job runs with, defaults filled in (video: prompt, duration, resolution, aspect_ratio, audio, image_url, end_image_url; audio: prompt, duration, instrumental, loop). Per type: `VideoJobInput` and `AudioJobInput`.","properties":{"prompt":{"type":"string","description":"The prompt."},"duration":{"type":["integer","null"],"description":"Length in seconds. Audio jobs: null when the model chooses the length."},"resolution":{"type":"string","description":"Video jobs only: the output resolution, e.g. `720p`."},"aspect_ratio":{"type":"string","description":"Video jobs only: the aspect ratio, e.g. `16:9`."},"audio":{"type":"boolean","description":"Video jobs only: whether the video has sound."},"image_url":{"type":["string","null"],"description":"Video jobs only: the first frame, or null.","format":"uri"},"end_image_url":{"type":["string","null"],"description":"Video jobs only: the last frame, or null.","format":"uri"},"instrumental":{"type":"boolean","description":"Audio jobs only: music without vocals."},"loop":{"type":"boolean","description":"Audio jobs only: a sound effect that loops."},"view_images":{"type":["object","null"],"description":"3D jobs only: the extra views (view name to URL), or null."},"generate_type":{"type":"string","description":"3D jobs only: `normal` or `geometry`."},"enable_pbr":{"type":"boolean","description":"3D jobs only: whether PBR materials were requested."},"face_count":{"type":["integer","null"],"description":"3D jobs only: the requested polygon count, or null for the model's default."},"texture_quality":{"type":["string","null"],"description":"3D jobs only: `standard` or `detailed`, or null when the model has no such option or it was not sent."},"geometry_quality":{"type":["string","null"],"description":"3D jobs only: `standard` or `detailed`, or null."},"quad":{"type":["boolean","null"],"description":"3D jobs only: whether a quad mesh was requested, or null."},"negative_prompt":{"type":["string","null"],"description":"3D jobs only: what to avoid, or null."},"seed":{"type":["integer","null"],"description":"3D jobs only: the seed, or null."},"auto_size":{"type":["boolean","null"],"description":"3D jobs only: whether real-world scaling was requested, or null."},"orientation":{"type":["string","null"],"description":"3D jobs only: `default` or `align_image`, or null."},"texture_alignment":{"type":["string","null"],"description":"3D jobs only: `original_image` or `geometry`, or null."}}},"output":{"type":["object","null"],"required":["url","content_type"],"description":"Set once the job succeeded, null before and when it failed. The file is on `cdn.ewest.ai` for 7 days.","properties":{"url":{"type":"string","description":"Link to the generated file on `cdn.ewest.ai`.","format":"uri","examples":["https://cdn.ewest.ai/vid/2026/11/01/….mp4"]},"content_type":{"type":"string","description":"Media type of the file: `video/mp4` for video, `audio/mpeg` for audio.","examples":["video/mp4","audio/mpeg"]},"duration":{"type":["number","null"],"description":"Length in seconds as requested; null for audio from a model that chooses its own length."},"resolution":{"type":"string","description":"Video jobs only: the resolution, e.g. `720p`."},"files":{"type":"object","description":"3D jobs only: every file of the model by format (`glb`, `obj`, `mtl`, `texture`, ...), each `{url, content_type, size}` on `cdn.ewest.ai`. `url` is the GLB (the FBX for a quad mesh)."},"thumbnail_url":{"type":["string","null"],"description":"3D jobs only: a preview image on `cdn.ewest.ai`, or null.","format":"uri"}}},"error":{"type":["object","null"],"required":["code","message"],"description":"Set when the job failed, null otherwise.","properties":{"code":{"type":["string","null"],"enum":["generation_failed","content_policy","image_download_failed","timeout","storage_error","cancelled",null],"description":"Why the job failed. `generation_failed`: The model could not generate the output; retry, or contact support if it keeps happening. `content_policy`: The prompt or an input was rejected by the model's safety filters. `image_download_failed`: An input image (`image_url` or `end_image_url`) could not be downloaded; check that its URL is public and returns the image. `timeout`: Generation took too long and was stopped. `storage_error`: The output was generated but could not be stored; retry. `cancelled`: You cancelled the job (`POST /v1/jobs/{id}/cancel`) before it started; it is not charged."},"message":{"type":"string","description":"A fixed, readable explanation for the `code`. Branch on `code`, not on this text."}}},"usage":{"type":["object","null"],"description":"Billed units once the job succeeded, null before and when it failed: `{\"seconds\": n}`, or `{\"generations\": 1}` for audio models that choose their own length.","properties":{"seconds":{"type":"number","description":"Seconds of video or audio billed."},"generations":{"type":"integer","description":"Number of generations billed (1)."}}}}},"VideoJobInput":{"type":"object","required":["prompt","duration","resolution","aspect_ratio","audio","image_url","end_image_url"],"additionalProperties":false,"description":"The parameters of a video job, defaults filled in.","properties":{"prompt":{"type":"string","description":"The prompt."},"duration":{"type":"integer","description":"Length in seconds."},"resolution":{"type":"string","description":"The output resolution, e.g. `720p`."},"aspect_ratio":{"type":"string","description":"The aspect ratio, e.g. `16:9`."},"audio":{"type":"boolean","description":"Whether the video has sound."},"image_url":{"type":["string","null"],"description":"The first frame, or null.","format":"uri"},"end_image_url":{"type":["string","null"],"description":"The last frame, or null.","format":"uri"}}},"AudioJobInput":{"type":"object","required":["prompt","duration","instrumental","loop"],"additionalProperties":false,"description":"The parameters of a music or sound-effect job, defaults filled in.","properties":{"prompt":{"type":"string","description":"The prompt."},"duration":{"type":["integer","null"],"description":"Length in seconds; null when the model chooses the length."},"instrumental":{"type":"boolean","description":"Music without vocals."},"loop":{"type":"boolean","description":"A sound effect that loops."}}},"VideoJobOutput":{"type":"object","required":["url","content_type","duration","resolution"],"description":"The result of a succeeded video job.","properties":{"url":{"type":"string","description":"Link to the video on `cdn.ewest.ai`, kept for 7 days.","format":"uri"},"content_type":{"const":"video/mp4"},"duration":{"type":"number","description":"Length in seconds."},"resolution":{"type":"string","description":"The resolution, e.g. `720p`."}}},"AudioJobOutput":{"type":"object","required":["url","content_type","duration"],"additionalProperties":false,"description":"The result of a succeeded music or sound-effect job.","properties":{"url":{"type":"string","description":"Link to the audio file on `cdn.ewest.ai`, kept for 7 days.","format":"uri"},"content_type":{"const":"audio/mpeg"},"duration":{"type":["number","null"],"description":"Length in seconds as requested; null when the model chooses the length."}}},"VideoJob":{"type":"object","description":"A job with `type: video`.","required":["type","started_at","completed_at","input","output","error","usage"],"properties":{"type":{"const":"video"},"started_at":{"type":["integer","null"],"description":"Unix seconds when the model started generating; null while the job is queued."},"completed_at":{"type":["integer","null"],"description":"Unix seconds when the job reached `succeeded` or `failed`; null while it is in progress."},"input":{"$ref":"#/components/schemas/VideoJobInput"},"output":{"oneOf":[{"$ref":"#/components/schemas/VideoJobOutput"},{"type":"null"}]},"error":{"type":["object","null"],"required":["code","message"],"description":"Set when the job failed, null otherwise.","properties":{"code":{"type":["string","null"],"enum":["generation_failed","content_policy","image_download_failed","timeout","storage_error","cancelled",null],"description":"Why the job failed. `generation_failed`: The model could not generate the output; retry, or contact support if it keeps happening. `content_policy`: The prompt or an input was rejected by the model's safety filters. `image_download_failed`: An input image (`image_url` or `end_image_url`) could not be downloaded; check that its URL is public and returns the image. `timeout`: Generation took too long and was stopped. `storage_error`: The output was generated but could not be stored; retry. `cancelled`: You cancelled the job (`POST /v1/jobs/{id}/cancel`) before it started; it is not charged."},"message":{"type":"string","description":"A fixed, readable explanation for the `code`. Branch on `code`, not on this text."}}},"usage":{"type":["object","null"],"required":["seconds"],"additionalProperties":false,"description":"Billed units once the video job succeeded, null before and when it failed: `{\"seconds\": n}`, the seconds of video billed.","properties":{"seconds":{"type":"number","description":"Seconds of video billed."}}}}},"AudioJob":{"type":"object","description":"A job with `type: audio`.","required":["type","started_at","completed_at","input","output","error","usage"],"properties":{"type":{"const":"audio"},"started_at":{"type":["integer","null"],"description":"Unix seconds when the model started generating; null while the job is queued."},"completed_at":{"type":["integer","null"],"description":"Unix seconds when the job reached `succeeded` or `failed`; null while it is in progress."},"input":{"$ref":"#/components/schemas/AudioJobInput"},"output":{"oneOf":[{"$ref":"#/components/schemas/AudioJobOutput"},{"type":"null"}]},"error":{"type":["object","null"],"required":["code","message"],"description":"Set when the job failed, null otherwise.","properties":{"code":{"type":["string","null"],"enum":["generation_failed","content_policy","timeout","storage_error","cancelled",null],"description":"Why the job failed. `generation_failed`: The model could not generate the output; retry, or contact support if it keeps happening. `content_policy`: The prompt or an input was rejected by the model's safety filters. `timeout`: Generation took too long and was stopped. `storage_error`: The output was generated but could not be stored; retry. `cancelled`: You cancelled the job (`POST /v1/jobs/{id}/cancel`) before it started; it is not charged."},"message":{"type":"string","description":"A fixed, readable explanation for the `code`. Branch on `code`, not on this text."}}},"usage":{"type":["object","null"],"additionalProperties":false,"description":"Billed units once the audio job succeeded, null before and when it failed: `{\"seconds\": n}` for models with set lengths, or `{\"generations\": 1}` for models that choose their own length.","properties":{"seconds":{"type":"number","description":"Seconds of audio billed."},"generations":{"type":"integer","description":"Number of generations billed (1)."}}}}},"ThreeDJobInput":{"type":"object","required":["prompt","image_url","view_images","generate_type","enable_pbr","face_count","texture_quality","geometry_quality","quad","negative_prompt","seed","auto_size","orientation","texture_alignment"],"additionalProperties":false,"description":"The parameters of a 3D job, defaults filled in. Exactly one of `prompt` and `image_url` is set. The options a model does not take, or that were not sent, are null.","properties":{"prompt":{"type":["string","null"],"description":"The text prompt, or null for an image job."},"image_url":{"type":["string","null"],"description":"The front view, or null for a text job.","format":"uri"},"view_images":{"type":["object","null"],"description":"The extra views (view name to URL), or null."},"generate_type":{"type":"string","enum":["normal","geometry"]},"enable_pbr":{"type":"boolean","description":"Whether PBR materials were requested."},"face_count":{"type":["integer","null"],"description":"The requested polygon count, or null for the model's default."},"texture_quality":{"type":["string","null"],"description":"`standard` or `detailed` when sent, else null."},"geometry_quality":{"type":["string","null"],"description":"`standard` or `detailed` when sent, else null."},"quad":{"type":["boolean","null"],"description":"Whether a quad mesh was requested, when sent."},"negative_prompt":{"type":["string","null"],"description":"What to avoid, when sent."},"seed":{"type":["integer","null"],"description":"The seed, when sent."},"auto_size":{"type":["boolean","null"],"description":"Whether real-world scaling was requested, when sent."},"orientation":{"type":["string","null"],"description":"`default` or `align_image`, when sent."},"texture_alignment":{"type":["string","null"],"description":"`original_image` or `geometry`, when sent."}}},"ThreeDFile":{"type":"object","required":["url","content_type","size"],"additionalProperties":false,"properties":{"url":{"type":"string","description":"Link to the file on `cdn.ewest.ai`, kept for 7 days.","format":"uri"},"content_type":{"type":"string","description":"Media type, e.g. `model/gltf-binary`."},"size":{"type":"integer","description":"Size in bytes."}}},"ThreeDJobOutput":{"type":"object","required":["url","content_type","files","thumbnail_url"],"additionalProperties":false,"description":"The result of a succeeded 3D job. Every file is stored on `cdn.ewest.ai`; a job that could not store all of them fails with `storage_error` and is not billed.","properties":{"url":{"type":"string","description":"Link to the main file: the GLB (the same as `files.glb.url`), or the FBX for a quad mesh (`quad: true`), which has no GLB.","format":"uri"},"content_type":{"type":"string","enum":["model/gltf-binary","application/octet-stream"],"description":"`model/gltf-binary` for the GLB; `application/octet-stream` for the FBX of a quad mesh."},"files":{"type":"object","description":"Every file by format: `glb` (not for quad meshes), `pbr_glb` (a second GLB with PBR materials, Tripo H3.1), and as the model returns them `obj` (with its `mtl` and `texture`), `fbx`, `usdz`.","additionalProperties":{"$ref":"#/components/schemas/ThreeDFile"}},"thumbnail_url":{"type":["string","null"],"description":"A preview image, or null.","format":"uri"}}},"ThreeDJob":{"type":"object","description":"A job with `type: 3d`.","required":["type","started_at","completed_at","input","output","error","usage"],"properties":{"type":{"const":"3d"},"started_at":{"type":["integer","null"],"description":"Unix seconds when the model started generating; null while the job is queued."},"completed_at":{"type":["integer","null"],"description":"Unix seconds when the job reached `succeeded` or `failed`; null while it is in progress."},"input":{"$ref":"#/components/schemas/ThreeDJobInput"},"output":{"oneOf":[{"$ref":"#/components/schemas/ThreeDJobOutput"},{"type":"null"}]},"error":{"type":["object","null"],"required":["code","message"],"description":"Set when the job failed, null otherwise.","properties":{"code":{"type":["string","null"],"enum":["generation_failed","content_policy","image_download_failed","timeout","storage_error","cancelled",null],"description":"Why the job failed. `generation_failed`: The model could not generate the output; retry, or contact support if it keeps happening. `content_policy`: The prompt or an input was rejected by the model's safety filters. `image_download_failed`: An input image (`image_url` or `end_image_url`) could not be downloaded; check that its URL is public and returns the image. `timeout`: Generation took too long and was stopped. `storage_error`: The output was generated but could not be stored; retry. `cancelled`: You cancelled the job (`POST /v1/jobs/{id}/cancel`) before it started; it is not charged."},"message":{"type":"string","description":"A fixed, readable explanation for the `code`. Branch on `code`, not on this text."}}},"usage":{"type":["object","null"],"required":["generations"],"additionalProperties":false,"description":"Billed units once the 3D job succeeded, null before and when it failed: `{\"generations\": 1}`.","properties":{"generations":{"type":"integer","description":"Number of generations billed (1)."}}}}},"JobList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}}}},"Model":{"type":"object","description":"The OpenAI model object. `GET /v1/models/{model}` adds every field of the model's catalog entry (see `CatalogModel`).","required":["id","object","created","owned_by"],"properties":{"id":{"$ref":"#/components/schemas/ModelId"},"object":{"const":"model"},"created":{"type":"integer","description":"Release date, Unix seconds."},"owned_by":{"type":"string","description":"The model's maker."}}},"KeyStatus":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","display","models","budget_usd","spent_usd","remaining_usd","budget_resets_at","rate_limits","organization"],"properties":{"id":{"type":["string","null"],"description":"The key's id in the console; null for an old key outside any organisation."},"name":{"type":["string","null"],"description":"The key's name in the console."},"display":{"type":["string","null"],"description":"The key's shortened form, as the console shows it."},"models":{"type":"array","items":{"type":"string"},"description":"The models this key may use; empty means every model."},"budget_usd":{"type":["number","null"],"description":"The key's own budget in USD; null when it has none."},"spent_usd":{"type":"number","description":"What the key has spent against its budget, in USD."},"remaining_usd":{"type":["number","null"],"description":"budget_usd minus spent_usd, never below 0; null without a budget."},"budget_resets_at":{"type":["string","null"],"format":"date-time","description":"When the budget period starts again; null for a budget that does not reset."},"rate_limits":{"type":"object","required":["requests_per_minute","tokens_per_minute"],"properties":{"requests_per_minute":{"type":["number","null"]},"tokens_per_minute":{"type":["number","null"]}},"description":"The key's own limits; null when the key has none."},"organization":{"type":["object","null"],"required":["balance_usd","paused"],"properties":{"balance_usd":{"type":"number","description":"The organisation's prepaid balance in USD."},"paused":{"type":"boolean","description":"Whether the organisation's keys are paused (balance used up or a payment dispute)."}},"description":"The key's organisation; null for an old key outside any organisation."}}}}},"ModelList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"},"description":"The models this key may use."}}},"CatalogModel":{"type":"object","description":"A public model and the options it accepts. Fields beyond the common ones depend on `type`.","required":["id","name","maker","description","type"],"properties":{"id":{"$ref":"#/components/schemas/ModelId"},"name":{"type":"string"},"released":{"type":"string","format":"date","description":"The maker's public release of this version, YYYY-MM-DD.","x-ewest-stability":"beta"},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video","3d","embedding","ranking"]},"x-ewest-stability":"beta"},"price":{"$ref":"#/components/schemas/Price","x-ewest-stability":"beta"},"your_price":{"$ref":"#/components/schemas/Price","x-ewest-stability":"beta","description":"Only when the catalog is requested with your API key and your organisation has a discount: `price` with your discount taken off each rate, in the same shape. Rate × units is what a request is charged. It uses today's discount, which can change daily (volume discounts) or when your plan changes."},"your_discount_pct":{"type":"number","x-ewest-stability":"beta","description":"Only with `your_price`: your discount on this model today, in percent off `price`."},"maker":{"type":"string","description":"Who made the model."},"description":{"type":"string"},"type":{"type":"string","enum":["chat","image","video","audio","3d","speech","transcription","embedding","rerank"]},"context_window":{"type":"integer","description":"Chat and embedding models."},"max_output_tokens":{"type":"integer","description":"Chat models."},"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","pdf","audio","video"]}},"supports_tools":{"type":"boolean"},"supports_streaming":{"type":"boolean"},"supports_reasoning":{"type":"boolean"},"reasoning_efforts":{"type":"array","items":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"]},"description":"Chat models: the `reasoning_effort` (Responses: `reasoning.effort`) values the model takes; any other value is a 400 `unsupported_value`. Empty when the model doesn't reason."},"sizes":{"type":"array","items":{"type":"string"}},"default_size":{"type":["string","null"]},"aspect_ratios":{"type":"array","items":{"type":"string"}},"resolutions":{"type":"array","items":{"type":"string"}},"qualities":{"type":"array","items":{"type":"string"}},"max_images":{"type":"integer"},"max_input_images":{"type":"integer","description":"Above 0: the model edits images (`image_urls`, `POST /v1/images/edits`)."},"defaults":{"type":"object","description":"Defaults for options left out (image: aspect_ratio, resolution, quality; video: duration, resolution, aspect_ratio)."},"voices":{"type":"array","items":{"type":"string"}},"default_voice":{"type":"string"},"max_characters":{"type":"integer"},"supports_speed":{"type":"boolean"},"supports_instructions":{"type":"boolean"},"format":{"type":"string"},"kind":{"type":"string","enum":["music","sound"]},"durations":{"type":"array","items":{"type":"number"}},"default_duration":{"type":["number","null"]},"supports_instrumental":{"type":"boolean"},"supports_loop":{"type":"boolean"},"languages":{"type":["array","null"],"items":{"type":"string"}},"default_language":{"type":["string","null"]},"supports_diarization":{"type":"boolean"},"max_minutes":{"type":"integer"},"dimensions":{"type":"integer"},"max_documents":{"type":"integer"},"supports_image_input":{"type":"boolean"},"requires_image_input":{"type":"boolean","description":"True: the model needs an input image (image to video; or an edit-only image model such as background removal, served on `POST /v1/images/edits`)."},"supports_mask":{"type":"boolean","description":"Image edit models: a single-image edit accepts `mask_url` (or a multipart `mask` file): white where the model may change the image, black where it stays."},"prompt_optional":{"type":"boolean","description":"Image edit-only models: `prompt` is not needed (it is accepted and ignored). Edit-only models without this flag require a `prompt` with the edit to make."},"supports_end_image":{"type":"boolean"},"supports_audio_toggle":{"type":"boolean"},"generates_audio":{"type":"boolean"},"max_prompt_chars":{"type":"integer","description":"Longest prompt the model accepts, in characters."},"view_images":{"type":"array","items":{"type":"string"},"description":"3D models: the view names accepted in `view_images`."},"generate_types":{"type":"array","items":{"type":"string"},"description":"3D models: the `generate_type` values."},"supports_pbr":{"type":"boolean","description":"3D models: `enable_pbr` is accepted."},"face_count":{"type":"object","description":"3D models: the accepted `face_count` range and default (`default` is null when the model chooses the count itself).","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"default":{"type":["integer","null"]}}},"pbr_default":{"type":"boolean","description":"3D models: whether `enable_pbr` is on when you do not send it."},"options":{"type":"array","items":{"type":"string"},"description":"3D models: the other optional request parameters the model takes (`texture_quality`, `geometry_quality`, `quad`, `negative_prompt`, `seed`, `auto_size`, `orientation`, `texture_alignment`)."},"output_formats":{"type":"array","items":{"type":"string"},"description":"3D models: the file names in `output.files` the model always returns."}}},"Price":{"type":"object","description":"What a request is billed, in USD and the model's native unit (beta).","required":["unit","from","rows"],"properties":{"unit":{"type":"string","enum":["1M_tokens","image","megapixel","second","minute","1K_characters","video","track","generation","request"]},"from":{"type":"number","description":"Lowest current rate in `unit` over all options (tokens: the input rate)."},"rows":{"type":"array","items":{"type":"object","required":["item","usd","unit"],"properties":{"item":{"type":"string","enum":["input","output","input_image","request"]},"usd":{"type":"number"},"unit":{"type":"string"},"when":{"type":"object","description":"The options this row applies to, e.g. `{\"resolution\": \"720p\"}`; none means always."},"valid_from":{"type":"string","description":"RFC 3339 UTC; the row applies from this instant (launch prices)."},"valid_until":{"type":"string"}}}}}},"PerformancePercentiles":{"type":"object","description":"Percentiles in milliseconds, each the middle of its measurement bucket (about ±19 %). `\">120000\"` when it falls above 2 minutes (`\"> 1 h\"` for jobs). All null below the sample minimum.","required":["p50","p75","p90","p95","p99"],"properties":{"p50":{"type":["integer","string","null"]},"p75":{"type":["integer","string","null"]},"p90":{"type":["integer","string","null"]},"p95":{"type":["integer","string","null"]},"p99":{"type":["integer","string","null"]}}},"ModelPerformance":{"type":"object","description":"Measured at eWest's edge on real traffic and checks; individual results vary. Request counts are never published.","required":["model","window","as_of","status","sample_ok","availability","errors","ttft_ms","latency_ms","speed_tps_avg"],"properties":{"model":{"$ref":"#/components/schemas/ModelId"},"window":{"type":"string","enum":["1h","24h","7d","30d"]},"as_of":{"type":"string","format":"date-time","description":"When the figures were computed (refreshed at most once a minute)."},"status":{"type":"string","enum":["ok","unavailable"],"description":"`unavailable`: the model is temporarily unavailable; no figures are shown."},"sample_ok":{"type":"boolean","description":"False below 50 eligible requests in the window; the figures are then null."},"availability":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Successful ÷ eligible requests, 3 decimals. Caller errors and your own limits are not counted."},"errors":{"type":["object","null"],"description":"Shares of eligible requests.","required":["server","timeout","rate_limited","fallback"],"properties":{"server":{"type":"number"},"timeout":{"type":"number"},"rate_limited":{"type":"number"},"fallback":{"type":"number","description":"Answered by another model than requested (counts as failed for this model)."}}},"ttft_ms":{"$ref":"#/components/schemas/PerformancePercentiles","description":"Time to first token, streaming requests only."},"latency_ms":{"$ref":"#/components/schemas/PerformancePercentiles","description":"End-to-end time of successful requests."},"speed_tps_avg":{"type":["integer","null"],"description":"Average output tokens per second, streaming requests only."}}},"PerformancePoint":{"type":"object","required":["t","sample_ok","availability","ttft_p50_ms","latency_p50_ms"],"properties":{"t":{"type":"string","format":"date-time","description":"Start of the interval."},"sample_ok":{"type":"boolean"},"availability":{"type":["number","null"]},"ttft_p50_ms":{"type":["integer","string","null"]},"latency_p50_ms":{"type":["integer","string","null"]}}},"ModelPerformanceDetail":{"allOf":[{"$ref":"#/components/schemas/ModelPerformance"},{"type":"object","required":["series"],"properties":{"series":{"type":"array","items":{"$ref":"#/components/schemas/PerformancePoint"},"description":"One point per 5 minutes (`1h`), hour (`24h`, `7d`) or day (`30d`); intervals without enough requests have `sample_ok: false`."}}}]},"PerformanceList":{"type":"object","required":["window","as_of","data"],"properties":{"window":{"type":"string","enum":["1h","24h","7d","30d"]},"as_of":{"type":"string","format":"date-time"},"data":{"type":"array","items":{"type":"object","description":"A `ModelPerformance` without `window` and `as_of`.","required":["model","status","sample_ok"],"properties":{"model":{"$ref":"#/components/schemas/ModelId"},"status":{"type":"string"},"sample_ok":{"type":"boolean"}}}}}},"ModelDetail":{"allOf":[{"$ref":"#/components/schemas/Model"},{"$ref":"#/components/schemas/CatalogModel"}]},"Catalog":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/CatalogModel"}}}}},"responses":{"JobConflict":{"description":"The job can't be cancelled: it has already started (`code: job_running`; it finishes and is charged only if it succeeds), it has already finished (`code: job_finished`), or it is being updated right now (`code: job_busy`; retry in a moment).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"message":"This job has already started and can't be stopped. It will finish, and it is charged only if it succeeds.","type":"invalid_request_error","param":null,"code":"job_running"}}}}},"BadRequest":{"description":"Invalid request: a missing or out-of-range field (`param` names it), a model of another type than the endpoint serves (`code: model_not_supported`; `param: models` when the wrong-type model is a fallback in `models`), a malformed `response_format` or `text.format` (`code: invalid_type`, `invalid_value` or `missing_required_parameter`, with `param` such as `response_format.json_schema.schema`), a parameter the model or API does not accept (`code: unsupported_parameter`), a value it does not accept (`code: unsupported_value`, for example a `reasoning_effort` the model doesn't take, with the supported ones in `message`), input rejected by the model's safety filters (`type: content_policy`), or a file or image given by URL that could not be downloaded (`code: image_download_failed` for images, also on image-generation and video requests; `code: file_download_failed` for PDF or video URLs in chat, Responses and Messages content parts; `param` names the field).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"message":"ewest/gemini-flash is a chat model and can't be used on this endpoint.","type":"invalid_request_error","param":"model","code":"model_not_supported"}}}}},"Unauthorized":{"description":"Missing, invalid, expired or blocked API key.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"message":"Invalid API key. Check the key you are using, or create a new one in the console.","type":"invalid_api_key","param":"key","code":"401"}}}}},"PaymentRequired":{"description":"The key's budget (`type: insufficient_budget`) or the organisation's prepaid balance (`type: insufficient_balance`) does not cover the estimated cost. A key that is out of budget gets 402 `insufficient_budget` on every route, chat routes included.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"message":"This API key does not have enough budget left for this video","type":"insufficient_budget","param":null,"code":"402"}}}}},"PermissionDenied":{"description":"The key may not use this model.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"message":"This API key is not allowed to use ewest/claude-opus.","type":"permission_error","param":"model","code":"403"}}}}},"NotFound":{"description":"Unknown model (`code: model_not_found`), unknown job, an unknown endpoint (`type: invalid_request_error`, `code: not_found`, message \"Unknown endpoint\"), or on `/v1/responses` a `previous_response_id` that isn't a stored response of your organization (`code: not_found`, `param: previous_response_id`).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"message":"The model 'ewest/…' does not exist. GET /v1/catalog lists the available models.","type":"not_found_error","param":"model","code":"model_not_found"}}}}},"MessagesBadRequest":{"description":"Invalid request (`type: invalid_request_error`): a missing or out-of-range field (`param` names it), a model of another type (`code: model_not_supported`), an `output_config.effort` the model doesn't take (`code: unsupported_value`), and so on, as for the shared `BadRequest` response.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"},"example":{"type":"error","error":{"type":"invalid_request_error","message":"ewest/gemini-embedding is an embedding model and can't be used on this endpoint.","code":"model_not_supported","param":"model"},"request_id":"req_example"}}}},"MessagesUnauthorized":{"description":"Missing, invalid, expired or blocked API key (`type: authentication_error`).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"},"example":{"type":"error","error":{"type":"authentication_error","message":"Invalid API key. Check the key you are using, or create a new one in the console.","code":"401","param":"key"},"request_id":"req_example"}}}},"MessagesPaymentRequired":{"description":"The key's budget or the organisation's prepaid balance does not cover the estimated cost (`type: billing_error`; `code` is `insufficient_budget` or `insufficient_balance`).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"MessagesPermissionDenied":{"description":"The key may not use this model (`type: permission_error`).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"},"example":{"type":"error","error":{"type":"permission_error","message":"This API key is not allowed to use ewest/claude-opus.","code":"403","param":"model"},"request_id":"req_example"}}}},"MessagesNotFound":{"description":"Unknown model (`type: not_found_error`, `code: model_not_found`) or unknown endpoint.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"},"example":{"type":"error","error":{"type":"not_found_error","message":"The model 'ewest/…' does not exist. GET /v1/catalog lists the available models.","code":"model_not_found","param":"model"},"request_id":"req_example"}}}},"MessagesRateLimited":{"description":"Too many requests for this key (`type: rate_limit_error`; retry after a pause).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"MessagesServerError":{"description":"Internal error (`type: api_error`).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"MessagesBadGateway":{"description":"The model failed or is unavailable (`type: api_error`); retry with backoff.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"MessagesServiceUnavailable":{"description":"Temporarily unavailable (`type: overloaded_error`); retry with backoff. A request whose content has file or image URLs gets `code: file_inputs_unavailable` (`type: api_error`) when fetching those files is busy or temporarily down; when it is busy the answer carries `Retry-After: 2`. Retry shortly, or send the file inline as base64.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"description":"Seconds to wait before retrying; sent with `file_inputs_unavailable` when file downloads are busy.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"MessagesTimeout":{"description":"The model took too long to respond (`type: timeout_error`).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"PayloadTooLarge":{"description":"The upload is too large.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnsupportedMediaType":{"description":"Form bodies are accepted only on `/v1/audio/transcriptions` and `/v1/images/edits`; send JSON.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests for this key (retry after a pause).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ServerError":{"description":"Internal error.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"BadGateway":{"description":"The model failed or is unavailable; retry with backoff. When every model of a `models` list failed: `code: model_unavailable`.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"message":"The model is temporarily unavailable. Retry, or list fallback models in `models`.","type":"model_unavailable","param":null,"code":"model_unavailable"}}}}},"ServiceUnavailable":{"description":"Temporarily unavailable; retry with backoff. A chat, Responses or Messages request whose content has file or image URLs gets `code: file_inputs_unavailable` (`type: api_error`) when fetching those files is busy or temporarily down; when it is busy the answer carries `Retry-After: 2`. Retry shortly, or send the file inline as base64.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"description":"Seconds to wait before retrying; sent with `file_inputs_unavailable` when file downloads are busy.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Timeout":{"description":"The model took too long to respond (`type: timeout_error`).","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}