Migrating from OpenAI
Two lines, in practice.
What changes
client = OpenAI(
- api_key=os.environ["OPENAI_API_KEY"],
+ base_url="https://api.voyai.net/v1",
+ api_key=os.environ["VOYAI_API_KEY"],
)
resp = client.chat.completions.create(
- model="gpt-4o",
+ model="deepseek-ai/DeepSeek-V3.2",
messages=[{"role": "user", "content": "Hello"}],
)What stays the same
- Request and response shapes, including streaming chunks.
- Tool calling, JSON mode, system messages, multi-turn.
- Your error handling — same error object shape.
What to watch for
- Model IDs are different. Use the IDs from the Models page.
- No organisation header, no project scoping. Isolation is per key.
- Rate limits are yours to configure per key rather than assigned by tier.