# Compatibility

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

Source: https://zrelay.net/docs/api/compatibility/

## API formats

| Format | Endpoint | SDK base URL |
| --- | --- | --- |
| Anthropic Messages | `/v1/messages` | `https://api.zrelay.net` |
| OpenAI Chat Completions | `/v1/chat/completions` | `https://api.zrelay.net/v1` |
| OpenAI Responses | `/v1/responses` | `https://api.zrelay.net/v1` |

## Claude Messages example

```
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

```
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.

Examples demonstrate request formats. Select an enabled model, endpoint and pool from the [live catalog](https://zrelay.net/prices.html#per-model) before sending a request. Availability and rates can change.

## 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.
