AI Gateway
The Curate-Me AI Gateway is the control plane between your application and LLM providers. You keep your existing SDK, swap the base URL, add a Curate-Me key, and every request gets governance, routing, cost tracking, and auditability before it reaches the model.
What changes in your app
# Before
OPENAI_BASE_URL=https://api.openai.com/v1
# After
OPENAI_BASE_URL=https://api.curate-me.ai/v1/openai
X-CM-API-Key: cm_sk_xxxYou still send normal provider payloads. The gateway preserves standard JSON responses and streaming SSE behavior.
What the gateway adds
| Layer | What it does |
|---|---|
| Governance | Applies rate limits, budget controls, model access checks, PII scanning, content safety, and HITL approval gates |
| Routing | Resolves model aliases, matches the correct provider, and supports provider-scoped base URLs |
| Observability | Adds request IDs, spend headers, retry metadata, usage logs, and health visibility |
| Resilience | Retries transient upstream failures, exposes idempotency keys, and protects against provider outages |
| Operations | Supports stored provider secrets, admin APIs, usage dashboards, approval queues, and runner-aware cost controls |
Endpoint patterns
| Pattern | Example | Best for |
|---|---|---|
| Provider-namespaced base URL | https://api.curate-me.ai/v1/openai | OpenAI-compatible SDKs |
| Anthropic base URL | https://api.curate-me.ai/v1/anthropic | Anthropic SDKs |
| Generic OpenAI-compatible endpoint | POST /v1/chat/completions | Direct HTTP or custom clients |
| Generic Anthropic endpoint | POST /v1/messages | Direct HTTP or Anthropic-style payloads |
| Model discovery | GET /v1/models | Listing routable models through the gateway |
Supported providers
51 providers across 7 tiers:
| Provider tier | Built-in providers |
|---|---|
| Core (Tier 1) | OpenAI, Anthropic, Google, DeepSeek, Perplexity |
| OpenClaw favorites (Tier 2) | Moonshot, MiniMax, ZAI, Cerebras, Qwen |
| Developer staples (Tier 3) | Groq, Mistral, xAI, Together, Fireworks, Cohere, OpenRouter |
| Extended (Tiers 4-7) | AI21, Azure OpenAI, AWS Bedrock, Hugging Face, Replicate, Ollama, and 28 more |
See the full list on the Providers & Routing page.
Authentication
Every proxy request needs:
| Credential | Purpose |
|---|---|
X-CM-API-Key | Authenticates your request to Curate-Me |
X-Provider-Key or Authorization: Bearer <provider-key> | Authenticates the upstream call to the model provider |
You can also store provider credentials through the admin APIs or dashboard provider secrets flow and stop sending X-Provider-Key on each request.
Common response headers
| Header | Meaning |
|---|---|
X-CM-Request-ID | Gateway request ID for tracing, support, and log lookup |
X-CM-Cost | Estimated request cost in USD |
X-CM-Daily-Cost | Current daily spend for the org |
X-CM-Daily-Budget | Active daily budget used for governance decisions |
X-RateLimit-Limit | Requests allowed in the current rate-limit window |
X-RateLimit-Remaining | Requests left in the window |
X-RateLimit-Reset | Unix timestamp when the window resets |
X-Idempotency-Key | Stable key used for retry-safe upstream execution |
X-Process-Time | Gateway processing time in seconds |
Quick examples
OpenAI SDK
from openai import OpenAI
client = OpenAI(
base_url="https://api.curate-me.ai/v1/openai",
api_key="sk-your-openai-key",
default_headers={"X-CM-API-Key": "cm_sk_xxx"},
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}],
)Anthropic SDK
import anthropic
client = anthropic.Anthropic(
base_url="https://api.curate-me.ai/v1/anthropic",
api_key="sk-ant-your-key",
default_headers={"X-CM-API-Key": "cm_sk_xxx"},
)
message = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)cURL
curl https://api.curate-me.ai/v1/openai/chat/completions \
-H "Content-Type: application/json" \
-H "X-CM-API-Key: cm_sk_xxx" \
-H "X-Provider-Key: $OPENAI_API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello"}]
}'Local development
cd services/backend
poetry install
poetry run uvicorn src.main_gateway:app --reload --port 8002Then point your SDK at http://localhost:8002/v1/openai, http://localhost:8002/v1/anthropic, or another provider path.