Move from the OpenAI or Anthropic SDK to open models on Munito AI. Change the base URL, the API key and the model name, and check what works differently.
Munito AI is an OpenAI-compatible API for open models, and it also serves the Anthropic Messages API. To move an app to Munito AI, keep your OpenAI or Anthropic SDK and change three values: the base URL, the API key and the model name. The request and response formats stay the same, so the rest of your code does not change.
| SDK | Base URL | Key |
|---|---|---|
| OpenAI SDK | https://api.munito.ai/inference/v1 | MUNITO_API_KEY, sent as a Bearer token |
| Anthropic SDK | https://api.munito.ai/inference | MUNITO_API_KEY, sent as X-API-Key |
The Anthropic SDK adds /v1/messages itself, so its base URL has no /v1.
Create a key in the console and export it:
export MUNITO_API_KEY="munitoai_..."OpenAI SDK in Python
pip install openaiimport 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)OpenAI SDK in TypeScript
npm install openaiimport 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);Anthropic SDK in Python
pip install anthropicimport 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)The answer also holds a thinking block before the text block, because the model reasons first. See Reasoning.
Model names
Munito AI names each model <organization>/<model>. Replace your OpenAI or Anthropic model name with one of these:
| Model | Input |
|---|---|
qwen/qwen3.8-27b | Text, images, video |
zai-org/glm-5.3-flash | Text, images, video |
deepseek-ai/deepseek-v4.1-flash-1017 | Text, images |
deepseek-ai/deepseek-v4-flash | Text |
aleph-alpha/kolibri-1 | Text |
The model catalog has the details of each model, and GET /inference/v1/models lists the models that your key can use.
A model name that Munito AI does not serve returns 404 with code model_not_found:
{
"error": {
"message": "The model gpt-4o does not exist, or you do not have access to it.",
"type": "invalid_request_error",
"param": "model",
"code": "model_not_found"
}
}Endpoints
| Endpoint | Format |
|---|---|
POST /v1/chat/completions | OpenAI Chat Completions |
POST /v1/responses | OpenAI Responses |
POST /v1/messages | Anthropic Messages |
POST /v1/messages/count_tokens | Anthropic token count |
POST /v1/audio/transcriptions | OpenAI speech to text |
GET /v1/models | OpenAI model list |
Each path starts with https://api.munito.ai/inference. Munito AI has no embeddings endpoint and no file upload endpoint.
A path that Munito AI does not serve returns 404 with the detail No API operation has this path.
What works differently
Munito AI never ignores a parameter in silence. A parameter that it cannot apply returns 400, so that you know at once.
Chat Completions
| Parameter | On Munito AI |
|---|---|
tools | Function tools only. See Tool calling. |
response_format | text, json_object and json_schema. See Structured outputs. |
reasoning_effort | The levels differ for each model. See Reasoning. |
max_tokens, max_completion_tokens | A value above the model maximum is lowered to the maximum. It does not fail. |
n | 1 to 8. |
stop | Up to 4 sequences. |
logit_bias | Not available on the public models. |
service_tier | priority, flex, or default for standard. See Service tiers. |
prompt_cache_key, user | Accepted. Munito AI uses them to keep a conversation where its prompt is cached. |
audio, modalities | Rejected. Munito AI generates text only. |
prediction | Rejected. |
functions, function_call | Rejected. Use tools and tool_choice. |
verbosity | Rejected. Control the length with the prompt or max_tokens. |
web_search_options | Rejected. Munito AI has no hosted web search. |
prompt_cache_retention | Rejected. The cache retention is not configurable. |
Munito AI also accepts top_k, repetition_penalty and chat_template_kwargs. min_p works on aleph-alpha/kolibri-1 only.
A rejected parameter returns a message in this form:
{
"error": {
"message": "'web_search_options' is not supported: hosted web search is not available",
"type": "invalid_request_error",
"param": "web_search_options",
"code": null
}
}A parameter that no API knows returns unknown parameter: 'name'.
Responses
- Function tools work. A hosted web search tool is removed from the request, and the model answers without a search. Other hosted tools return
400. - Munito AI stores a response only when you send
store: true(orbackground: true). OpenAI stores by default, so addstore: truewhere your code usesprevious_response_id. Without it, the chained request returns400withprevious response resp_... was not stored. Send store: true to continue a response. conversation,prompt,max_tool_calls,context_management,stream_options,prompt_cache_retentionandtext.verbosityreturn400.includeaccepts onlymessage.output_text.logprobsandreasoning.encrypted_content.
Messages
- The request accepts
model,messages,system,max_tokens,metadata,stop_sequences,stream,temperature,top_p,top_k,tools,tool_choice,thinking,output_configandchat_template_kwargs. Another field returns400withunknown messages parameter: <name>. max_tokensis required. A value above the model maximum is lowered to the maximum.toolsaccepts only your own tools. A server tool, such as web search, returns'tools' is not supported: only function tools are available.thinking.budget_tokensis accepted, but the model does not keep to it.max_tokenslimits the whole output.context_managementis accepted and has no effect.- To choose a service tier, send the
munito-service-tierheader.
Reasoning models
The public chat models reason before they answer by default, except google/gemma-4-12b. The reasoning uses output tokens, and it comes before the answer.
Set max_tokens to 2048 or more. With a small value, the output can stop during the reasoning, and content is then null.
See Reasoning to lower or turn off the reasoning.
Errors and headers
Each API returns errors in its own format: OpenAI's {"error": {...}} on the OpenAI endpoints, and Anthropic's {"type": "error", ...} on Messages.
The SDKs therefore raise their usual exception types.
Rate limits return 429, and a model with no free capacity returns 503. See Rate limits.
Send your first request
Call open models on Munito AI from an empty project in cURL, Python or TypeScript, through the OpenAI-compatible or the Anthropic-compatible API.
API compatibility
Munito AI serves open-source models through the OpenAI Chat Completions and Responses APIs and the Anthropic Messages API. See which tool calls, structured outputs and reasoning controls each endpoint supports.