← All tutorials
Beginner5 min

Migrate from OpenAI in one diff

The drop-in migration Fireworks proved and we copied: same SDK, new base URL.

1. Change two lines

Base URL + model id. Everything else — retries, streaming, tools — is identical.

client = OpenAI(api_key="$RUNAII_API_KEY",
                base_url="https://api.runaii.cloud/v1")
model="runaii/glm-5.3"  # was gpt-4.x

2. Verify with the playground

Paste the same prompt into /console/playground side-by-side. Metered, so you see the exact new cost.

# playground header shows live credit balance

3. Cut over gradually

Dual-run 5% of traffic, compare quality + cost in /console/usage, then flip. Rollback = one env var.

RUNAII_MODEL=runaii/deepseek-v4-pro  # per-env override

Next tutorials