LiteRouter Docs

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.

EndpointFormatWorks withUse it for
POST /v1/chat/completionsOpenAIChat modelsThe default for chat frontends and OpenAI SDKs.
POST /v1/responsesOpenAI ResponsesModels with a compatible Responses routeThe newer OpenAI API, used by Codex.
POST /v1/messagesAnthropicClaude models onlyThe Anthropic-native API, used by Claude Code.
POST /v1beta/models/{model}:generateContentGeminiGemini models onlyThe 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.

bash
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.

bash
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.

bash
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.

bash
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.

bash
curl https://api.literouter.com/v1/models \
  -H "Authorization: Bearer $LITEROUTER_API_KEY"
ⓘ

To wire a specific tool to one of these, see Integrations.