Skip to main content
All /v1/* endpoints require authentication. ARouter supports four methods: three API-key-based methods for every major LLM SDK, plus wallet-based authentication for AI agents with crypto wallets.

Auth Methods

Used by the OpenAI SDK, DeepSeek SDK, Mistral SDK, and most OpenAI-compatible clients.
Authorization: Bearer lr_live_xxxx
from openai import OpenAI

client = OpenAI(
    base_url="https://api.arouter.ai/v1",
    api_key="lr_live_xxxx",  # sent as Bearer token
)
The first three methods use the same ARouter API key. The gateway automatically detects which method is being used. Wallet users follow a separate path: SIWx/x402 produce a wallet JWT, and subsequent requests use Authorization: Bearer <jwt>.

Key Types

Key TypeFormatDescription
Management Keylr_mgmt_xxxxCreate and manage API keys via the management API.
API Keylr_live_xxxxMake LLM requests. Can have provider/model restrictions and spending limits.
Management keys create API keys that can only narrow permissions — never expand beyond the tenant’s scope. See the Key Management Guide for details.

Error Responses

When authentication fails, you’ll receive one of these responses:
// Missing or malformed key
{
  "error": {
    "message": "missing or invalid Authorization header",
    "type": "authentication_error"
  }
}
// Invalid key
{
  "error": {
    "message": "invalid api key",
    "type": "authentication_error"
  }
}
Both return HTTP 401 Unauthorized.