Skip to main content
POST
Chat completions
Creates a model response for the given chat conversation. Requests are served through the attested TEE gateway, which does not retain request bodies. A confidential response additionally runs on a verified upstream enclave, confirmed per response from the receipt’s upstream.verified event. The response includes an x-receipt-id header for verification.

Request body

string
default:"z-ai/glm-5.2"
required
Model ID returned by GET /v1/models.
array
required
Array of message objects. Each message needs role and content.Example:
With system message:
number
Sampling temperature (0-2), default 1
integer
Maximum tokens to generateOpenAI gpt-5, o3, and o4 models reject it; send max_completion_tokens instead.
integer
Maximum tokens to generate, for OpenAI gpt-5, o3, and o4 models. Each model object’s supported_parameters lists which of the two it accepts.
boolean
Stream responses, default false
number
Nucleus sampling (0-1)
integer
Number of completions, default 1
number
Presence penalty (-2 to 2)
number
Frequency penalty (-2 to 2)
object
Routing constraints for this request. Fields are applied together, and the request is served only by a provider that satisfies all of them.zdr (boolean): set true to route only to providers that operate under zero data retention, meaning they do not retain prompt or completion content after serving the request. false, or omitting the field, applies no retention constraint.
If no provider for the model satisfies the constraint, the request returns 404 and no prompt is sent. The constraint is enforced for the whole request, including failover, so a retry cannot fall back to a provider that does not satisfy it.Find models that can satisfy zdr ahead of time with GET /v1/models?zdr=true. See Zero data retention.aci_verified (boolean): set true to route only to an upstream the gateway verified inside the TEE before sending the prompt. false, or omitting the field, applies no attestation constraint.
If no upstream for the model is both classified as attested and currently verified, the request returns 503 and no prompt is sent. X-Upstream-Verification: none cannot relax this constraint.aci_session_ids (array of strings): restrict the request further to specific attested channels, identified by the session ids from GET /v1/aci/sessions. Any one of the listed ids may serve the request; if none matches a currently verified channel, the request returns 503.
Session ids imply aci_verified. Passing them with "aci_verified": false returns 400, as does an empty array or a non-string entry. Both fields are read by the gateway and removed before the request reaches a provider. See Attested routing.

Message object

Examples

Response

Streaming

Function calling

Vision

Error handling