Use goose with Datagram

Run Block's open-source goose agent on open models hosted on our own Apple Silicon, with a custom provider file that takes two minutes to set up.

Works with Datagram AI

All guides · API quickstart · Last checked: goose documentation, November 2026; the requests goose sends were tested against our live 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 provider

goose reads custom providers from ~/.config/goose/custom_providers/. Save this as ~/.config/goose/custom_providers/datagram.json:

{
  "name": "datagram",
  "engine": "openai",
  "display_name": "Datagram",
  "description": "Private open models on Datagram's Apple Silicon",
  "api_key_env": "DATAGRAM_API_KEY",
  "base_url": "https://api.datagram.net/v1/chat/completions",
  "models": [
    { "name": "qwen3-coder:30b-64k", "context_limit": 65536 }
  ],
  "supports_streaming": true,
  "requires_auth": true
}

Note that base_url is the full address, ending in /chat/completions. You can also make the file from goose configure → Custom Providers → Add A Custom Provider, choosing OpenAI Compatible.

2. Give goose your key

The file names the variable that holds your key. Add it to your shell profile (~/.zshrc or ~/.bashrc):

export DATAGRAM_API_KEY="dgk_your_key_here"

3. Try it

In a project folder, run one task:

goose run --provider datagram --model qwen3-coder:30b-64k -t "List the files here and tell me what this project does"

If that works, start an interactive session with the same --provider and --model, or make Datagram your default in goose configure. The first answer can take 10 to 20 seconds while the model loads.

If something goes wrong

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

goose didn't find your key. Check echo $DATAGRAM_API_KEY prints it in the same terminal you run goose from, and that the name matches api_key_env in the file.

The provider doesn't show up

Check the file is valid JSON (no trailing commas) and sits in ~/.config/goose/custom_providers/. Run goose info -v to see the settings goose is using.

It loses track of long tasks

Use qwen3-coder:30b-64k with "context_limit": 65536. Models without -64k have 8K windows, too small for an agent.

402 "credit has run out"

Add credit in your account under AI API. Credit never expires.

Questions

Which model should I use with goose?

qwen3-coder:30b-64k. goose is an agent: it sends long instructions and calls tools (reading files, running commands), so it needs a model that is good with tools and has a long context window. Our other models have 8K windows, which is too small for an agent.

Does it work with Buzz?

Buzz, Block's workspace for teams and AI agents, runs agents such as goose and Claude Code. Set goose (or Claude Code) up with Datagram as in our guides on the machine where the agent runs, and Buzz uses that.

What does it cost?

The normal token price of the model, from your Datagram credit, with repeated (cached) input at a tenth of the input price where it can be measured. You can see your use in your account under AI API.

Is my code 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 →