{"openapi":"3.1.0","info":{"title":"ChatVLM Chat API","version":"1","description":"ChatVLM from your own app: its chats, where a message runs the turn the app runs and the chat shows up in ChatVLM, and plain completions on its models. Sign in with your own key, or have your users sign in with ChatVLM."},"servers":[{"url":"https://api.chatvlm.com/v1"}],"security":[{"apiKey":[]},{"signInWithChatvlm":[]}],"tags":[{"name":"Chats","description":"The conversations, shared with the app."},{"name":"Messages","description":"Send a message, stream the reply, stop or resume it."},{"name":"Files","description":"Attach files, and fetch the ones replies make."},{"name":"Completions","description":"One model, OpenAI’s protocol, nothing saved."},{"name":"Reference","description":"This document."}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A personal key from Settings → API. It acts as you: keep it on your server."},"signInWithChatvlm":{"type":"oauth2","description":"Sign in with ChatVLM: your users sign in to their own ChatVLM account, on any plan, and agree to your app acting for them, on that plan. ChatVLM registers your app for enterprise customers and gives you its client id and secret; send it the redirect URIs you will use.","flows":{"authorizationCode":{"authorizationUrl":"https://persuasive-pink-63.authkit.app/oauth2/authorize","tokenUrl":"https://persuasive-pink-63.authkit.app/oauth2/token","refreshUrl":"https://persuasive-pink-63.authkit.app/oauth2/token","scopes":{"chat":"Start chats and read the ones your app started.","completions":"Call models for completions.","offline_access":"A refresh token, so your app stays signed in until the user disconnects it."}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"}},"required":["message","type"]}},"required":["error"]}}},"paths":{"/chats":{"get":{"operationId":"listChats","tags":["Chats"],"summary":"List chats","description":"Every chat you can see — your own and those shared with you in a workspace — most recently active first. A partner app sees only the chats it started.","responses":{"200":{"description":"An array of chats.","content":{"application/json":{}}},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account cannot do this: a personal key for the chats needs the enterprise plan, and a partner app needs its user to have signed in to ChatVLM and granted it the scope. Or this month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createChat","tags":["Chats"],"summary":"Create a chat","description":"An empty chat, in the app’s sidebar from the start. Without a `workspaceId` or `projectId` it is personal; without a `presetId` it uses the preset selected in Settings.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Your own id for the chat; one is made when absent."},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Create the chat inside this project, sharing its workspace and access."},"workspaceId":{"type":"string","minLength":1,"description":"Create the chat in this workspace, private to you until shared."},"presetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The preset whose models answer in this chat."},"personalityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A persona to answer as."}}},"example":{}}}},"responses":{"201":{"description":"The chat.","content":{"application/json":{"example":{"id":"0db14ae3-d26b-4953-b1cd-da525d13ea84","name":null}}}},"400":{"description":"The request is not one the API accepts; the message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account cannot do this: a personal key for the chats needs the enterprise plan, and a partner app needs its user to have signed in to ChatVLM and granted it the scope. Or this month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such chat, file or model, or not one you can reach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/chats/{chatId}":{"get":{"operationId":"getChat","tags":["Chats"],"summary":"Get a chat","description":"One chat, with its name once the first reply has titled it.","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat, as `POST /chats` or `GET /chats` returned it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The chat.","content":{"application/json":{}}},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account cannot do this: a personal key for the chats needs the enterprise plan, and a partner app needs its user to have signed in to ChatVLM and granted it the scope. Or this month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such chat, file or model, or not one you can reach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/chats/{chatId}/messages":{"get":{"operationId":"listMessages","tags":["Messages"],"summary":"List messages","description":"A page of the chat’s messages in the order they were sent, the newest `take` by default. Pass the oldest id you hold as `cursor` to page further back.","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat, as `POST /chats` or `GET /chats` returned it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"cursor","in":"query","required":false,"description":"Return the messages before this one.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"until","in":"query","required":false,"description":"Return everything from this message to the newest (up to 1,000). Not with `cursor`.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"take","in":"query","required":false,"description":"How many messages a page holds.","schema":{"default":100,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"An array of messages, oldest first.","content":{"application/json":{}}},"400":{"description":"The request is not one the API accepts; the message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account cannot do this: a personal key for the chats needs the enterprise plan, and a partner app needs its user to have signed in to ChatVLM and granted it the scope. Or this month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such chat, file or model, or not one you can reach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"sendMessage","tags":["Messages"],"summary":"Send a message","description":"Runs the same turn the app runs — routing, tools, documents, artifacts, memory, council mode — and streams the reply back as the AI SDK UI message stream, which `useChat` reads as it is. Closing the connection does not stop the reply: it runs to the end and is saved, to resume with `GET /chats/{chatId}/stream` or read back with `GET /chats/{chatId}/messages`.","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat, as `POST /chats` or `GET /chats` returned it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trigger":{"default":"submit","type":"string","enum":["submit","regenerate","edit","approve"],"description":"`submit` sends a new message; `regenerate` re-runs the last reply and takes no message; `edit` rewrites the message whose `id` you send and runs again from there; `approve` answers a reply that stopped to ask before using a tool."},"message":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Your own id for the message, which `edit` targets later; one is made when absent."},"text":{"type":"string","description":"What you say. May be empty when `fileIds` attaches something."},"pasted":{"type":"array","items":{"type":"string"},"description":"Long pasted passages, kept apart from the text as the app does."}},"required":["text"],"description":"The new message. Required with `submit` and `edit`."},"approvals":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"approved":{"type":"boolean"},"reason":{"type":"string","maxLength":500},"always":{"type":"boolean","description":"Approve this plugin tool from now on, without asking."}},"required":["id","approved"]},"description":"With `approve`: one answer per tool call the reply stopped on."},"clientContext":{"type":"object","properties":{"time":{"type":"object","properties":{"iso":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"timezone":{"type":"string","minLength":1}},"required":["iso","timezone"]},"language":{"type":"string","maxLength":35}},"description":"What only your client knows: the user’s time and zone, and the reply language."},"mode":{"default":"single","type":"string","enum":["single","council"],"description":"`council` asks a panel of models and has a judge write the answer."},"modelName":{"type":"string","description":"Answer with this model from the chat’s preset instead of the router’s pick."},"effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"How hard the model thinks; absent leaves it to the router."},"fileIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Files to attach, from `POST /files`."},"artifactRefs":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"artifactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["artifactId"]},"description":"Artifacts to use as inputs; an absent version takes the latest."}}},"example":{"message":{"text":"Summarise the attached report"},"fileIds":["0db14ae3-d26b-4953-b1cd-da525d13ea84"]}}}},"responses":{"200":{"description":"The reply, as server-sent events ending in `data: [DONE]`.","content":{"text/event-stream":{"schema":{"type":"string"},"example":"data: {\"type\":\"start\",\"messageId\":\"0db14ae3-d26b-4953-b1cd-da525d13ea84\"}\n\ndata: {\"type\":\"text-start\",\"id\":\"t0\"}\n\ndata: {\"type\":\"text-delta\",\"id\":\"t0\",\"delta\":\"Hello\"}\n\ndata: {\"type\":\"text-end\",\"id\":\"t0\"}\n\ndata: {\"type\":\"finish\"}\n\ndata: [DONE]"}}},"400":{"description":"The request is not one the API accepts; the message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account cannot do this: a personal key for the chats needs the enterprise plan, and a partner app needs its user to have signed in to ChatVLM and granted it the scope. Or this month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such chat, file or model, or not one you can reach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/chats/{chatId}/stream":{"get":{"operationId":"resumeStream","tags":["Messages"],"summary":"Resume a reply","description":"The running reply from its first event, for a client that lost its connection mid-reply.","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat, as `POST /chats` or `GET /chats` returned it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The reply, as server-sent events.","content":{"text/event-stream":{"schema":{"type":"string"},"example":"data: {\"type\":\"start\",\"messageId\":\"0db14ae3-d26b-4953-b1cd-da525d13ea84\"}\n\ndata: {\"type\":\"text-start\",\"id\":\"t0\"}\n\ndata: {\"type\":\"text-delta\",\"id\":\"t0\",\"delta\":\"Hello\"}\n\ndata: {\"type\":\"text-end\",\"id\":\"t0\"}\n\ndata: {\"type\":\"finish\"}\n\ndata: [DONE]"}}},"204":{"description":"No reply is running."},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account cannot do this: a personal key for the chats needs the enterprise plan, and a partner app needs its user to have signed in to ChatVLM and granted it the scope. Or this month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such chat, file or model, or not one you can reach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/chats/{chatId}/stop":{"post":{"operationId":"stopReply","tags":["Messages"],"summary":"Stop a reply","description":"Stops the running reply where it is; what it wrote so far is saved.","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat, as `POST /chats` or `GET /chats` returned it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"204":{"description":"Stopped, or nothing was running."},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account cannot do this: a personal key for the chats needs the enterprise plan, and a partner app needs its user to have signed in to ChatVLM and granted it the scope. Or this month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such chat, file or model, or not one you can reach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/files":{"post":{"operationId":"uploadFile","tags":["Files"],"summary":"Upload a file","description":"Adds a file to a chat or a project, to attach with `fileIds`. It can be attached at once; the reply waits for it to be read.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","contentEncoding":"binary","maxLength":209715200,"description":"The file. Audio and video may be larger than other files."},"chatId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The chat it belongs to. Exactly one of `chatId` and `projectId`."},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The project it belongs to."}},"required":["file"]},"example":{"file":"@report.pdf","chatId":"0db14ae3-d26b-4953-b1cd-da525d13ea84"}}}},"responses":{"201":{"description":"The file, with its `id`.","content":{"application/json":{"example":{"id":"0db14ae3-d26b-4953-b1cd-da525d13ea84","name":"report.pdf","status":"PROCESSING"}}}},"400":{"description":"The request is not one the API accepts; the message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account cannot do this: a personal key for the chats needs the enterprise plan, and a partner app needs its user to have signed in to ChatVLM and granted it the scope. Or this month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such chat, file or model, or not one you can reach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/files/{fileId}":{"get":{"operationId":"getFile","tags":["Files"],"summary":"Get a file","description":"A file you uploaded or a reply made, with a `url` to its bytes that works without your key for a short while — fit for an `<img>` or a download link.","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file’s id.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"download","in":"query","required":false,"description":"`1` makes the `url` download the file instead of opening it.","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"The file, with its `url`.","content":{"application/json":{}}},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account cannot do this: a personal key for the chats needs the enterprise plan, and a partner app needs its user to have signed in to ChatVLM and granted it the scope. Or this month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such chat, file or model, or not one you can reach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"operationId":"getReference","tags":["Reference"],"summary":"This reference","description":"This document, for code generators and API clients. Needs no key.","security":[],"responses":{"200":{"description":"The OpenAPI 3.1 document.","content":{"application/json":{}}}}}},"/models":{"get":{"operationId":"listModels","tags":["Completions"],"summary":"List models","description":"The models you may call for completions, in OpenAI’s list shape, with each one’s context window and output limit. An admin decides which models these are.","responses":{"200":{"description":"A list of models.","content":{"application/json":{"example":{"object":"list","data":[{"id":"anthropic/claude-sonnet-5","object":"model","owned_by":"pro","name":"Claude Sonnet 5","context_window":200000,"max_tokens":64000,"input":["text","image"],"reasoning":true}]}}}},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account cannot do this: a personal key for the chats needs the enterprise plan, and a partner app needs its user to have signed in to ChatVLM and granted it the scope. Or this month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/chat/completions":{"post":{"operationId":"createCompletion","tags":["Completions"],"summary":"Create a completion","description":"OpenAI chat completions on one model, named by its id: no router, tools or memory, and nothing saved as a chat. The body reaches the model as it is, so any OpenAI client works; with `stream` the reply comes as server-sent events in OpenAI’s chunk format. Each call counts against your plan’s allowance.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"description":"A model id from `GET /models`."},"stream":{"type":"boolean","description":"Stream the reply as server-sent events."},"stream_options":{"type":"object","properties":{},"additionalProperties":{},"description":"OpenAI’s stream options. The usage chunk is always sent: it is how the call is metered."}},"required":["model"],"additionalProperties":{}},"example":{"model":"anthropic/claude-sonnet-5","messages":[{"role":"user","content":"Hello"}]}}}},"responses":{"200":{"description":"A chat completion, or with `stream`, its chunks as server-sent events.","content":{"application/json":{"example":{"object":"chat.completion","model":"anthropic/claude-sonnet-5","choices":[{"index":0,"message":{"role":"assistant","content":"Hello!"},"finish_reason":"stop"}],"usage":{"prompt_tokens":8,"completion_tokens":3,"total_tokens":11}}}}},"400":{"description":"The request is not one the API accepts; the message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or access token is missing, unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"This month's allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such chat, file or model, or not one you can reach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}