Migrating from OpenAI
The ai& Inference API is wire-compatible with the OpenAI Chat Completions, Responses, and Models APIs. If you have an OpenAI integration already, you can usually migrate by changing the base URL and the API key.
Change two things
Section titled “Change two things”from openai import OpenAI
client = OpenAI( base_url="https://api.aiand.com/v1", api_key="sk-your-aiand-api-key",)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.aiand.com/v1", apiKey: "sk-your-aiand-api-key",});Everything else — chat.completions.create, streaming, tool calls, structured outputs — works as-is.
Supported endpoints
Section titled “Supported endpoints”| OpenAI endpoint | ai& path | Notes |
|---|---|---|
/v1/chat/completions | Chat Completions | Full parity |
/v1/models | Models | Returns models your org has access to |
/v1/files | Files | Same multipart upload shape |
/v1/uploads | Uploads | Chunked uploads for large files |
What’s different
Section titled “What’s different”- API keys start with
sk-like OpenAI’s but are issued by ai& — see Authentication. - Model IDs differ. List them with
client.models.list()or see the catalog. - Org scoping — pass
X-Org-IDwhen using JWT auth. API keys carry their org automatically.