Use Aider with a private API

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

Give Aider the base URL https://inference.trymorse.ai/v1 and a Morse API key. It calls the OpenAI API.

Before you start

Make a key for Aider alone, with a spend limit, under API keys in the console. Then one tool can't spend all your credits. See Limit a key. Keep the key in your environment, where Aider reads it.

Terminal
export MORSE_API_KEY="sk_morse_..."

Set up Aider

  1. Describe the model to Aider

    Add an entry for the model to .aider.model.settings.yml, in your home directory or your repository. It sets the edit format, leaves out temperature, and lets --reasoning-effort reach the model.

    .aider.model.settings.yml
    - name: openai/qwen/qwen3-coder
      edit_format: diff
      use_repo_map: true
      use_temperature: false
      accepts_settings: ["reasoning_effort"]

    The name must match --model exactly. An entry replaces everything Aider would guess about the model, so keep edit_format in it.

  2. Start Aider

    In your repository, point Aider at Morse and start it. To use another model from the table below, change --model and the entry's name.

    Terminal
    export OPENAI_API_BASE=https://inference.trymorse.ai/v1
    export OPENAI_API_KEY="$MORSE_API_KEY"
    aider --model openai/qwen/qwen3-coder

Which model to pick

ModelContextInput / outputWhy
qwen/qwen3-coder262.1K$0.375 / $1.25Qwen'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

Ask Aider to change a line in one of your files. It writes the edit as text and commits it, so a new commit shows that Morse took the request. Aider needs no tool calls.

Keep it private

Set a privacy floor on Aider's key to hold it to a tier, such as TEE. Without a floor, a request runs on its model's default privacy tier. The floor only decides which endpoints serve the requests. See Privacy tiers and Provider routing.

On a plain API call, TLS ends inside Morse's door, an attested enclave, which seals the request before the relay receives it. A plain client checks the door's certificate, not its attestation. To check the attestation yourself, see Sealed API keys.

If something goes wrong

What you seeWhat to do
400 setting_not_forwardedAdd use_temperature: false to the model's entry.
401 invalid_api_keyCheck that MORSE_API_KEY is set where Aider starts, and that the key isn't revoked.
402 insufficient_balance or key_spend_limit_reachedAdd credits, or raise the key's spend limit. A request holds credit for its output limit before it starts: see Holds.
404 model_not_foundUse a model's id exactly as the table above writes it, with the part before the slash.

Every code is in Error codes. For other tools, see Tools and coding agents.