Skip to Content
GatewayAI Gateway

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_xxx

You still send normal provider payloads. The gateway preserves standard JSON responses and streaming SSE behavior.

What the gateway adds

LayerWhat it does
GovernanceApplies rate limits, budget controls, model access checks, PII scanning, content safety, and HITL approval gates
RoutingResolves model aliases, matches the correct provider, and supports provider-scoped base URLs
ObservabilityAdds request IDs, spend headers, retry metadata, usage logs, and health visibility
ResilienceRetries transient upstream failures, exposes idempotency keys, and protects against provider outages
OperationsSupports stored provider secrets, admin APIs, usage dashboards, approval queues, and runner-aware cost controls

Endpoint patterns

PatternExampleBest for
Provider-namespaced base URLhttps://api.curate-me.ai/v1/openaiOpenAI-compatible SDKs
Anthropic base URLhttps://api.curate-me.ai/v1/anthropicAnthropic SDKs
Generic OpenAI-compatible endpointPOST /v1/chat/completionsDirect HTTP or custom clients
Generic Anthropic endpointPOST /v1/messagesDirect HTTP or Anthropic-style payloads
Model discoveryGET /v1/modelsListing routable models through the gateway

Supported providers

51 providers across 7 tiers:

Provider tierBuilt-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:

CredentialPurpose
X-CM-API-KeyAuthenticates 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

HeaderMeaning
X-CM-Request-IDGateway request ID for tracing, support, and log lookup
X-CM-CostEstimated request cost in USD
X-CM-Daily-CostCurrent daily spend for the org
X-CM-Daily-BudgetActive daily budget used for governance decisions
X-RateLimit-LimitRequests allowed in the current rate-limit window
X-RateLimit-RemainingRequests left in the window
X-RateLimit-ResetUnix timestamp when the window resets
X-Idempotency-KeyStable key used for retry-safe upstream execution
X-Process-TimeGateway 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 8002

Then point your SDK at http://localhost:8002/v1/openai, http://localhost:8002/v1/anthropic, or another provider path.