Use Factory Droid with Datagram

Run Factory's Droid coding agent on open models hosted on our own Apple Silicon, with a custom model in settings.json.

Works with Datagram AI

All guides · API quickstart · Last checked: Settings from the app's official documentation, November 2026; requests use our standard OpenAI-compatible API

  1. 1. Create an accountSign up in a minute and get $5 of free credit. Already a customer? Sign in.
  2. 2. Make an API keyIn your account, open AI API and press Create key. Keys start with dgk_. Keep yours secret.
  3. 3. Follow the steps belowCopy each block, paste your key where it says dgk_your_key_here.

1. Add Datagram as a custom model

Edit ~/.factory/settings.json (Windows: %USERPROFILE%\.factory\settings.json) and add:

{
  "customModels": [
    {
      "model": "qwen3-coder:30b-64k",
      "displayName": "Qwen3-Coder 30B (Datagram)",
      "baseUrl": "https://api.datagram.net/v1",
      "apiKey": "${DATAGRAM_API_KEY}",
      "provider": "generic-chat-completion-api",
      "maxOutputTokens": 8192,
      "maxContextLimit": 57344
    }
  ],
  "compactionTokenLimit": 50000
}

Then export DATAGRAM_API_KEY=dgk_your_key_here in the shell you start Droid from. (Or add it in Droid: /model → Manage custom models → Add model; it writes the same file.)

maxContextLimit is the window minus the answer length (65,536 − 8,192). Droid starts compacting the conversation at 250,000 tokens by default, far beyond this model, so compactionTokenLimit brings that below the window. Edit settings.json, not the older config.json.

2. Pick it and try it

Run droid, type /model and choose Qwen3-Coder 30B (Datagram) under Custom Models. The first answer can take 10 to 20 seconds while the model loads.

Which model?

qwen3-coder:30b-64k. A coding agent sends long instructions and calls tools on every step, so it needs the 65,536-token window and good tool use. Our other models have 8,192 tokens, which is too small for agent work.

Factory notes that custom models aren't tested by them and that models under about 30B struggle with agentic coding; this one is right at that size, so it suits everyday tasks better than very large refactors.

If something goes wrong

401 "Missing API key" or "Invalid or revoked API key"

Check the key is set where the tool reads it (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.

Long sessions fail with a context error

Lower compactionTokenLimit so Droid compacts before reaching the model's window.

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.

Create an account Get an API key More guides →