Skip to content

Use Goose with the Gateway

Goose is an open-source AI agent that automates coding tasks from your terminal or desktop. Connect it to the Gateway to run Goose through your regional endpoint with full data residency and budget controls.

Prerequisites


Option 1 — Use the built-in OpenAI provider

Goose's built-in OpenAI provider supports custom endpoints, so you can point it directly at the Gateway.

Goose Desktop

  1. Open Settings → Models → Configure providers
  2. Find OpenAI and click Configure
  3. Fill in:
Field Value
OpenAI API Key your LLM API key
OpenAI Host https://llm.[your-region].amazee.ai
OpenAI Base Path v1/chat/completions (default)
  1. Save, then pick a model from the list (for example claude-4-5-sonnet)

Goose CLI

Run the configuration command:

goose configure
  1. Select Configure Providers, then OpenAI. On a first run, Goose shows a setup wizard instead: choose Manual Configuration, then Search all providers..., type OpenAI and select it.
  2. Answer Yes to Would you like to set OPENAI_API_KEY?, then paste your LLM API key
  3. When asked Would you like to configure advanced settings?, answer Yes
  4. Leave OPENAI_BASE_URL empty
  5. Set OPENAI_HOST to https://llm.[your-region].amazee.ai
  6. Keep OPENAI_BASE_PATH as v1/chat/completions
  7. Press Enter to skip OPENAI_ORGANIZATION and OPENAI_PROJECT. When asked Would you like to set OPENAI_CUSTOM_HEADERS?, answer No (it defaults to Yes, and an empty value isn't accepted). Press Enter to keep the default OPENAI_TIMEOUT.
  8. Goose loads the model list from the Gateway. Type claude-4-5-sonnet to filter the list, then select it.

Answer Yes to advanced settings

The advanced settings prompt defaults to No. The host setting is behind it. If you skip it, Goose keeps the default host and sends your key to api.openai.com.

Replace [your-region] with your region code (e.g. ch103, us103).


Option 2 — Add a custom provider

Custom providers let you give the connection a friendly name (e.g. "Gateway") and store a list of preferred models. This is useful if you switch between multiple endpoints.

Goose CLI

goose configure
  1. Select Custom Providers, then Add A Custom Provider
  2. Answer the prompts:
Prompt Value
What type of API is this? OpenAI Compatible
What should we call this provider? amazee.ai (or any display name)
Provider API URL https://llm.[your-region].amazee.ai/v1
Does this provider require authentication? Yes
How should goose obtain credentials? Static API key
API key your LLM API key
Available models claude-4-5-sonnet, claude-4-5-haiku
Supports streaming? Yes
API base path leave empty

Config file

You can also create the provider config file directly. Save this as ~/.config/goose/custom_providers/amazeeai.json (macOS/Linux) or %APPDATA%\Block\goose\config\custom_providers\amazeeai.json (Windows):

{
  "name": "amazeeai",
  "engine": "openai",
  "display_name": "amazee.ai",
  "description": "amazee.ai regional AI gateway",
  "api_key_env": "AMAZEEAI_API_KEY",
  "base_url": "https://llm.[your-region].amazee.ai/v1",
  "models": [
    { "name": "claude-4-5-sonnet", "context_limit": 200000 },
    { "name": "claude-4-5-haiku", "context_limit": 200000 },
    { "name": "claude-4-5-opus", "context_limit": 200000 }
  ]
}

Each entry in models must be an object with a name. If you use plain strings, Goose skips the whole file without telling you.

Then set your API key as an environment variable in your shell profile (~/.zshrc, ~/.bashrc):

export AMAZEEAI_API_KEY="your-api-key-here"

Then run Goose with the provider:

goose run --provider amazeeai --model claude-4-5-sonnet -t "list the files in this directory"

Verify

Start a Goose session and give it a simple task:

goose
goose> list the files in this directory

Check the My usage card on the AI keys page to confirm requests are flowing through your regional endpoint.


Troubleshooting

Auth errors
Verify your API key is correct. For Option 1, check that OPENAI_API_KEY is set. For Option 2, check the environment variable named in api_key_env is exported.
Unknown provider: amazeeai (mentions the keychain)
Goose couldn't parse your custom provider file. The keychain is not the problem. Look in ~/.local/state/goose/logs/ for Failed to parse. Usually models is a list of strings instead of { "name": ... } objects, or name or engine is missing.
Model not found or 403 team_model_access_denied
The model ID doesn't exist or isn't enabled for your key. Run curl https://llm.[your-region].amazee.ai/v1/models -H "Authorization: Bearer $AMAZEEAI_API_KEY" and copy an ID from the list.
Connection errors
For Option 1, check that OPENAI_HOST is set to your Gateway URL and not api.openai.com. Make sure the host URL includes your region code and uses https://. For the custom provider config, the base_url should end with /v1.
Tool calling not working
Goose relies on tool calling support. Use Claude models (Sonnet, Haiku, Opus) which have full tool calling support through the Gateway.