Providers
FreeChaOS is provider-agnostic. The kernel speaks the Chaos-ABI; adapters translate that to whatever wire format a given provider expects. New providers are added through ~/.chaos/config.toml - no code changes, no rebuilds.
Built-in providers
Section titled “Built-in providers”| Provider | Wire format | Notes |
|---|---|---|
openai |
Responses API | Default, hardcoded |
anthropic |
Anthropic Messages | Hardcoded; URL-detected |
xai |
Responses API | Bundled; native web_search / x_search tools |
zai |
Chat Completions | Bundled; Z.ai pay-per-token (GLM-5 / GLM-5.1) |
zai-coding |
Chat Completions | Bundled; Z.ai GLM Coding Plan subscription |
charm |
Chat Completions | Bundled via thirdparty.toml |
Any other provider - DeepSeek, Groq, Ollama, MiniMax, Kimi, TensorZero, self-hosted gateways - is a config entry away.
Wire formats
Section titled “Wire formats”Providers speak one of four wire formats:
- Responses API - OpenAI’s
/v1/responses. What OpenAI ships and most imitators clone. - Chat Completions -
/v1/chat/completions. The lingua franca of OpenAI-compatible gateways. - Anthropic Messages - Anthropic’s native format. Auto-detected when the base URL contains
anthropic. - TensorZero - TensorZero’s native
/inferenceendpoint. Opt in withwire_api = "tensorzero".
By default, providers use wire_api = "auto": FreeChaOS tries Responses first and falls back to Chat Completions on 404/405/501. The winning format is cached for the session.
Selection rules
Section titled “Selection rules”- If the
base_urlcontainsanthropic→ Anthropic Messages API (overrideswire_api) - If
wire_apiis set explicitly → use it (responses,chat_completions,tensorzero) - Otherwise →
auto: try Responses, fall back to Chat Completions on 404/405/501
There is no wire_api = "anthropic" option. The URL is the signal.
Examples
Section titled “Examples”xAI (Grok)
Section titled “xAI (Grok)”Bundled - no config needed. Just export the key:
export XAI_API_KEY=xai-...chaos --provider xai --model grok-4URLs containing x.ai automatically expose xAI’s native web_search and x_search server-side tools - no function schema needed. Override the bundled config by redeclaring [model_providers.xai] in ~/.chaos/config.toml.
Anthropic (Claude)
Section titled “Anthropic (Claude)”Already built-in, but overridable:
[model_providers.anthropic]name = "Anthropic"base_url = "https://api.anthropic.com/v1"env_key = "ANTHROPIC_API_KEY"export ANTHROPIC_API_KEY=sk-ant-...chaos --provider anthropic --model haikuThe URL contains anthropic, so FreeChaOS routes to the Messages API adapter.
Z.ai (GLM)
Section titled “Z.ai (GLM)”Bundled as two separate providers - Z.ai runs distinct endpoints for pay-per-token API access and the GLM Coding Plan subscription. Both share the same ZAI_API_KEY; pick the provider that matches your billing.
export ZAI_API_KEY=your-keychaos --provider zai --model glm-5.1 # pay-per-tokenchaos --provider zai-coding --model glm-5.1 # Coding Plan subscriptionDeepSeek
Section titled “DeepSeek”[model_providers.deepseek]name = "DeepSeek"base_url = "https://api.deepseek.com/v1"env_key = "DEEPSEEK_API_KEY"[model_providers.groq]name = "Groq"base_url = "https://api.groq.com/openai/v1"env_key = "GROQ_API_KEY"Ollama (local)
Section titled “Ollama (local)”[model_providers.ollama]name = "Ollama"base_url = "http://localhost:11434/v1"No env_key needed - Ollama runs locally without authentication.
chaos --provider ollama --model llama3TensorZero
Section titled “TensorZero”[model_providers.tensorzero]name = "TensorZero"base_url = "http://localhost:3000"wire_api = "tensorzero"TensorZero has its own inference protocol - explicit wire_api required.
Anthropic-compatible proxies (MiniMax, Kimi, Z.ai)
Section titled “Anthropic-compatible proxies (MiniMax, Kimi, Z.ai)”Any provider whose base URL contains anthropic is routed to the Anthropic Messages adapter:
[model_providers.minimax]name = "MiniMax"base_url = "https://api.minimax.io/anthropic"env_key = "MINIMAX_API_KEY"Configuration reference
Section titled “Configuration reference”| Field | Required | Description |
|---|---|---|
name |
yes | Display name for logs and model selection |
base_url |
yes | Provider API endpoint |
env_key |
no | Environment variable holding the API key |
env_key_instructions |
no | Help text shown when the key is missing |
wire_api |
no | "auto" (default), "responses", "chat_completions", or "tensorzero". Anthropic is URL-detected and overrides this. |
http_headers |
no | Static headers as { "Header-Name" = "value" } |
env_http_headers |
no | Headers from env vars as { "Header-Name" = "ENV_VAR" } |
query_params |
no | Query string parameters as { "key" = "value" } |
request_max_retries |
no | HTTP retry limit (default: 4, max: 100) |
stream_max_retries |
no | Stream reconnect limit (default: 5, max: 100) |
stream_idle_timeout_ms |
no | Idle timeout in ms (default: 300000) |
supports_websockets |
no | Enable WebSocket transport (default: false) |
experimental_bearer_token |
no | Hardcoded bearer token (discouraged - use env_key) |
Troubleshooting
Section titled “Troubleshooting”“env var not set” - Export the API key variable listed in env_key.
Provider returns errors - Check that base_url points to the correct API version endpoint. Most OpenAI-compatible providers use /v1.
Timeouts on slow providers - Increase stream_idle_timeout_ms:
[model_providers.slow]stream_idle_timeout_ms = 600000Rate limiting - FreeChaOS retries 429s automatically. Increase request_max_retries if needed.
~/.chaos/config.toml- user-level provider configurationthirdparty.toml- bundled provider definitions referenced by the tree