Overview
The gateway’s translate layer converts the public chat-completions request format into the runtime’s native shape and maps runtime events back to a standard response format. It also produces a consistent error body across all gateway endpoints so existing client libraries can surface failures uniformly. This page documents the supported request fields, response shapes, streaming chunks, and error format.Base URL
Request translation
Chat completion request
Unknown fields are tolerated on the request body so client SDKs can send extra metadata without causing validation errors.
Message roles
Message content
Content may be a plain string or an array of parts:textimage_urlinput_imagevideo_urlinput_videofile_id
file parts so vision-capable models receive the actual media.
Response translation
Chat completion response
Finish reasons
Streaming chunks
Streaming responses use server-sent events. Eachdata: line contains a chunk object.
Chunk types
- Role chunk — announces the assistant role.
- Content delta chunk — incremental text.
- Tool-call delta chunk — incremental tool-call arguments.
- Finish chunk — empty delta with
finish_reason. - Usage chunk — final usage object when
stream_options.include_usageis true.
[DONE].
Citations and annotations
Whencitations is enabled and the provider supports native citations, the assistant message includes annotations:
[cite:<id>] markers from the response, returning them in the top-level citations array.
Error format
All gateway errors return the same JSON shape:Error codes
Related pages
- Chat Completions — translated request/response examples
- Proxy — middleware and routing that uses the translate layer
- Models — model identifiers used in requests