AICodeDog
Migration

Migrate from OpenAI

If your code already uses the official OpenAI SDK, the migration really is one line — point baseURL at api.aicodedog.com; you don't even need to change the API key format.

Why migrate

  • One key for many models: GPT, Claude, Gemini, DeepSeek, Kimi, Qwen — same endpoint.
  • ~20% cheaper: average price 20% below official, more for high volume. Failed calls aren't billed.
  • Low-latency in-region: in-country PoPs + Cloudflare.
  • One bill: merged invoice, simpler accounting.
  • OEM white-label: we run the infra, you run the brand — own domain + console.

Code changes

The only change is baseURL. Request shape, fields, and responses match OpenAI byte-for-byte.

diff
# Python from openai import OpenAI client = OpenAI( - api_key="sk-openai-xxx", + api_key=os.environ["AICODEDOG_KEY"], + base_url="https://api.aicodedog.com/v1", ) resp = client.chat.completions.create( - model="gpt-4o", + model="gpt-5.4", # or keep gpt-4o — we forward to OpenAI messages=[{"role": "user", "content": "Hi"}], )
diff
// Node.js const client = new OpenAI({ - apiKey: process.env.OPENAI_API_KEY, + apiKey: process.env.AICODEDOG_KEY, + baseURL: 'https://api.aicodedog.com/v1', });

Migration checklist

  1. Create an AICodeDog API key: sign up → Console → API keys.
  2. Set env vars: add AICODEDOG_KEY to .env and Vercel / Cloudflare / AWS secrets.
  3. One-line baseURL change: add baseURL: "https://api.aicodedog.com/v1" to every client constructor.
  4. Run a smoke test: hit one minimal prompt locally, confirm 200.
  5. Canary rollout: route 10% of prod traffic for 1–2 days, watch latency / error rate / token usage. Cut over to 100% once happy.
  6. Compare metrics: in the dashboard, token usage, error rate, p99 should match or beat your previous numbers.

Model-name compatibility

We support both directions:

  • Original OpenAI model names (gpt-4o, gpt-4-turbo, text-embedding-3-small, …) still work — we forward to OpenAI upstream.
  • To use models from other vendors, see /models for the slug, e.g.:
    • claude-opus-4-1 ← Anthropic flagship
    • gemini-3-1-pro ← Google flagship
    • DeepSeek-V4-Pro ← best value
    • Kimi-K2.6 ← long context

Edge cases (rare)

  • Assistants API / Realtime API: not yet proxied. If you rely on them heavily, keep the official key for that surface and route everything else through AICodeDog.
  • Files API (fine-tune uploads): not yet proxied. Fine-tune still goes direct to OpenAI.
  • Organization header (OpenAI-Organization): ignored — no effect on results.
  • Response id: we re-issue with prefix chatcmpl- so you can audit per call. The upstream OpenAI id is exposed in upstream_id (admin-only).
Free credit during migration
Run 1-2 days of real traffic and compare model, token, latency, and failed-call data in the console before moving production traffic.