An OpenAI-compatible API is an endpoint that accepts the same request and response format as OpenAI's API, so the official OpenAI SDK can call it after you change the base URL and the key. This article covers what OpenAI's own platform already controls, the point where a gateway starts to pay off, the exact code change, and what the same workload costs on six models.
Short answer
Stay on the OpenAI API directly if one team uses only OpenAI models and OpenAI's project limits cover your budget rules.
Add an OpenAI-compatible gateway when one of these happens:
- A second vendor arrives, for example Claude for coding or Gemini Flash for high-volume classification, and finance wants one bill and one set of limits.
- Several teams share one AI budget and each needs its own ceiling and model list across vendors.
- You want to compare models on your own prompts without wiring up three SDKs.
What OpenAI's platform already gives you
OpenAI has added most of the controls that used to justify a gateway for a single vendor:
- Projects to separate, for example, staging and production, with their own keys, rate limits and spend limits (production best practices).
- Two kinds of spend control. Spend alerts send a notification and traffic continues. Hard spend limits make affected requests return 429 (rate limits guide).
- A per-project "Model usage" setting that restricts which models a project can call (managing projects).
- Usage tiers that cap monthly spend until you have paid enough, from $100 a month at Tier 1 to $200,000 at Tier 5.
If all your traffic is OpenAI, use these first.
Where direct access stops
The limits above apply to OpenAI models only. The moment a team adds Claude, Anthropic's Console has its own workspaces, spend limits and keys (Anthropic workspaces). Add Gemini and there is a third console. In practice that means:
- Three sets of keys to issue and revoke when someone leaves.
- Three budgets that can't see each other, so "the support bot may spend $3,000 a month across all vendors" can't be enforced anywhere.
- Three invoices in different formats at month-end.
- Code split across the OpenAI, Anthropic and Google SDKs.
A gateway puts one set of keys, limits and logs in front of all of them.
The code change
With ATP Token, the OpenAI SDK stays. You change three values (OpenAI SDK guide, migrate from OpenAI):
from openai import OpenAI
# Before: client = OpenAI(api_key="sk-...")
client = OpenAI(base_url="https://api.atptoken.ai/v1", api_key="atp-...")
for model in ["gpt-5.4", "claude-sonnet-4-6", "gemini-3-5-flash"]:
r = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Classify this ticket: 'Refund not received after 10 days'"}],
max_tokens=200,
)
print(model, r.choices[0].message.content, r.usage.total_tokens)
What stays the same: the Chat Completions request body, the response body, streaming with stream=True (OpenAI SSE) and tool definitions.
What changes:
- Model ids come from
GET /v1/models(model discovery). OpenAI models keep familiar names such asgpt-5.4; others use ids likeclaude-sonnet-4-6ordeepseek-v4-flash. - A model that isn't on the project's allowed list returns 403 before it reaches any provider.
- When the project's credits run out, requests return 402 (errors).
- ATP's OpenAI-format surface is
/v1/chat/completions,/v1/modelsand/v1/files. If your code calls other OpenAI endpoints, check the API reference before moving those calls.
Teams that use the Anthropic or Google GenAI SDK don't need to switch to the OpenAI format: the same project key works with those SDKs at https://api.atptoken.ai (Anthropic SDK, Google GenAI SDK).
What one workload costs on six models
Take a classification service that handles 1 million requests a month, each with 1,000 input tokens and 300 output tokens. That is 1,000 million input tokens and 300 million output tokens. At the list rates on each model's page:
Price is half of the decision. Run a few hundred of your real tickets through the two or three cheapest models that pass your quality bar before you switch. The side-by-side pages for DeepSeek vs Claude and Gemini vs GPT are a starting point.
Migration checklist
- List every place your code creates an OpenAI client and which endpoints it calls.
- Create one ATP project per service and enable only the models that service needs (workspaces and projects).
- Allocate credits to each project; the allocation is the ceiling (budget caps).
- Issue one key per project and store it in your secret manager (managing keys).
- Change base URL, key and model id in staging. Compare outputs and token counts in Request logs (usage and logs).
- Move production one service at a time, then revoke the old OpenAI keys you no longer use.


