API reference
Markdown ↗

Compatibility

Zrelay supports multiple API formats. Match your client, endpoint, key and selected model instead of mixing schemas.

API formats

FormatEndpointSDK base URL
Anthropic Messages/v1/messageshttps://api.zrelay.net
OpenAI Chat Completions/v1/chat/completionshttps://api.zrelay.net/v1
OpenAI Responses/v1/responseshttps://api.zrelay.net/v1

Claude Messages example

bash
curl https://api.zrelay.net/v1/messages \
  -H "x-api-key: $ZRELAY_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-opus-5","max_tokens":256,"messages":[{"role":"user","content":"Hello from Zrelay"}]}'

Anthropic Python SDK

python
import os
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.zrelay.net",
    api_key=os.environ["ZRELAY_API_KEY"],
)
message = client.messages.create(
    model="claude-opus-5",
    max_tokens=256,
    messages=[{"role": "user", "content": "Hello from Zrelay"}],
)
print(message.content[0].text)

Compatibility boundaries

Compatible request formats do not establish full feature parity, independently verified model provenance or support for every upstream feature. Check model-specific tools, images, reasoning, streaming and limits on the route you use.

Native Gemini

Enabled Prime routes include gemini-3.7-flash and gemini-3.1-pro at /v1beta/models/{model}:generateContent and :streamGenerateContent. Use server base https://api.zrelay.net with x-goog-api-key; query-string ?key= authentication is not accepted. Native Gemini bodies and events differ from OpenAI Chat Completions. Check the live catalog, exact model and key scope before use.

Questions about your integration? support@zrelay.net