All guides · API quickstart · Last checked: Settings from the app's official documentation, November 2026; requests use our standard OpenAI-compatible API
- 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. Point Aider at Datagram
export OPENAI_API_BASE=https://api.datagram.net/v1
export OPENAI_API_KEY=dgk_your_key_here
aider --model openai/qwen3-coder:30b-64k
On Windows, use setx OPENAI_API_BASE ... and setx OPENAI_API_KEY ..., then open a new terminal. The openai/ prefix tells Aider to use the OpenAI-compatible connection.
2. Tell Aider the context window
Aider doesn't know our models' sizes. Create .aider.model.metadata.json in your home folder (or the repo root):
{
"openai/qwen3-coder:30b-64k": {
"max_tokens": 8192,
"max_input_tokens": 65536,
"max_output_tokens": 8192,
"input_cost_per_token": 0,
"output_cost_per_token": 0,
"litellm_provider": "openai",
"mode": "chat"
}
}
Costs are set to 0 because Aider can't know your Datagram prices; your real use is in your account under AI API.
3. Try it
Ask Aider for a small change. The first answer can take 10 to 20 seconds while the model loads. If edits don't apply cleanly, try --edit-format whole, the simplest format.
If something goes wrong
401 "Missing API key" or "Invalid or revoked API key"
Check the key is pasted in full (it starts with dgk_) and hasn't been revoked in your account under AI API.
402 "credit has run out"
Add credit in your account under AI API. Credit never expires.
"Unknown context window" warning
Add the metadata file above; the key must be exactly openai/qwen3-coder:30b-64k.
Questions
Which model should I use?
qwen3-coder:30b-64k. Coding agents send long instructions and call tools, so they need its 65,536-token window. Our other models have 8,192 tokens.
Is it private?
Yes. Requests run on our own Macs in our datacenter, and we never store prompts or answers, only counts for billing.