v55

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-06107288545.4 KB
chat_completions

OpenAI-compatible chat completions

Creates a chat completion using the OpenAI wire format, proxying to the selected provider with credentials resolved on the server (secret store first, environment second) — callers never handle provider API keys. Model must be '{provider}:{model_name}' for a built-in provider (one of anthropic, aws, azure_openai, cerebras, deepseek, fireworks, google, groq, moonshot, ollama, openai, perplexity, together, xai) or 'custom:{provider_id}:{model_name}' for a stored custom provider, e.g. 'openai:gpt-4o' or 'anthropic:claude-sonnet-4-5'. Set stream: true for server-sent events of chat.completion.chunk payloads terminated by data: [DONE]. Tool calling is not supported.

Phoenix is not an AI gateway. The same server also takes on trace ingestion traffic, so routing production LLM calls through it competes with ingestion. Use this endpoint only to quickly try out different models in non-production environments.

post/v1/chat/completions

Request body

modelstring required

Model must be '{provider}:{model_name}' for a built-in provider (one of anthropic, aws, azure_openai, cerebras, deepseek, fireworks, google, groq, moonshot, ollama, openai, perplexity, together, xai) or 'custom:{provider_id}:{model_name}' for a stored custom provider, e.g. 'openai:gpt-4o' or 'anthropic:claude-sonnet-4-5'.

streamboolean
temperaturenumber nullable
top_pnumber nullable
max_tokensinteger nullable
max_completion_tokensinteger nullable
frequency_penaltynumber nullable
presence_penaltynumber nullable
seedinteger nullable
ninteger nullable
{"stackTrail":"components:schemas:CreateChatCompletionRequestBody:properties:tool_choice:anyOf","oasType":"schema","type":"unknown","title":"Tool Choice","nullable":true}
response_formatobject nullable

Example request

{
  "messages": [
    {
      "content": "You are a helpful assistant.",
      "role": "system"
    },
    {
      "content": "Say hello.",
      "role": "user"
    }
  ],
  "model": "openai:gpt-4o"
}

Response

Successful Response

idstring required
object'chat.completion'
createdinteger required
modelstring required