OpenAI and Anthropic compatibility

Use your OpenAI or Anthropic SDK with the open models of Munito AI. Change the base URL, the key and the model name.

Keep your OpenAI or Anthropic SDK, and change three values:

OpenAI SDKAnthropic SDK
Base URLhttps://api.munito.ai/inference/v1https://api.munito.ai/inference
KeyMUNITO_API_KEYMUNITO_API_KEY
ModelAn ID from Models, such as qwen/qwen3.8-27bThe same IDs
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.munito.ai/inference/v1",
    api_key=os.environ["MUNITO_API_KEY"],
)
response = client.chat.completions.create(
    model="qwen/qwen3.8-27b",
    messages=[{"role": "user", "content": "Name three rivers in Europe."}],
    max_tokens=2048,
)
print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.munito.ai/inference/v1",
  apiKey: process.env.MUNITO_API_KEY,
});
const response = await client.chat.completions.create({
  model: "qwen/qwen3.8-27b",
  messages: [{ role: "user", content: "Name three rivers in Europe." }],
  max_tokens: 2048,
});
console.log(response.choices[0].message.content);
import os
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.munito.ai/inference",
    api_key=os.environ["MUNITO_API_KEY"],
)
message = client.messages.create(
    model="qwen/qwen3.8-27b",
    max_tokens=2048,
    messages=[{"role": "user", "content": "Name three rivers in Europe."}],
)
for block in message.content:
    if block.type == "text":
        print(block.text)

Endpoints

EndpointFormat
POST /v1/chat/completionsOpenAI Chat Completions
POST /v1/responsesOpenAI Responses
POST /v1/messagesAnthropic Messages
POST /v1/messages/count_tokensAnthropic token count
POST /v1/audio/transcriptionsOpenAI speech to text
GET /v1/modelsOpenAI model list

Each path starts with https://api.munito.ai/inference. There is no embeddings endpoint and no file upload endpoint.

What works differently

  • No silent changes. A parameter that Munito AI cannot apply returns 400, and the error names the parameter.
  • Stored responses. Munito AI stores a response only with store: true or background: true. Add store: true where your code uses previous_response_id.
  • Reasoning models. A reasoning model writes its reasoning before the answer, and max_tokens counts both. Set max_tokens to 2048 or more. See Reasoning.
  • Tools. Function tools work on the three APIs. Hosted tools, such as a web search, do not.
  • Text only. Munito AI generates text, so audio and modalities return 400.
  • Errors. Chat Completions and Responses send the OpenAI error body, and Messages sends the Anthropic one, so each SDK raises its usual exceptions. See Errors.

The API reference gives each parameter of each endpoint.