Chat API (Legacy)
The original /api/chat endpoint — kept live for existing integrations
This is the original multi-model chat endpoint. Still fully supported — nothing has been removed — but new integrations should prefer the named v1 endpoints.
POST /api/chat
If you're starting fresh
Use the v1 endpoints instead — they pick the behaviour from the URL so you don't have to remember which mode string to send:
- Two models side-by-side →
POST /api/v1/battle - Up to 8 models with voting →
POST /api/v1/fight - Single model (OpenAI-compatible) →
POST /api/v1/chat/completions
How it works
You tell the server which mode you want with a mode field in the request body.
Under the hood, each mode value maps 1:1 to one of the v1 endpoints:
Body mode | Same as the v1 endpoint |
|---|---|
"chat" | POST /api/v1/chat/completions |
"battle" | POST /api/v1/battle |
"fight" | POST /api/v1/fight |
Migrating to the new endpoints
No rush — both surfaces will keep working. When you do move over:
- Swap the URL.
/api/chat→/api/v1/battle,/api/v1/fight, or/api/v1/chat/completions, depending on what you were using. - Drop the
modefield from the request body — the new endpoint name already says which mode it is. - Everything else (headers, auth, the rest of the body, the response shape) stays exactly the same.
Full reference
The full request/response shape, SSE event list, and parameter reference are documented on the Chat API page. Everything described there applies to /api/chat too, just with the mode field added.