Text
Chat Completions (Gateway)
Create chat completions via the AI Gateway
POST
This request schema applies when using the Planck AI Gateway with pass‑through billing (credits). In BYOK mode, the standard OpenAI Chat Completions schema is allowed. The schema is defined based on fields that are stable across all provider-model mappings.
Learn more about pass‑through billing vs BYOK.
For runnable SDK examples, raw SSE parsing, cancellation, and mid-stream error handling, see Streaming chat completions.
max_tokens and max_completion_tokens are optional on this route. If both are omitted, Planck leaves the output limit unspecified and the selected provider applies its own default.
For models that support reasoning, use reasoning_effort and include_reasoning. See Reasoning and thinking for model-specific values and complete OpenAI, cURL, and Anthropic examples.
This endpoint uses the shared AI Gateway error envelope. See the
Error Handling & Fallback guide for
response examples, retry rules, fallback behavior, and streaming errors.
Body
application/json
Response
200
Request accepted