Zrelay API documentation
Connect the tools you already use to Claude, GPT, Grok and more. Choose a model and pool, keep the native API format, and manage your keys from one account.
Start building
At a glance
| Setting | Zrelay |
|---|---|
| API host | https://api.zrelay.net |
| OpenAI SDK base URL | https://api.zrelay.net/v1 |
| Anthropic SDK base URL | https://api.zrelay.net |
| Authentication | Authorization: Bearer or x-api-key |
| Billing | Prepaid USD balance; charges depend on model, endpoint and pool |
| Account | Keys, spending controls and usage |
How Zrelay works
Zrelay authenticates your key and routes your request using its provider, selected pool and model. Flex and Prime keys serve one model family; each Xtra key serves the models in its selected pool.
All keys share your account balance. Pools have different rates and availability. Use the live catalog as the source for enabled routes and prices; a familiar model name alone does not guarantee access in every pool.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/chat/completions | OpenAI-compatible text and tool requests |
| POST | /v1/responses | GPT Responses requests |
| POST | /v1/messages | Anthropic-compatible Messages |
| POST | /v1/images/generations | Image generation on an enabled route |
| GET | /v1/models | Models accessible to your key |
| GET | /v1/usage | Shared account balance and usage |
| POST | /v1/requests | Paginated request history for your key |
Your first request
Create an account, save your account code, set up TOTP or a passkey, then create a key for an available provider and pool.
curl https://api.zrelay.net/v1/chat/completions \
-H "Authorization: Bearer $ZRELAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-6.1-sol","messages":[{"role":"user","content":"Hello from Zrelay"}],"max_tokens":256}'Follow the complete quickstart for key setup and response handling.
Authentication
Keep your zr_live_ key on your server. Use Bearer authentication for OpenAI-compatible requests and x-api-key for Messages. Read the authentication reference →
Claude
Use /v1/messages with an Anthropic-compatible client. Messages examples and compatibility →
GPT
Use /v1/responses or /v1/chat/completions when the route is listed for your pool. Responses reference →
Grok
Use /v1/chat/completions with an enabled Grok model from the catalog and a matching key. Chat Completions reference →
Images
Image routes have their own request prices and pool availability. Generate images →
Streaming
Receive incremental output using the event format of your chosen endpoint. Streaming guide →
Errors
Check HTTP status, the error body and the x-zrelay-request-id response header. Error reference →
Balance and usage
Read your account balance with GET /v1/usage. Balance and billing reference →
Request history
Use POST /v1/requests for your key’s request history, or open Usage in your account portal. Request history and pagination →
Questions about your integration? support@zrelay.net