Migrate from OpenAI
Three lines of diff. Your existing OpenAI SDK keeps working.
The patch
diff
- client = OpenAI()
+ client = OpenAI(
+ api_key=os.environ["API_AI_KEY"],
+ base_url="https://api-ai.app/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 | deepseek-v4-pro | Frontier tier for the most demanding work. |
| Default production workload | gemini-3.6-flash | Balanced quality and cost for everyday use. |
| High-volume processing and fast drafts | gemini-3.8-flash | Fast 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-ai.app/v1" and wire_api = "responses".
Post-migration check
python
response = client.chat.completions.create(
model="gemini-3.6-flash",
messages=[{"role": "user", "content": "Reply with: migration works"}],
)
print(response.choices[0].message.content)Last updated: November 21, 2026Found a bug? admin@minedom-france.fr