Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string

Model identifier to use for the response, for example zai-org/GLM-5.1-FP8 or another model available from the Telnyx OpenAI-compatible models endpoint.

service_tier
string

The service tier to use for this request. Supported values vary by model; use GET /v2/ai/openai/models and inspect the model's service_tiers field. If omitted, Telnyx-hosted models use default.

region
enum<string>

Optional data-residency region the request should be served from, using the same vocabulary as your account's Data Locality setting. Behavior depends on mode. Supported for Telnyx-hosted models only: a request routed to an external provider never passes through Telnyx model routing, so a region cannot be enforced for it. Omit for today's latency-based routing.

Available options:
USA,
EU,
AUS,
UAE
mode
enum<string>
default:preferred

How strictly region is applied. preferred (the default when region is set) tries that region first and falls back to another when the model cannot be served there, so a request that would have succeeded still succeeds. strict pins the request: it is served from that region or it fails with a 422, never redirected to another region. Requires region.

Available options:
preferred,
strict
input
any

The input items for this turn, using the OpenAI Responses API input format.

conversation
string<uuid>

Optional Telnyx Conversation ID from POST /ai/conversations. When provided, Telnyx stores this turn on that conversation and uses the conversation's prior messages as context. Reuse the same ID for subsequent turns and tool-result followups. Omit it for a non-persisted, stateless response.

instructions
string

Optional system/developer instructions for the model. When used with a persisted conversation, send these on the first request that creates the thread; subsequent turns can rely on the stored history.

stream
boolean

Set to true to stream Server-Sent Events, matching OpenAI's Responses streaming format.

reasoning
object

Response

Successful Response

The response is of type object.