API Reference
AgentRouter API endpoint reference documentation
AgentRouter provides a unified API gateway compatible with multiple mainstream LLM providers.
Authentication
All API requests require authentication using an API key. You can provide your API key in one of two ways:
Authorization Header
Authorization: Bearer sk-ar-your-api-keyx-api-key Header
x-api-key: sk-ar-your-api-keyAvailable Endpoints
AgentRouter supports two main API formats:
- OpenAI-Compatible API - Supports OpenAI, DeepSeek, Moonshot, and other providers
- Anthropic-Compatible API - Supports Anthropic, AWS Bedrock, and other providers
- Search - High-authority web search proxy with fixed per-call billing (see details)
Error Handling
The API returns standard HTTP status codes with error messages:
400- Bad Request - Invalid request parameters401- Unauthorized - Authentication failed402- Payment Required - Insufficient balance500- Internal Server Error
Error response formats vary depending on the API type (OpenAI or Anthropic) being used.