cURL (Unified Mode)
cURL (Unified Mode)
Raw HTTP examples for the unified endpoint
The unified endpoint is POST /v1/chat/completions. It accepts an OpenAI-compatible request body and returns an OpenAI-compatible response, regardless of which provider handles the request.
Basic request
Calling Anthropic
Calling Gemini
Streaming
Add "stream": true to get Server-Sent Events:
The response is a stream of data: lines in OpenAI’s SSE format:
Tool calling
Response format
All responses follow the OpenAI chat completion format:
For Anthropic and Gemini, the model field in the response includes the provider prefix (e.g., anthropic/claude-sonnet-4-6). For OpenAI, the response uses the provider’s own model identifier (e.g., gpt-4o).