Skip to content

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.

from openai import OpenAI
client = OpenAI(
base_url="https://api.aiand.com/v1",
api_key="sk-your-aiand-api-key",
)

Everything else — chat.completions.create, streaming, tool calls, structured outputs — works as-is.

OpenAI endpointai& pathNotes
/v1/chat/completionsChat CompletionsFull parity
/v1/modelsModelsReturns models your org has access to
/v1/filesFilesSame multipart upload shape
/v1/uploadsUploadsChunked uploads for large files
  • 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-ID when using JWT auth. API keys carry their org automatically.