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
Minimum array length:
1- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Required range:
0 <= x <= 20Available options:
auto, default, flex, scale, priority Available options:
text Available options:
low, medium, high Available options:
minimal, low, medium, high Required range:
-9007199254740991 <= x <= 9007199254740991Required range:
-2 <= x <= 2Required range:
-2 <= x <= 2- Option 1
- Option 2
- Option 3
Required range:
-9007199254740991 <= x <= 9007199254740991Required range:
1 <= x <= 128Required range:
-9007199254740991 <= x <= 9007199254740991- Option 1
- Option 2
Available options:
none, auto, required Available options:
none, auto Required array length:
1 - 128 elementsResponse
200
Request accepted