Migrate from OpenAI
Anoman is a drop-in replacement for OpenAI's API. Change base_url + api_key. Keep all your code. Get guardrails, observability, and multi-provider routing for free.
Before vs after
Python — before & after
TypeScript — before & after
Env var — fastest path
That's it. The OpenAI SDK doesn't care which server it's talking to — it just wants base_url + api_key. Streaming, tools, vision, batching, function calling — all unchanged.
What stays the same
- Every OpenAI SDK method works unchanged —
chat.completions.create,embeddings.create,models.list, etc. - Streaming via
stream=True— identical SSE shape. - Tool / function calling — identical request shape, identical response.
- Vision (image inputs) — identical multimodal message format.
- JSON mode —
response_format={"type": "json_object"}works as-is. - Async clients (
AsyncOpenAI) — fully supported. - Error handling — same exception classes (
openai.RateLimitError,APIStatusError, etc.).
No code changes required
- Guardrails on every request — prompt injection detection, PII masking, content moderation. See the pipeline.
- Full observability — every request shows up in the dashboard Traces view with timing, cost, region.
- Cost capture per request —
_anoman.cost_usdon every response. - Caching for free — Anthropic / OpenAI / Google prompt caching is auto-injected for long system prompts. See caching.
- Multi-provider failover — when OpenAI is down, your
model: gpt-4ocall doesn't break (configurable per key). - Rate-limit headers — see your usage in real time per request.
Hundreds of models, one client
Once your code is pointed at Anoman, you can call any model in our catalog by changing the model parameter. No new client, no new key.
Production rollout
- Create an Anoman API key in the dashboard. Add an env var for it.
- Point a small slice of traffic at Anoman first (e.g. a feature flag for 5% of users). Verify guardrails don't block legitimate prompts in your domain.
- Tune the policy group in Guardrails settings — PII mode, injection threshold — to match your acceptable false-positive rate.
- Cut over the rest of your traffic.
- Set a per-key monthly USD budget so a runaway script hits 402 instead of draining your account.
- Decommission your direct OpenAI key (or keep it for emergency fallback).
Try it now — free API key.
Two lines to change. Five minutes to integrate.