What is goose?
goose is an open-source, extensible local AI agent with desktop and CLI provider configuration.
This goose guide uses its Custom Providers flow for an OpenAI-compatible endpoint. goose custom-provider JSON records a complete Chat Completions URL, while credentials stay in the environment or its secure key storage. goose supports several provider formats and its OpenAI-compatible custom-provider schema expects the complete Chat Completions endpoint rather than only an API root. Keep the credential outside shared JSON, select a model with native tool calling, and begin with a read-only development task in a new session.
goose documents three ways to create a Custom Provider: Desktop, CLI, and a provider file. TokenHub uses OpenAI Compatible. In goose's custom-provider schema, enter the full Chat Completions URL: https://us-api.tokenhub.com/v1/chat/completions.
Use the official goose Desktop path
- Click the sidebar button in the upper-left corner.
- Go to Settings → Models.
- Click Configure providers.
- Scroll to the bottom and click Add Custom Provider.
- Choose
OpenAI Compatiblefor Provider Type. - Enter
TokenHubfor Display Name. - Enter
https://us-api.tokenhub.com/v1/chat/completionsfor API URL. - Keep This provider requires an API key enabled and enter your TokenHub API key. Desktop stores it in the system keychain, or in
secrets.yamlwhen a keyring is unavailable. - Under Available Models, enter exact TokenHub model IDs separated by English commas.
- Enable Streaming Support and click Create Provider.
Desktop cannot currently add custom headers. If a deployment requires one, create the provider and edit its JSON afterward.
Use the official goose CLI path
Run:
goose configureThen follow the menu exactly:
- Select Custom Providers (Add custom provider with compatible API).
- Select Add A Custom Provider.
- Choose
OpenAI Compatiblefor API Type. - Name it
TokenHuband enter the full Chat Completions URL. - Answer Yes to Authentication Required, choose Static API key, and paste the TokenHub key.
- Enter the exact model IDs as a comma-separated list under Available Models.
- Enable Streaming Support. Add Custom Headers only if the endpoint actually requires them.
The CLI also supports Command (refreshable) for short-lived credentials. A normal TokenHub API key does not need that path.
Inspect the provider file goose generated
On macOS and Linux, files are under ~/.config/goose/custom_providers/. On Windows, use %APPDATA%\Block\goose\config\custom_providers\. The important fields should match:
{
"name": "tokenhub",
"engine": "openai",
"display_name": "TokenHub",
"api_key_env": "TOKENHUB_API_KEY",
"base_url": "__API_BASE_URL__/v1/chat/completions",
"models": [
{
"name": "YOUR_TOKENHUB_MODEL_ID",
"context_limit": 128000
}
],
"supports_streaming": true,
"requires_auth": true
}api_key_env is needed when you hand-write JSON. A static key entered through Desktop or CLI is stored securely by goose. Replace context_limit with the model's real limit.
Switch models and apply the change
In Desktop, go to Settings → Models → Switch models, choose the TokenHub provider and model, and click Select model. The goose documentation says a Custom Provider change takes effect in the next goose session, so do not test it in an old session.
Begin the new session with a read-only coding task and confirm the complete /v1/chat/completions path in TokenHub logs. For a 404, inspect API URL. If a model is invisible, check the comma-separated list or models[].name. If chat works but the agent cannot act, use a model that returns structured tool calls.
Official reference
Choose a compatible goose model
goose custom provider FAQ
Why does goose use the full Chat Completions URL?
The official goose custom-provider JSON format defines base_url as the complete endpoint for its OpenAI-compatible engine.
Where should I keep the TokenHub API key?
Use the custom provider credential flow or the TOKENHUB_API_KEY environment variable. Keep the value out of shared provider files.
Can any chat model power goose?
No. goose agent tasks need reliable native tool calling, so validate that behavior on a safe task before using an unfamiliar model.
How do I verify a goose custom provider?
Select the declared model in a new session, run a read-only task, and confirm the Chat Completions path, model ID, and status in TokenHub logs.
Why do goose tool calls fail even though chat works?
The model may only produce text. goose agent work needs native structured tool calls, so switch to a verified tool-capable model.
References
This setup is based on TokenHub and official documentation, last verified on 2026-09-08.