Migrate from OpenAI
Move your OpenAI SDK code to OneProvider with a three-line change: new base_url and key. What stays the same, what differs and how to test the switch.
Three lines of diff. Your existing OpenAI SDK keeps working.
All models, capabilities, and prices Documentation index for AI agents:https://oneprovider.dev/docs/llms.txt Before you start: a key from your cabinet Open your cabinet: the Telegram bot @oneprovider_robot (Account) or app.oneprovider.dev . Press “Issue a key”, give it a name (for example, this client) and a spend limit, and copy the key. You top up the balance in the same place. More about the cabinet and keys . The patch
diff- client = OpenAI()
+ client = OpenAI(
+ api_key=os.environ["ONEPROVIDER_KEY"],
+ base_url="https://api.oneprovider.dev/v1",
+ ) Choose by workload
We do not claim a made-up one-to-one equivalence between vendor model names. Choose the current GPT tier by quality, cost, and latency requirements:
| Workload | Use | Why |
|---|---|---|
| Complex agents and maximum reasoning | gpt-6.1-sol | Frontier tier for the most demanding work. |
| Default production workload | gpt-5.6-terra | Balanced quality and cost for everyday use. |
| High-volume processing and fast drafts | gpt-5.6-luna | Lowest-cost tier for throughput-heavy work. |
What works without changes
chat.completions.createwithmessages,temperature,max_tokens,stream.- Function-calling via
tools;tool_choice: "auto". - JSON mode (
response_format: {"type": "json_object"}). - Streaming via async iterators on both Python and Node.
What changes
seedandlogprobsare silently ignored.- Returned IDs are prefixed
chatcmpl-op-instead ofchatcmpl-. - Legacy
function_callshape is mapped to Anthropictool_useinternally; the response surface is unchanged.
Using OpenAI’s Codex CLI
If you use OpenAI’s Codex CLI, point it at our Responses API endpoint and reuse the same key. Full setup is on the Codex client page — TL;DR: ~/.codex/auth.json for the key, ~/.codex/config.toml with base_url = "https://api.oneprovider.dev/v1" and wire_api = "responses".
Post-migration check
pythonresponse = client.chat.completions.create(
model="gpt-5.6-terra",
messages=[{"role": "user", "content": "Reply with: migration works"}],
)
print(response.choices[0].message.content) Switching from OpenRouter or another gateway
What changes in my client?
Three settings: base URL, key and model id. OpenAI SDKs and OpenAI-compatible tools use https://api.oneprovider.dev/v1; Claude Code and Anthropic SDKs use https://api.oneprovider.dev. One OneProvider key works behind both.
How do model ids differ?
OneProvider ids have no vendor prefix, for example claude-sonnet-5-5 or gpt-5.6-terra. Copy them from the models page : an unknown id returns a 400 that names the problem.
What does OneProvider add?
Anthropic-native and OpenAI-compatible endpoints under one key, a prepaid balance that does not expire and has no subscription, top-ups by crypto, cards, Apple Pay, Google Pay or SBP, a spend limit and expiry per key, and a usage log of every request. By policy prompt text is not stored; servers are in Frankfurt.
How do I compare the cost?
Compare the same model: rates per million tokens, including cache rates, are on the pricing page . Then run a real task and read the charge in your Usage log.
Quick answers
Which base URL do I use?
Claude Code and Anthropic SDKs use https://api.oneprovider.dev. OpenAI SDKs and OpenAI-compatible clients use https://api.oneprovider.dev/v1. One key works behind both; the model list is on the models page ; rates are on the pricing page .
How do I authenticate?
Send the raw sk-… key in x-api-key or Authorization: Bearer: one of them, never both. Keep the key in an environment variable, not in a file that gets committed. More on authentication .
Where do I get a key?
Open your cabinet in the Telegram bot @oneprovider_robot or at app.oneprovider.dev, top up the balance and press “Issue a key”. Each key can carry its own spend limit. Cabinet & API keys .
What do 401, 404 and 429 mean?
401: the key is missing, mistyped or sent in the wrong header; paste the whole key without quotes or spaces. 404: usually a wrong base URL, for example a missing or doubled /v1. 429 with “Insufficient balance”: the cabinet balance or the key’s spend limit is used up, so top up instead of retrying; any other 429 is a rate limit, so wait for Retry-After. Details: error codes and troubleshooting .
Why do streams cut off or reset?
VPN and VLESS proxies often buffer SSE or break HTTP/2 negotiation. OneProvider has no regional restrictions and does not buffer streams, so turn the proxy off and retry.
Where do I ask if this is not enough?
Message @Oneproviderhelpbot on Telegram or open “Support” in the web cabinet, with the HTTP status code and the exact error message. How support works .
Last updated: 2026-10-05 Found a bug? @Oneproviderhelpbot