Skip to main content

Overview

Goose supports two approaches to adding custom providers:
  1. Declarative Providers - JSON configuration files for OpenAI/Anthropic/Ollama-compatible APIs
  2. Rust Implementation - Full Provider trait implementation for custom logic
This guide focuses on declarative providers, which cover most use cases.

Declarative Providers

Declarative providers let you add OpenAI-compatible APIs without writing Rust code. They’re perfect for:
  • Commercial API providers (Together, Groq, Fireworks, etc.)
  • Self-hosted LLM servers (vLLM, text-generation-inference)
  • OpenRouter and other aggregator services
  • Custom proxy endpoints

Provider Engines

Choose the engine that matches your API format:
  • openai - OpenAI Chat Completions API format
  • anthropic - Anthropic Messages API format
  • ollama - Ollama API format
Most providers use the OpenAI format.

Configuration Structure

Configuration Fields

string
required
Unique identifier for the provider (auto-generated from display_name)
string
required
API format: openai, anthropic, or ollama
string
required
Human-readable name shown in UIs
string
Optional description of the provider
string
Environment variable name for the API key (required if requires_auth is true)
string
required
Base URL of the API endpoint
array
required
List of available models with their context limits
boolean
default:"true"
Whether the provider requires authentication
boolean
default:"true"
Whether the provider supports streaming responses
number
default:"600"
Request timeout in seconds
object
Optional custom headers to include in requests
string
Optional API path (defaults based on engine)

Creating Custom Providers

Method 1: Configuration File

Create a JSON file in ~/.config/goose/custom_providers/:

Method 2: Programmatic Creation (Rust)

The API key is automatically stored in the system keyring.

Example Providers

Together.ai

Fireworks.ai

OpenRouter

Self-Hosted vLLM

Anthropic-Compatible Provider

For providers using Anthropic’s API format:

Managing Custom Providers

List Providers

Update Provider

Delete Provider

Or programmatically:

Refresh Providers

After adding/removing provider files:

Advanced Configuration

Custom Headers

Add provider-specific headers:

Base Path Customization

Override the default API path:

No Authentication

For providers that don’t require auth:

Multiple Model Configurations

Implementing Provider Trait (Advanced)

For full control, implement the Provider trait:
Then register it:

Troubleshooting

Provider Not Found

Check that the JSON file is in the correct location:

Invalid Configuration

Validate your JSON:

Authentication Errors

Verify the API key environment variable:

Connection Errors

Test the API endpoint:

See Also