Inference APIsOpenAI Compatibility
Overview
Use OpenAI SDKs and tools against OpenInfer.
OpenInfer implements the OpenAI inference APIs. Use an OpenAI SDK with a different base URL and key and your code keeps working.
from openai import OpenAI
client = OpenAI(base_url="https://api.openinfer.ai/v1", api_key="pk_...")Supported endpoints
| Endpoint | API family |
|---|---|
POST /v1/chat/completions | Chat Completions |
POST /v1/responses | Responses |
GET /v1/models | Models your key can call |
POST /v1/embeddings | Embeddings |
POST /v1/images/generations | Image generation |
POST /v1/messages | Anthropic Messages, for Claude Code |
Authentication
Send your API key as Authorization: Bearer pk_…. Create keys on the console's API keys page.
Models
model takes a slug from GET /v1/models, such as @oi/Qwen3.5-9B, or an organization alias like @alias/name.
Differences from OpenAI
- Message content accepts
textparts only; image inputs are rejected with400. nmust be1.top_pmust be in(0, 1].- Streaming (
stream: true) answerstext/event-stream. A stream that fails after its200ends with one error frame. - A request body may be at most 20 MB.
- Capacity is enforced per model; a request no node can take is answered
429 model_at_capacity. - Every authenticated response carries an
x-request-id.