Skip to content

Migrating from Anthropic

The ai& Inference API exposes Anthropic-compatible endpoints alongside its OpenAI surface. If you’re using the anthropic SDK, you can migrate by changing the base URL and the API key.

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

The anthropic-version header the SDK sends automatically tells ai& to respond with Anthropic-shape payloads — including on the dual-shape Files endpoints.

Anthropic endpointai& pathNotes
/v1/messagesMessagesStreaming + tool use + vision
/v1/filesFilesAnthropic shape selected by anthropic-version header
  • API keys start with sk- (not sk-ant-) — see Authentication.
  • Model IDs differ from Anthropic’s. List them via the catalog or client.models.list() on the OpenAI surface.