APIQIKAPIQIK
Docs
Quickstart

Migrate from OpenAI

Replace the Base URL and API key, and update legacy SDK code to the current client API.

APIQIK is compatible with the OpenAI Chat Completions specification. Keep your messages, parameters, and response-reading logic, and change the client initialization settings.

Minimal changes

Before migration

client = OpenAI(
    api_key=os.environ["OPENAI_API_KEY"]
)

After migration

client = OpenAI(
    api_key=os.environ["APIQIK_API_KEY"],
    base_url="https://api.apiqik.com/v1",
)

If APIQIK does not offer the original model under the same name, replace model with the identifier from the model catalog. Node routing does not require changes to other business logic.

Check for outdated code

Older tutorials commonly use the following patterns. Update them to the current official OpenAI SDK client API during migration.

AreaLegacy patternCurrent patternAction
Pythonopenai.ChatCompletion.create(...)OpenAI(...).chat.completions.create(...)Upgrade.
Node.jsnew Configuration() + OpenAIApinew OpenAI({...})Upgrade.
Tool callingfunctions / function_calltools / tool_choice / tool_callsUse the current structure.
Python Base URLapi_basebase_urlUse the client parameter.
Node.js Base URLbase_urlbaseURLCheck capitalization.
Streaming textmessage.contentdelta.contentRead each chunk.

Python migration template

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["APIQIK_API_KEY"],
    base_url="https://api.apiqik.com/v1",
    timeout=60.0,
    max_retries=2,
)

response = client.chat.completions.create(
    model="deepseek-chat",
    messages=[{"role": "user", "content": "Hello"}],
)

print(response.choices[0].message.content)

Migration checklist

  • Test non-streaming, streaming, and tool-calling requests, not just a single text turn.
  • Check model identifiers, context limits, supported parameters, and response-field differences.
  • Ensure client timeouts and retries do not combine with platform routing retries to create excessive waits.
  • Validate cost calculations against response usage and console billing records.
  • Monitor error rates, P95 latency, and finish_reason values before rollout.

API compatibility does not mean every model has identical capabilities. Tool calling, multimodal input, structured output, and generation parameters depend on the selected model.