Skip to Content
GatewayAI Gateway Overview

AI Gateway Overview

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.

How it works

# 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

The gateway accepts provider-native payloads, runs them through policy and routing, then proxies the request upstream. Responses stay compatible with the SDK you already use, including streaming.

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

Provider familyBuilt-in providers
CoreOpenAI, Anthropic, Google, DeepSeek, Perplexity
OpenClaw favoritesMoonshot, MiniMax, ZAI, Cerebras, Qwen
Developer staplesGroq, Mistral, xAI, Together, Fireworks, Cohere, OpenRouter

Authentication

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

Stored provider secrets are supported when you do not want provider keys living in application code.

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 start

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": "Explain what the gateway does."}], )

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.