Quickstart: route OpenAI, Claude and Gemini calls through one LLM gateway in 2 minutes

Put an OpenAI-compatible LLM gateway in front of OpenAI, Anthropic, Gemini, Azure, Bedrock and more by changing base_url. Every call attributed and costed instantly, with budgets enforced before the call.

In the app: Setup · every planOpen in app →No account? Start free

Point your existing OpenAI, Anthropic or other SDK at Cognocient AI by changing the base URL and key. Every call is then costed and attributed, and budgets are enforced before the call reaches the provider. No new SDK, no rewrite.

Other ways in

Want to look before touching code? Import a usage CSV for historical dashboards, or try the Python async wrapper (live attribution, no pre-call enforcement). Not a developer? See the CFO setup guide.

Step 1 — Create an account and a proxy key

Go to cognocient.com and click Start your 10-day free trial (every feature, no credit card) or Sign in, with Google, Microsoft or an emailed magic link. The in-app setup asks you to:

  1. Connect a provider — the one your app already uses: a direct API (OpenAI, Anthropic, Gemini, Mistral, Groq, Together), a cloud platform (Azure OpenAI, AWS Bedrock, Vertex AI) or your own OpenAI-compatible server. Your key is encrypted at rest and never shown again.
  2. Create a proxy key — it starts with sk-cog-. This is the only key your application will hold.

Without the trial, new accounts start on the Free plan: one provider connection, no credit card, no expiry.

Step 2 — Point your app at the gateway

Pick whichever is least work for you.

Option A: environment variables (no code change)

The official OpenAI SDKs read these, and so do most tools built on them:

export OPENAI_BASE_URL="https://api.cognocient.com/v1"
export OPENAI_API_KEY="sk-cog-YOUR-PROXY-KEY"

For the native Anthropic SDK and Claude Code, the equivalents are ANTHROPIC_BASE_URL="https://api.cognocient.com" (no /v1) and ANTHROPIC_API_KEY="sk-cog-YOUR-PROXY-KEY".

Option B: change the client

Everything else in your code stays the same. With the OpenAI SDK, the model name picks the provider: gpt-... goes to OpenAI, claude-... to Anthropic, gemini-... to Gemini, anthropic.claude-... to Bedrock, vertex/gemini-... to Vertex AI, custom/<model> to your own server. One client reaches every provider you connect.

Using a framework? Follow its page instead: LangChain, LangGraph, LlamaIndex, CrewAI, Vercel AI SDK, OpenAI Agents SDK, Pydantic AI. Provider specifics (Azure deployments, Bedrock IDs, Vertex AI, Ollama) are under Providers.

Step 3 — Make a test call

Use a model from the provider you connected in Step 1. The examples use gpt-4o-mini; swap in claude-haiku-4-5, gemini-2.5-flash or another model your provider serves.

You get the provider's normal response back. Within a few seconds the call appears in Monitor → Live Calls with its model, tokens, latency and cost, and the onboarding page ticks over.

Something went wrong?

  • No API key configured — no provider is connected yet. Connect one from the yellow banner on the onboarding page or in Settings → AI Providers.
  • Model not found from the provider — the model name routed to a provider you haven't connected, or isn't one it serves. Check the routing table in Providers.
  • 401 — the request still carries your old provider key. The Authorization header must hold the sk-cog- key.
  • Onboarding stuck on "Waiting for your first API call" — run the snippet in a terminal, not the browser console.

More in Troubleshooting and the error reference.

Step 4 — Tag calls by feature and team

Two headers turn one monthly total into per-feature and per-team spend. Set them once on the client and every call is tagged:

For values that change per request, pass them on the call instead (extra_headers={...} in Python, a second { headers: {...} } argument in Node.js). Untagged calls still appear, under untagged.

HeaderWhat it tagsExample
X-Cost-FeatureProduct featurechatbot, search, reports
X-Cost-DepartmentBusiness unitengineering, cx, sales
X-Cost-UserYour end user (internal ID)user_abc123
X-Cost-Run-IDOne agent runrun-7f3a...
X-Cost-GL-AccountGL account code5100-software

The full list is in Attribution headers.

Step 5 — See a budget stop a call

This is the part a logging proxy can't do: refuse a call before the provider bills you. Try it on a throwaway feature name:

  1. In Budgets → New Budget, set Scope to Feature, Tag Value to quickstart-test, Monthly Limit to 0.01 and Enforcement Mode to Block Calls. Save, and give it about 15 seconds to reach the gateway.
  2. Send a call tagged with that feature and a large max_tokens:
curl -i https://api.cognocient.com/v1/chat/completions \
  -H "Authorization: Bearer sk-cog-YOUR-PROXY-KEY" \
  -H "Content-Type: application/json" \
  -H "X-Cost-Feature: quickstart-test" \
  -d '{"model": "gpt-4o", "max_tokens": 4000, "messages": [{"role": "user", "content": "Write a long story"}]}'

The worst case for that call (4,000 output tokens on gpt-4o) costs more than the budget's $0.01, so the gateway answers straight away, without calling the provider:

HTTP/1.1 429 Too Many Requests

{"error": {"message": "...", "type": "budget_error"}}

Your code can catch that 429 like a rate limit. In production you would usually pick Degrade (switch to a cheaper model and keep serving) or Alert instead, and stack budgets per feature, team and agent run. Delete the test budget when you're done: the Free plan allows one budget, so it would otherwise use up your only one. See Budget enforcement for how reservations, streaming and concurrent calls are counted.

Use a model your provider serves. With Anthropic only, for example, send claude-sonnet-4-6 with "max_tokens": 4000; any call whose worst case exceeds $0.01 is refused the same way.

What to turn on next

After your first call, the Get set up checklist on the Overview ticks itself off as you go:

GoalDo thisPlan
Stop overspend before it happensSet a budget: alert, degrade or blockEvery plan
Separate production from test spendSend X-Cost-Environment and budget CI or eval separatelyEvery plan
Have a kill switch readyEmergency Freeze in Settings → Safety & LimitsEvery plan
Cap one agent run in dollarsSend X-Cost-Run-ID and X-Cost-Run-Budget (how)Every plan
Hear about spikes in SlackConnect a Slack channelBase
Catch cost regressions in pull requestsAdd the CI cost gateBase
Ask about spend from your IDEConnect the MCP serverBase
Spend less without code changesAuto Router, routing rules, cachingGrowth
Prove ROI to financeReports, chargeback, cost per outcomeBase / Growth

How the gateway works

Your app ── POST /v1/chat/completions ──►  Cognocient AI  ──►  OpenAI / Anthropic / Gemini / Azure /
            Authorization: sk-cog-...      1. auth + tags        Bedrock / Vertex AI / Mistral / Groq /
            X-Cost-Feature: chatbot        2. budget reserved    Together / your own server
                                           3. guardrails, routing     │
         ◄──────── provider response ◄──── 4. cost settled ◄──────────┘
  • Your provider keys stay server-side. The app holds only a revocable sk-cog- key; provider keys are encrypted at rest.
  • Metadata, not content. Model, tokens, cost, latency and your tags are logged. Prompt text is never stored (only a hash, used as a cache key).
  • Requests pass through as sent, except where the gateway has to change them (a usage option on streamed calls so cost is exact, translation for Claude calls through the OpenAI SDK) or where you've turned something on (a Degrade budget, routing rules, guardrails).
  • Added latency is a few milliseconds at the median at low concurrency in our published benchmark, which also shows how it grows under heavy concurrent load on one instance.

Frequently asked questions