Migrating from OpenAI
If your code uses the OpenAI SDK, migrating is two lines: point the base URL at AIx and use your AIx key. The request/response shapes are the same.
The change
from openai import OpenAI
client = OpenAI(
base_url="https://api.aix.theaimart.co/v1", # ← changed
api_key="YOUR_AIX_KEY", # ← changed
)
# everything else is identical
client.chat.completions.create(
model="anthropic/claude-sonnet-4-6",
messages=[{"role": "user", "content": "hi"}],
) import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.aix.theaimart.co/v1", // ← changed
apiKey: process.env.AIX_KEY, // ← changed
}); # Many tools read these — just point them at AIx:
export OPENAI_BASE_URL="https://api.aix.theaimart.co/v1"
export OPENAI_API_KEY="YOUR_AIX_KEY" ✦ That's the whole migration
No new SDK, no schema changes. Your existing chat.completions, embeddings,
images, audio.speech and audio.transcriptions calls keep working.
What’s the same
chat.completions(streaming + non-streaming),embeddings,images.generations,audio.speech,audio.transcriptions,models.- The OpenAI error envelope (
{ "error": { "message", "type", "code" } }). - Request params (
temperature,max_tokens,top_p,stop, …) and response fields.
What changes
- Model names are canonical, provider-prefixed — e.g.
anthropic/claude-sonnet-4-6,deepseek-ai/DeepSeek-V3.2, notgpt-4o. See the model catalog. - You get automatic route failover — AIx selects eligible paths and recovers from a degraded route without changing your client contract.
- Billing is prepaid credits across all of theaimart — see Billing.
Not (yet) supported
- Assistants API, fine-tuning, the Batch API, and the Realtime API are not part of the
/v1surface today. The core chat / embeddings / images / audio endpoints are.
ℹ Note
Using an OpenAI-compatible tool (Cursor, Cline, Continue, Aider)? Just set the base URL and key in its settings — see SDKs & integrations.