Skip to content
Zenith / Docs
Enterprise Gateway
OpenAI compatible

Gateway · OpenAI SDK

Point the official OpenAI SDK at your Gateway origin + /v1. The model field is a pool alias, not a vendor model id.

Enter the hostname your application uses to reach Zenith Gateway. Every Enterprise example below updates instantly.

Hostname only, or paste a full URL. Saved in this browser.
base_url https://your-domain.demo/v1
api_key gateway key
model YOUR_POOL

First request

Choose your language. Set the model to a Gateway pool alias such as YOUR_POOL — not a vendor model id.

chat.py
from openai import OpenAI
client = OpenAI(base_url="https://your-domain.demo/v1", api_key="YOUR_GATEWAY_KEY")
print(client.models.list())
print(client.chat.completions.create(
    model="YOUR_POOL",
    messages=[{"role": "user", "content": "ping"}],
))

MCP authorize (control plane only)

Allowlist + audit. Zenith does not execute MCP tools on the gateway. The JSON body field is name (not tool).

mcp-authorize.sh
curl -fsS -H "Authorization: Bearer $ZENITH_API_KEY" "$ZENITH_GATEWAY_URL/v1/mcp/tools"
curl -sS -H "Authorization: Bearer $ZENITH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"d1_search"}' "$ZENITH_GATEWAY_URL/v1/mcp/authorize"

Optional routing headers

  • X-Zenith-Route-Key — sticky/route hint
  • X-Zenith-Semantic-Route: 1 — enable semantic routing when configured
  • X-Zenith-Cache: exact — request exact cache behavior when enabled