ZeroClaw supports custom API endpoints for both OpenAI-compatible and Anthropic-compatible providers.
For services that implement the OpenAI API format:
default_provider = "custom:https://your-api.com"
api_key = "your-api-key"
default_model = "your-model-name"Optional API mode:
# Default (chat-completions first, responses fallback when available)
provider_api = "openai-chat-completions"
# Responses-first mode (calls /responses directly)
provider_api = "openai-responses"provider_api is only valid when default_provider uses custom:<url>.
Responses API WebSocket mode is supported for OpenAI-compatible endpoints:
- Auto mode: when your
custom:endpoint resolves toapi.openai.com, ZeroClaw will try WebSocket mode first (wss://.../responses) and automatically fall back to HTTP if the websocket handshake or stream fails. - Manual override:
ZEROCLAW_RESPONSES_WEBSOCKET=1forces websocket-first mode for anycustom:endpoint.ZEROCLAW_RESPONSES_WEBSOCKET=0disables websocket mode and uses HTTP only.
For services that implement the Anthropic API format:
default_provider = "anthropic-custom:https://your-api.com"
api_key = "your-api-key"
default_model = "your-model-name"Edit ~/.zeroclaw/config.toml:
api_key = "your-api-key"
default_provider = "anthropic-custom:https://api.example.com"
default_model = "claude-sonnet-4-6"For custom: and anthropic-custom: providers, use the generic key env vars:
export API_KEY="your-api-key"
# or: export ZEROCLAW_API_KEY="your-api-key"
zeroclaw agentZeroClaw includes a first-class provider for Tencent Hunyuan:
- Provider ID:
hunyuan(alias:tencent) - Base API URL:
https://api.hunyuan.cloud.tencent.com/v1
Configure ZeroClaw:
default_provider = "hunyuan"
default_model = "hunyuan-t1-latest"
default_temperature = 0.7Set your API key:
export HUNYUAN_API_KEY="your-api-key"
zeroclaw agent -m "hello"ZeroClaw includes a first-class local provider for llama-server:
- Provider ID:
llamacpp(alias:llama.cpp) - Default endpoint:
http://localhost:8080/v1 - API key is optional unless
llama-serveris started with--api-key
Start a local server (example):
llama-server -hf ggml-org/gpt-oss-20b-GGUF --jinja -c 133000 --host 127.0.0.1 --port 8033Then configure ZeroClaw:
default_provider = "llamacpp"
api_url = "http://127.0.0.1:8033/v1"
default_model = "ggml-org/gpt-oss-20b-GGUF"
default_temperature = 0.7Quick validation:
zeroclaw models refresh --provider llamacpp
zeroclaw agent -m "hello"You do not need to export ZEROCLAW_API_KEY=dummy for this flow.
ZeroClaw includes a first-class local provider for SGLang:
- Provider ID:
sglang - Default endpoint:
http://localhost:30000/v1 - API key is optional unless the server requires authentication
Start a local server (example):
python -m sglang.launch_server --model meta-llama/Llama-3.1-8B-Instruct --port 30000Then configure ZeroClaw:
default_provider = "sglang"
default_model = "meta-llama/Llama-3.1-8B-Instruct"
default_temperature = 0.7Quick validation:
zeroclaw models refresh --provider sglang
zeroclaw agent -m "hello"You do not need to export ZEROCLAW_API_KEY=dummy for this flow.
ZeroClaw includes a first-class local provider for vLLM:
- Provider ID:
vllm - Default endpoint:
http://localhost:8000/v1 - API key is optional unless the server requires authentication
Start a local server (example):
vllm serve meta-llama/Llama-3.1-8B-InstructThen configure ZeroClaw:
default_provider = "vllm"
default_model = "meta-llama/Llama-3.1-8B-Instruct"
default_temperature = 0.7Quick validation:
zeroclaw models refresh --provider vllm
zeroclaw agent -m "hello"You do not need to export ZEROCLAW_API_KEY=dummy for this flow.
Verify your custom endpoint:
# Interactive mode
zeroclaw agent
# Single message test
zeroclaw agent -m "test message"- Verify API key is correct
- Check endpoint URL format (must include
http://orhttps://) - Ensure endpoint is accessible from your network
- Confirm model name matches provider's available models
- Check provider documentation for exact model identifiers
- Ensure endpoint and model family match. Some custom gateways only expose a subset of models.
- Verify available models from the same endpoint and key you configured:
curl -sS https://your-api.com/models \
-H "Authorization: Bearer $API_KEY"- If the gateway does not implement
/models, send a minimal chat request and inspect the provider's returned model error text.
- Test endpoint accessibility:
curl -I https://your-api.com - Verify firewall/proxy settings
- Check provider status page
default_provider = "custom:http://localhost:8080/v1"
api_key = "your-api-key-if-required"
default_model = "local-model"default_provider = "anthropic-custom:https://llm-proxy.corp.example.com"
api_key = "internal-token"default_provider = "custom:https://gateway.cloud-provider.com/v1"
api_key = "gateway-api-key"
default_model = "gpt-4"