Skip to Content
GuidesGateway Quickstart

Gateway Quickstart

Get your first governed LLM request flowing in under 5 minutes. No code changes to your existing application — just swap a base URL.

Prerequisites

  • A Curate-Me account (dashboard.curate-me.ai/signup )
  • Your gateway API key (cm_sk_...) from the dashboard welcome page
  • An existing LLM provider key (OpenAI, Anthropic, Google, etc.) — or store one in the gateway

Step 1: Install the SDK

Choose your language:

Python

pip install curate-me

TypeScript / Node.js

npm install @curate-me/sdk

No SDK needed

If you already use the OpenAI or Anthropic SDK, you do not need to install anything new. Just change the base URL (see Step 2).

Step 2: Point your LLM SDK at the gateway

The gateway is an OpenAI-compatible reverse proxy. Any SDK that supports a custom base_url works out of the box.

OpenAI Python SDK

from openai import OpenAI client = OpenAI( api_key="sk-your-openai-key", base_url="https://api.curate-me.ai/v1", default_headers={"X-CM-API-Key": "cm_sk_your_key"}, )

OpenAI Node.js SDK

import OpenAI from 'openai'; const client = new OpenAI({ apiKey: 'sk-your-openai-key', baseURL: 'https://api.curate-me.ai/v1', defaultHeaders: { 'X-CM-API-Key': 'cm_sk_your_key' }, });

Anthropic Python SDK

from anthropic import Anthropic client = Anthropic( api_key="sk-ant-your-key", base_url="https://api.curate-me.ai/v1", default_headers={"X-CM-API-Key": "cm_sk_your_key"}, )

The SDK wraps this configuration for you and adds admin methods for policy and cost management.

Python:

from curate_me.gateway import CurateGateway gw = CurateGateway(api_key="cm_sk_your_key") # Get an OpenAI client pointed at the gateway client = gw.openai(provider_key="sk-your-openai-key") # Or use a stored secret (no provider key needed) client = gw.openai()

TypeScript:

import { CurateGateway } from '@curate-me/sdk'; const gw = new CurateGateway('cm_sk_your_key'); // Get an OpenAI client pointed at the gateway const client = await gw.openai('sk-your-openai-key'); // Or use a stored secret const client = await gw.openai();

Environment variable approach (zero code changes)

If your application reads OPENAI_BASE_URL from the environment, you can route through the gateway without touching any code:

export OPENAI_BASE_URL=https://api.curate-me.ai/v1 export OPENAI_API_KEY=sk-your-openai-key

Then add the gateway key as a default header in your SDK initialization, or store your provider key in the gateway and use your cm_sk_... key as the API key directly.

Step 3: Make your first request

curl

curl https://api.curate-me.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "X-CM-API-Key: cm_sk_your_key" \ -H "Authorization: Bearer sk-your-openai-key" \ -d '{ "model": "gpt-4o", "messages": [{"role": "user", "content": "Hello from Curate-Me!"}] }'

Python

from curate_me.gateway import CurateGateway gw = CurateGateway(api_key="cm_sk_your_key") client = gw.openai(provider_key="sk-your-openai-key") response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello from Curate-Me!"}], ) print(response.choices[0].message.content)

TypeScript

import { CurateGateway } from '@curate-me/sdk'; const gw = new CurateGateway('cm_sk_your_key'); const client = await gw.openai('sk-your-openai-key'); const response = await client.chat.completions.create({ model: 'gpt-4o', messages: [{ role: 'user', content: 'Hello from Curate-Me!' }], }); console.log(response.choices[0].message.content);

Streaming

Streaming works identically — the gateway passes SSE chunks through transparently:

stream = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Tell me a joke"}], stream=True, ) for chunk in stream: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="")

Step 4: View costs in the dashboard

After your first request, open dashboard.curate-me.ai  and navigate to Gateway > Cost Tracking.

You will see:

  • Real-time cost per request — model, tokens, cost in USD
  • Daily spend — cumulative cost with budget gauge
  • Per-model breakdown — which models are consuming your budget
  • Per-key attribution — which API keys are generating cost

The gateway also returns cost metadata in response headers:

HeaderDescription
X-CM-CostEstimated cost for this request (USD)
X-CM-Daily-CostCumulative daily spend (USD)
X-CM-Daily-BudgetDaily budget limit (USD)
X-CM-Request-IDUnique request identifier for tracing
X-CM-Governance-Time-MsTime spent in governance checks (ms)

Step 5: Configure governance

From the dashboard (Gateway > Policies), you can configure:

Rate limiting

Set requests per minute per organization:

curl -X PUT https://api.curate-me.ai/gateway/admin/policies/org_abc123 \ -H "X-CM-API-Key: cm_sk_your_key" \ -H "Content-Type: application/json" \ -d '{"rpm_limit": 100}'

Budget caps

Set daily and monthly spend limits:

curl -X PUT https://api.curate-me.ai/gateway/admin/policies/org_abc123 \ -H "X-CM-API-Key: cm_sk_your_key" \ -H "Content-Type: application/json" \ -d '{ "daily_budget": 50.00, "monthly_budget": 1000.00, "max_cost_per_request": 2.00 }'

PII scanning

PII scanning is enabled by default. It checks for API keys, secrets, SSNs, credit card numbers, email addresses, and more before your request reaches the provider:

curl -X PUT https://api.curate-me.ai/gateway/admin/policies/org_abc123 \ -H "X-CM-API-Key: cm_sk_your_key" \ -H "Content-Type: application/json" \ -d '{ "pii_scan_enabled": true, "pii_action": "block" }'

Model allowlists

Restrict which models your team can use:

curl -X PUT https://api.curate-me.ai/gateway/admin/policies/org_abc123 \ -H "X-CM-API-Key: cm_sk_your_key" \ -H "Content-Type: application/json" \ -d '{ "allowed_models": ["gpt-4o-mini", "claude-haiku-3-5-20241022", "gemini-2.5-flash"] }'

HITL approvals

Require human approval for expensive requests:

curl -X PUT https://api.curate-me.ai/gateway/admin/policies/org_abc123 \ -H "X-CM-API-Key: cm_sk_your_key" \ -H "Content-Type: application/json" \ -d '{"hitl_cost_threshold": 5.00}'

What happens behind the scenes

Every request through the gateway passes through a 7-step governance chain before reaching the upstream provider:

Your App --> Gateway --> [Plan] --> [Rate Limit] --> [Cost] --> [PII] --> [Model] --> [HITL] --> Provider

The chain short-circuits on the first denial. If rate limiting blocks a request, cost estimation never runs. If cost governance blocks, the provider never sees the request.

After the provider responds, the gateway records the actual cost (based on real token counts) to Redis (real-time accumulation) and MongoDB (audit trail).

Next steps