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.
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:
- 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.
- 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:
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. TheAuthorizationheader must hold thesk-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.
| Header | What it tags | Example |
|---|---|---|
X-Cost-Feature | Product feature | chatbot, search, reports |
X-Cost-Department | Business unit | engineering, cx, sales |
X-Cost-User | Your end user (internal ID) | user_abc123 |
X-Cost-Run-ID | One agent run | run-7f3a... |
X-Cost-GL-Account | GL account code | 5100-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:
- In Budgets → New Budget, set Scope to Feature, Tag Value to
quickstart-test, Monthly Limit to0.01and Enforcement Mode to Block Calls. Save, and give it about 15 seconds to reach the gateway. - Send a call tagged with that feature and a large
max_tokens:
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:
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:
| Goal | Do this | Plan |
|---|---|---|
| Stop overspend before it happens | Set a budget: alert, degrade or block | Every plan |
| Separate production from test spend | Send X-Cost-Environment and budget CI or eval separately | Every plan |
| Have a kill switch ready | Emergency Freeze in Settings → Safety & Limits | Every plan |
| Cap one agent run in dollars | Send X-Cost-Run-ID and X-Cost-Run-Budget (how) | Every plan |
| Hear about spikes in Slack | Connect a Slack channel | Base |
| Catch cost regressions in pull requests | Add the CI cost gate | Base |
| Ask about spend from your IDE | Connect the MCP server | Base |
| Spend less without code changes | Auto Router, routing rules, caching | Growth |
| Prove ROI to finance | Reports, chargeback, cost per outcome | Base / Growth |
How the gateway works
- 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.