API reference

ezrouter API reference

The ezrouter API exposes two parallel surfaces against the same set of upstream LLM providers. Choose whichever fits your existing client:

SurfaceBase URLAuth headerDrop-in for
OpenAI-compatiblehttps://www.ezrouter.dev/v1Authorization: Bearer ${API_KEY}OpenAI Python / Node SDK with base_url override
Anthropic-compatiblehttps://www.ezrouter.dev/anthropic/v1x-api-key: ${API_KEY}Anthropic SDK / Claude Code with base_url override

Both surfaces accept the same API key and route to the same model catalog. Some models support both surfaces simultaneously — see GET /v1/models for each model's supported_endpoint_types field. {#anthropic-messages}

Authentication

Get an API key from the ezrouter dashboard at https://www.ezrouter.dev/dashboard/#api-keys/. Keys are tied to your account and may be revoked individually.

The OpenAI surface uses standard bearer auth; the Anthropic surface uses Anthropic's x-api-key header convention. Otherwise the two surfaces are independent — a request to one does not consume rate budget on the other any differently.

Endpoints

OpenAI-compatible surface

MethodPathDescription
POST/v1/chat/completionsCreate chat completion — the primary inference endpoint
POST/v1/completionsLegacy completion — exposure status under verification
GET/v1/modelsList available models — gateway-global catalog
GET/v1/user/balanceGet user balance — endpoint specifics under verification

Anthropic-compatible surface

MethodPathDescription
POST/anthropic/v1/messagesAnthropic Messages API — preserves upstream Anthropic spec for claude models

The Anthropic surface is documented inline here as a routing pointer only; for the request / response schema, refer to Anthropic's official Messages API documentation and substitute the base URL above. ezrouter does not currently fork or extend the Anthropic spec.

Notable behaviors

Before integrating, read these gateway-wide behaviors that differ from typical OpenAI or Anthropic deployments. Full per-endpoint detail lives on each endpoint page.

  • The OpenAI surface always streams. Every response from

/v1/chat/completions is text/event-stream, regardless of whether stream: true was sent. See POST /v1/chat/completions → Differences from OpenAI.

  • Capacity is governed by fair use, not by published numbers. See

Rate limits.

  • Error envelope uses ezrouter-specific shapes. See

Error codes.

  • Tool-call extraction is reliable on claude-opus-4-7 via the OpenAI surface; for other models, prefer the Anthropic surface for agent applications. See

POST /v1/chat/completions → Tool calls.

Contact

PurposeContact
Support[email protected]
Terms of ServiceTerms of Service
Privacy PolicyPrivacy Policy