Use Goose with a private API

Connect Goose to the private Morse API: set it up, pick a model, and check it works.

Goose is Block's open-source AI agent, which runs in a terminal or as a desktop app and works on the files in your folder. It speaks the OpenAI API, so it works with Morse: give it the base URL https://inference.trymorse.ai/v1 and a Morse API key, and its requests run on Morse's private inference, where Morse keeps nothing and no provider learns who you are.

Before you start

In the console, open API keys and make a key for Goose alone, with a spend limit, so a runaway session can't spend all your credits. See Limit a key. Then keep the key in your environment, where Goose reads it.

Terminal
export MORSE_API_KEY="sk_morse_..."

Set up Goose

  1. Add Morse as a provider

    Save this file as ~/.config/goose/custom_providers/morse.json (on Windows, %APPDATA%\Block\goose\config\custom_providers\morse.json). It names the base URL, the variable your key is in, and the models Goose may pick from.

    morse.json
    {
      "name": "morse",
      "engine": "openai",
      "display_name": "Morse",
      "description": "Private inference for open models",
      "api_key_env": "MORSE_API_KEY",
      "base_url": "https://inference.trymorse.ai/v1",
      "models": [
        {
          "name": "moonshotai/kimi-k2.7-code",
          "context_limit": 262144
        },
        {
          "name": "moonshotai/kimi-k3.1-pro",
          "context_limit": 1048576
        },
        {
          "name": "z-ai/glm-5.3",
          "context_limit": 1048576
        },
        {
          "name": "deepseek/deepseek-v4-pro-0813",
          "context_limit": 1048576
        },
        {
          "name": "z-ai/glm-5.3-flash",
          "context_limit": 1048576
        }
      ],
      "dynamic_models": false,
      "supports_streaming": true,
      "requires_auth": true
    }
  2. Choose Morse

    In a terminal, run goose configure, choose Configure Providers, and pick Morse. In goose Desktop, Morse is under Settings > Models > Configure providers.

  3. Start a session

    Terminal
    goose session --provider morse --model moonshotai/kimi-k2.7-code

Which model to pick

ModelContextInput / outputWhy
moonshotai/kimi-k2.7-code262.1K$0.95 / $4Kimi's coding model. It doesn't reason, so it starts writing sooner.
moonshotai/kimi-k3.1-pro1M$2 / $10Reasons, and reads images.
z-ai/glm-5.31M$1.40 / $4.40Reasons, and takes tools at TEE too.
deepseek/deepseek-v4-pro-08131M$1.32 / $3.96Reasons, at a lower price.
z-ai/glm-5.3-flash1M$0.15 / $0.50Cheap and fast for small edits, and takes tools at TEE too.

Prices are in dollars per million tokens, on each model's default endpoint. Every model is on the models page.

Check it works

In the session, ask Goose to list the files in your folder. It calls a tool to read them, so an answer shows that Morse took both the request and its tools. To switch models, end the session and start another with a different --model from the file.

Keep it private

A request runs on its model's default privacy tier. To hold Goose to a tier, such as one where only attested hardware reads your prompts, set a privacy floor on its key. See Privacy tiers and Provider routing.

If something goes wrong

What you seeWhat to do
Morse isn't in the list of providersCheck the file's name and folder, then start Goose again: it reads custom providers as it starts.
400 unsealable_requestThe key has a floor of tee and the model's TEE endpoint takes no tools. Pick a model that takes tools at TEE.
401The key is missing or wrong. Check that MORSE_API_KEY is set where Goose starts, and that the key isn't revoked.
402Add credits, or raise the key's limit. Morse holds credit for a request's output limit before it starts. See Holds.
404Use a model's id exactly as the table above writes it, lab and all.

Every code is in Errors. For other tools, see Coding agents and editors.