Endpoints
LiteRouter currently offers text and image models. Choose a chat endpoint that matches your model and app, or use the separate image-generation API.
Send requests with your LiteRouter key using the same authentication and base URL https://api.literouter.com/v1 (the Gemini-native API uses /v1beta). The read-only GET /v1/models lists the public catalog; it does not filter models by your plan.
| Endpoint | Format | Works with | Use it for |
|---|---|---|---|
POST /v1/chat/completions | OpenAI | Chat models | The default for chat frontends and OpenAI SDKs. |
POST /v1/responses | OpenAI Responses | Models with a compatible Responses route | The newer OpenAI API, used by Codex. |
POST /v1/messages | Anthropic | Claude models only | The Anthropic-native API, used by Claude Code. |
POST /v1beta/models/{model}:generateContent | Gemini | Gemini models only | The Google Gemini-native API. |
For chat, start with /v1/chat/completions. Check the model's detail page in Models for endpoint compatibility. An unknown compatibility result means it has not been confirmed.
The default chat endpoint returns the standard OpenAI shape. This is what most chat frontends and the OpenAI SDKs use. See Making Requests for the full request and response shape.
curl https://api.literouter.com/v1/chat/completions \
-H "Authorization: Bearer $LITEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2",
"messages": [{ "role": "user", "content": "Hello!" }]
}'
OpenAI's newer Responses API, used by Codex. Send your prompt as input and replace YOUR_RESPONSES_MODEL below with a model ID that supports this endpoint. Availability depends on the model's current route. If LiteRouter returns 400 saying the model is not available on /v1/responses, use /v1/chat/completions or choose a compatible model.
curl https://api.literouter.com/v1/responses \
-H "Authorization: Bearer $LITEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_RESPONSES_MODEL",
"input": "Hello!"
}'
The Anthropic-native API, used by Claude Code and the Anthropic SDKs. It only accepts Claude models; sending any other model returns a 400.
curl https://api.literouter.com/v1/messages \
-H "Authorization: Bearer $LITEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4.6:metered",
"max_tokens": 1024,
"messages": [{ "role": "user", "content": "Hello!" }]
}'
The Google Gemini-native generateContent API. It only accepts Gemini models, and it uses the /v1beta path with the model in the URL.
curl https://api.literouter.com/v1beta/models/gemini-3-flash-preview:generateContent \
-H "Authorization: Bearer $LITEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{ "parts": [{ "text": "Hello!" }] }]
}'
Image generation
Image models have their own host: POST https://image.literouter.com/v1/images/generations in the OpenAI format (base64 JSON, for apps and SDKs), or POST https://image.literouter.com/generate for the image file itself. See Image Generation for the request format and Models for the current catalog.
List models (OpenAI)
A public, read-only endpoint in the OpenAI /models shape. Each model includes minimum_tier, model_cost, and modality. Being listed does not guarantee access on your plan or support for every endpoint. Browse the same catalog in the Models section.
curl https://api.literouter.com/v1/models \
-H "Authorization: Bearer $LITEROUTER_API_KEY"
To wire a specific tool to one of these, see Integrations.