API
API Manual
One OpenAI-compatible entry. Route with model auto or pick a model by name.
Quick start
Authenticate every request with a Bearer API key. Replace sk-YOUR_KEY with your key; never publish real keys.
Use either base URL: https://api.maxllm.net/v1 for direct and model=auto calls, or https://auto.maxllm.net/v1 for auto-mode routing.
The OpenAI-compatible chat completions path is /chat/completions. A minimal call with model auto looks like this:
curl -sS https://api.maxllm.net/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [{"role": "user", "content": "Hello"}]
}'
Endpoints and hosts
Only paths on the public allowlist are reachable from the internet. Requests to other paths return HTTP 404.
https://api.maxllm.net/v1 is the primary host: pass a concrete model name or model auto.
https://auto.maxllm.net/v1 is the auto host. Send header X-MaxLLM-Mode to select auto behaviour on that host.
- Primary: https://api.maxllm.net/v1 — direct models and model=auto
- Auto host: https://auto.maxllm.net/v1 — use X-MaxLLM-Mode
- Public allowlist only; other paths → 404
Models
Set model in the JSON body. Use auto to let maxLLM pick a route, or name a model explicitly.
Streaming is supported on chat completions: set "stream": true and consume server-sent events.
- auto — automatic routing
- qwen-4b — compact Qwen
- qwen-27b — larger Qwen
- xiaomi/mimo-v2.6-flash, xiaomi/mimo-v2.6-pro, xiaomi/mimo-v2.6-pro-ultraspeed — Xiaomi MiMo
Examples
Non-streaming returns a full JSON completion. Streaming returns chunks; keep the connection open until the stream ends.
Successful responses may include headers X-MaxLLM-Model (resolved model) and X-MaxLLM-Tier (service tier).
curl -sS https://api.maxllm.net/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-4b",
"messages": [{"role": "user", "content": "Summarize maxLLM in one sentence."}],
"stream": false
}'
curl -N https://api.maxllm.net/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [{"role": "user", "content": "Stream a short reply."}],
"stream": true
}'
Clients
Any OpenAI-compatible client can talk to maxLLM with the right base URL, API key, and model id.
- MiMo Code: set baseURL to https://api.maxllm.net/v1 (or api.maxllm.net as the host), API key sk-YOUR_KEY, model auto
- Open WebUI: OpenAI-compatible connection URL https://api.maxllm.net/v1, API key sk-YOUR_KEY, pick model auto or a named model
Billing
Usage is charged against a prepaid EUR ledger on the key or account.
Metering runs after the request completes; balance decreases by the measured usage.
When the prepaid balance is exhausted, the API responds with HTTP 402 until the ledger is topped up.
Errors and limits
Treat these status codes as stable integrator signals:
- 401 — missing or invalid Bearer key
- 402 — prepaid balance exhausted
- 404 — path not on the public allowlist
- 502 / 504 — upstream or gateway failure
- Timeouts — client or gateway time limit exceeded; retry with backoff when safe