API Documentation
ChatX Router is fully compatible with OpenAI, Anthropic, and LiteLLM APIs. Change your base URL and start routing.
Quick Start
Point your existing OpenAI SDK to ChatX Router:
import OpenAI from "openai";const client = new OpenAI({apiKey: "YOUR_API_KEY",baseURL: "https://router.yourdomain.com",});const response = await client.chat.completions.create({model: "anthropic/claude-haiku-4-5",messages: [{ role: "user", content: "Hello!" }],max_tokens: 1024,});console.log(response.choices[0].message.content);
Authentication
All requests require an API key sent via the Authorization header.
Authorization: Bearer YOUR_API_KEY
Generate API keys from the Dashboard under Clients.
OpenAI Endpoints
POST
/chat/completionsChat Completions
Generate text responses from AI models
POST
/responsesResponses API
OpenAI Responses API (stateless)
POST
/embeddingsEmbeddings
Generate vector embeddings for text
GET
/modelsList Models
List all available models