Create chat completion
Create a chat completion, optionally streamed as SSE. Native dispatch preserves provider-specific JSON fields when the destination supports the caller’s format. Cross-format routing converts through the Gateway’s shared representation: provider-only features are not guaranteed to survive. Support for reasoning, images, built-in tools and structured outputs depends on the destination model.
Request
- Base URL: https://edgee.io
- URL: https://edgee.io/v1/chat/completions
- Auth: HTTP bearer
Headers
Comma-separated analytics tags. Trimmed and merged with body tags.
Enable debug capture for this request. Does not add a debug object to the API response.
Turn tool-result trimming on or off. Overrides the API key setting for this request only. Values are case-insensitive, and a missing or invalid value keeps the key's setting.
Turn MCP tool surface reduction on or off. The threshold and resolver mode still come from the API key. Overrides the API key setting for this request only. Values are case-insensitive, and a missing or invalid value keeps the key's setting.
Turn output brevity on or off. Overrides the API key setting for this request only. Values are case-insensitive, and a missing or invalid value keeps the key's setting.
Session identifier used to group request usage.
Request body
Example request
{
"model": "openai/gpt-5.2",
"messages": [
{
"cache_control": {
"type": "ephemeral"
}
}
],
"reasoning_effort": "high"
}Response
Chat completion created successfully
Example response
{
"id": "chatcmpl-123",
"created": 1677652288,
"model": "openai/gpt-5.2",
"choices": [
{
"message": {
"cache_control": {
"type": "ephemeral"
}
}
}
],
"compression": {
"saved_tokens": 450,
"cost_savings": 27000000,
"reduction": 48.99884991374353,
"time_ms": 12
}
}Changes
No recorded changes to this operation across all 1 revision of this API.