Connect Open Claw to DIAL
In this tutorial you add DIAL as a model provider in Open Claw, the self-hosted agent gateway, set it as the default, and run one agent turn. Every agent turn is then routed to your DIAL deployment, with DIAL roles, quotas, audit, and cost tracking applied. This tutorial is for developers who already have a DIAL host and Open Claw installed.
Prerequisites
- A DIAL host and API key. See Before you begin.
- Node.js 22 or newer.
- Open Claw installed.
What you'll build
DIAL registered as the default model provider in Open Claw. By the end, one agent turn runs against your DIAL deployment and names the model back to you.
Step 1: Store your DIAL key
Add it to ~/.openclaw/.env (on Windows, %USERPROFILE%\.openclaw\.env):
DIAL_API_KEY="<DIAL_API_KEY>"
Step 2: Add a DIAL provider
Edit ~/.openclaw/openclaw.json. The DIAL deployment id is part of baseUrl, so you use one provider block per deployment you want to expose.
{
"models": {
"mode": "merge",
"providers": {
"dial": {
"baseUrl": "https://<YOUR_DIAL_HOST>/openai/deployments/gpt-5.4-2026-03-05",
"apiKey": "${DIAL_API_KEY}",
"headers": { "Api-Key": "${DIAL_API_KEY}" },
"api": "openai-completions",
"models": [
{
"id": "gpt-5.4",
"name": "GPT-5.4 (DIAL)",
"reasoning": false,
"input": ["text"],
"contextWindow": 128000,
"maxTokens": 4096
}
]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "dial/gpt-5.4" },
"models": { "dial/gpt-5.4": {} }
}
}
}
Step 3: Set the active model
openclaw models set dial/gpt-5.4
Verify:
You see Default model: dial/gpt-5.4. To confirm the key was picked up, run openclaw models status and check that the dial provider is listed with auth present.
Step 4: Run one agent turn
openclaw agent --local --agent main -m "Reply in one short sentence: what model are you?"
Verify:
You see a reply naming your DIAL model — for example, "I am the dial/gpt-5.4 model." — followed by stopReason=stop. The --local flag runs the agent in-process, which is the quickest way to confirm the connection. For everyday use, start the gateway once with openclaw gateway run and drop the --local flag.
What you learned
- How to store your DIAL key and register a DIAL provider block in
openclaw.json. - How to set a DIAL deployment as Open Claw's default model.
- How to run one agent turn against DIAL to confirm the connection.
Good to know
- DIAL has no single
/v1/chat/completionsrouter: each deployment needs its own provider block whosebaseUrlends in that deployment id. To add a second model, copy the block (for example, asdial-claude) and reference it asdial-claude/<deployment-id>. - The
openai-completionswire uses Chat Completions. To reach a Responses-only deployment, set"api": "openai-responses"and pointbaseUrlathttps://<YOUR_DIAL_HOST>/openai/v1instead. - Open Claw also sends
Authorization: BearerfromapiKey; the explicitheaders.Api-Keyentry above is what DIAL authenticates on. - Tool calling, reasoning, and attachments work only when the DIAL deployment advertises those capabilities.
- On Azure-backed GPT-5.x deployments, expect the two settings from Azure-backed deployment settings: an
api-versionon the request URL andmax_completion_tokensin place ofmax_tokens. Non-GPT-5.x deployments typically need neither. - This wires only the model backend. Messaging channels still need their own Open Claw channel config and secrets.
Next steps
- Connect OpenCode to DIAL — another terminal agent that uses Chat Completions
- Agentic tools overview — shared prerequisites and the other tools
- Unified API reference — the API DIAL exposes