Documentation

Zrelay keys.
Native endpoints.

Each Zrelay key is for one provider and uses that provider's request structure. Claude, GPT, and Grok share api.zrelay.net, but their headers, paths, and JSON payloads differ. Pick a provider below.

Authentication

Your key, standard headers

The Zrelay key you receive starts with zr_live_ and is created for one provider. Use that provider's native request format; the required header depends on the wire format.

Anthropic wire
x-api-key: zr_live_…
+ anthropic-version: 2023-06-01
OpenAI wire
Authorization: Bearer zr_live_…
Base URL

One host, native paths

All traffic goes through api.zrelay.net. Zrelay routes by path to the right upstream, while each provider keeps its own wire format. A key works only with the provider it was created for.

Host
https://api.zrelay.net
Messages (Claude)
/v1/messages
Chat (GPT / Grok)
/v1/chat/completions
Responses (GPT)
/v1/responses
Usage (balance)
/v1/usage
AnthropicWire: Messages

Claude

Point any Anthropic SDK at Zrelay with the base URL below. The SDK appends /v1/messages for you. Application installation and configuration live in Setup.

Raw request

curl · /v1/messages
curl https://api.zrelay.net/v1/messages \
  -H "x-api-key: zr_live_..." \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-5",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Explain Zrelay in one line."}
    ]
  }'

Python · Anthropic SDK

main.py
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.zrelay.net",   # no /v1
    api_key="zr_live_...",
)

msg = client.messages.create(
    model="claude-opus-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text)
OpenAIWire: Responses / Chat

GPT

Use the OpenAI-compatible API with a base URL that includes /v1. GPT supports both responses and chat_completions. Codex installation and configuration live in Setup.

Chat Completions request

curl · /v1/chat/completions
curl https://api.zrelay.net/v1/chat/completions \
  -H "Authorization: Bearer zr_live_..." \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "messages": [
      {"role": "user", "content": "Explain Zrelay in one line."}
    ]
  }'

Responses API request

curl · /v1/responses
curl https://api.zrelay.net/v1/responses \
  -H "Authorization: Bearer zr_live_..." \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-5.6-terra",
    "input": "Refactor this function for readability."
  }'

Python · OpenAI SDK

main.py
from openai import OpenAI

client = OpenAI(
    base_url="https://api.zrelay.net/v1",  # include /v1
    api_key="zr_live_...",
)

resp = client.chat.completions.create(
    model="gpt-5.6-sol",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
xAIWire: Chat Completions

Grok

Grok exposes only the OpenAI-compatible Chat Completions format. Set the base URL with /v1 and select chat_completions as the backend.

Raw request

curl · /v1/chat/completions
curl https://api.zrelay.net/v1/chat/completions \
  -H "Authorization: Bearer zr_live_..." \
  -H "content-type: application/json" \
  -d '{
    "model": "grok-6",
    "messages": [
      {"role": "user", "content": "What just happened in the world?"}
    ]
  }'

Python · OpenAI SDK (Grok)

main.py
from openai import OpenAI

client = OpenAI(
    base_url="https://api.zrelay.net/v1",  # include /v1
    api_key="zr_live_...",
)

resp = client.chat.completions.create(
    model="grok-6",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
Account

Check your balance

Every key carries its own meter. One call to /v1/usage returns what you've spent, your quota, what's left, and the per-model breakdown — authenticated with the same key you send traffic with.

curl · /v1/usage
# your key must be exported first (see the Setup guide)
curl -s https://api.zrelay.net/v1/usage \
  -H "x-api-key: $ZRELAY_API_KEY" | python3 -m json.tool

No python3? Drop the pipe and it prints raw JSON.

The response carries your name, spent, spent_last_24h_usd, quota and remaining in USD, plus a per-model breakdown of requests, tokens, and cost. The 24-hour value is a rolling window and requests_last_24h gives its request count. A null quota means unlimited.

Check it in the browser →
Next steps

Ready to build?

Install the native CLI tools against your key, or jump straight to pricing and pick a tier.