Migration Guide

Switch from any provider by changing your base URL and API key — your existing code, SDKs, and tools continue to work unchanged.

From OpenAI Direct

Change base_url and api_key. No other code changes needed.

terminal
bash
# Before
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://api.openai.com/v1

# After
export OPENAI_API_KEY=ck-your-key-here
export OPENAI_BASE_URL=https://api.chuizi.ai/v1

From Anthropic Direct

Use the /anthropic endpoint for native protocol support. No format conversion, full feature parity.

terminal
bash
# Before
export ANTHROPIC_API_KEY=sk-ant-...

# After
export ANTHROPIC_API_KEY=ck-your-key-here
export ANTHROPIC_BASE_URL=https://api.chuizi.ai/anthropic
example.py
python
from anthropic import Anthropic

# Before
client = Anthropic()

# After — add base_url and api_key
client = Anthropic(
    base_url="https://api.chuizi.ai/anthropic",
    api_key="ck-your-key-here",
)

# Everything else stays the same
message = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)

This is the recommended setup for Claude Code, Cline, and other tools that use the Anthropic SDK.

From OpenRouter

Chuizi.AI uses the same OpenAI-compatible protocol. Change the base URL and API key:

terminal
bash
# Before
export OPENAI_BASE_URL=https://openrouter.ai/api/v1
export OPENAI_API_KEY=sk-or-...

# After
export OPENAI_BASE_URL=https://api.chuizi.ai/v1
export OPENAI_API_KEY=ck-your-key-here

Model names are largely compatible. Chuizi.AI uses the provider/model format (e.g., anthropic/claude-sonnet-4-6), which matches OpenRouter conventions.

From Azure OpenAI

Azure OpenAI uses a different URL structure and API version parameter. Switch to the standard OpenAI SDK format:

example.py
python
from openai import OpenAI

# Before (Azure)
from openai import AzureOpenAI
client = AzureOpenAI(
    azure_endpoint="https://your-resource.openai.azure.com",
    api_version="2024-12-01-preview",
    api_key="your-azure-key",
)

# After (Chuizi.AI)
client = OpenAI(
    base_url="https://api.chuizi.ai/v1",
    api_key="ck-your-key-here",
)

# Update model names: deployment name → provider/model
response = client.chat.completions.create(
    model="openai/gpt-4.1",  # was: your Azure deployment name
    messages=[{"role": "user", "content": "Hello!"}],
)

From Vertex AI (Google)

Use the Gemini native protocol endpoint:

terminal
bash
export GEMINI_API_BASE=https://api.chuizi.ai/gemini
export GEMINI_API_KEY=ck-your-key-here

Or use the OpenAI-compatible endpoint with Google models:

example.py
python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.chuizi.ai/v1",
    api_key="ck-your-key-here",
)

response = client.chat.completions.create(
    model="google/gemini-2.5-pro",
    messages=[{"role": "user", "content": "Hello!"}],
)

Environment Variable Reference

ProviderBeforeAfter (Chuizi.AI)
OpenAIOPENAI_API_KEY=sk-...OPENAI_API_KEY=ck-...
OpenAIOPENAI_BASE_URL=https://api.openai.com/v1OPENAI_BASE_URL=https://api.chuizi.ai/v1
AnthropicANTHROPIC_API_KEY=sk-ant-...ANTHROPIC_API_KEY=ck-...
AnthropicANTHROPIC_BASE_URL=https://api.chuizi.ai/anthropic
OpenRouterOPENAI_BASE_URL=https://openrouter.ai/api/v1OPENAI_BASE_URL=https://api.chuizi.ai/v1
AzureAZURE_OPENAI_ENDPOINT=...OPENAI_BASE_URL=https://api.chuizi.ai/v1

What Changes, What Doesn't

AspectChangesStays the Same
Base URLNew Chuizi.AI endpoint
API keyck- prefixed key
Model namesUse provider/model format
Request/response format
SDK methods and parameters
Streaming behavior
Error response structure
Function calling / tool use

Next Steps

Migration Guide — Chuizi AI Docs | Chuizi AI