All guides · API quickstart · Last checked: OpenClaw documentation (custom providers, Ollama provider), November 2026; the Ollama requests it sends match those tested for our Ollama guide
- 1. Create an accountSign up in a minute and get $5 of free credit. Already a customer? Sign in.
- 2. Make an API keyIn your account, open AI API and press Create key. Keys start with
dgk_. Keep yours secret. - 3. Follow the steps belowCopy each block, paste your key where it says
dgk_your_key_here.
1. Add Datagram as a model provider
OpenClaw keeps its settings in ~/.openclaw/openclaw.json (run openclaw config file to see the path on your machine). Add this provider. It uses our Ollama-compatible address, which OpenClaw's own docs recommend for reliable tool calling:
{
models: {
providers: {
datagram: {
api: "ollama",
baseUrl: "https://api.datagram.net/v1/ollama",
apiKey: "${DATAGRAM_API_KEY}",
models: [
{ id: "qwen3-coder:30b-64k", name: "Qwen3-Coder 30B (64K)", input: ["text"], contextWindow: 65536, maxTokens: 8192 },
],
},
},
},
agents: { defaults: { model: { primary: "datagram/qwen3-coder:30b-64k" } } },
}
Then put your key where OpenClaw can read it, for example in your shell profile or the Gateway's environment:
export DATAGRAM_API_KEY=dgk_your_key_here
Make a key just for OpenClaw in your account under AI API. Don't add /v1 to the Ollama address: OpenClaw treats that as a different connection type. If you already have an openclaw.json, merge these two sections into it rather than replacing the file; OpenClaw refuses to start if the file has keys it doesn't recognise.
Or use the OpenAI-compatible address
If you prefer, the same provider can use our OpenAI-compatible API instead:
datagram: {
api: "openai-completions",
baseUrl: "https://api.datagram.net/v1",
apiKey: "${DATAGRAM_API_KEY}",
models: [ { id: "qwen3-coder:30b-64k", name: "Qwen3-Coder 30B (64K)", contextWindow: 65536, maxTokens: 8192 } ],
}
2. Check it and try it
openclaw models list --provider datagram
openclaw models set datagram/qwen3-coder:30b-64k
Then ask your assistant something small. The first answer can take 10 to 20 seconds while the model loads; after that it's quick. openclaw doctor --fix checks and repairs the settings.
Which model?
qwen3-coder:30b-64k is the one to use for OpenClaw. An assistant that uses tools sends long instructions with every step, so it needs a long context window (65,536 tokens) and reliable tool calls. Our other models have 8,192-token windows, which is fine for chat but too small for an agent. You can add more models to the list (any name from openclaw models list --provider datagram) for quick questions.
If something goes wrong
401 "Missing API key" or "Invalid or revoked API key"
Check DATAGRAM_API_KEY is set in the environment the OpenClaw Gateway runs in (not only in your terminal), then restart the Gateway. Keys start with dgk_.
The model writes tool calls as plain text
The address probably ends in /v1 with api: "ollama". Use https://api.datagram.net/v1/ollama for the Ollama connection, or switch to the OpenAI-compatible block above.
The Gateway won't start after editing the config
OpenClaw rejects unknown keys. Run openclaw doctor --fix, or check the provider block matches the example exactly.
402 "credit has run out"
Add credit in your account under AI API. Credit never expires.
Questions
Which connection should I use, Ollama or OpenAI-compatible?
The Ollama-compatible one (api: "ollama" with our /ollama address). OpenClaw's own docs recommend it because tool calls are more reliable. The OpenAI-compatible connection also works.
Which model?
qwen3-coder:30b-64k. OpenClaw is an agent: it sends long instructions and calls tools, so it needs a long context window (65,536 tokens) and good tool use. Our other models have 8K windows.
Is it private?
Yes. Requests run on our own Macs in our datacenter, and we never store prompts or answers, only counts for billing.