> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://respan.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://respan.ai/docs/_mcp/server.

# goose (gateway)

> Set up goose with the Respan gateway.

Route [goose](https://goose-docs.ai)'s LLM calls through the Respan gateway for automatic logging, caching, and model switching. goose's OpenAI provider accepts a custom host and path, so only your `RESPAN_API_KEY` is needed.

## Setup

#### Install goose

```bash
brew install block-goose-cli
```

Other platforms: see the [goose installation guide](https://block.github.io/goose/docs/getting-started/installation).

#### Set environment variables

Add to your shell profile (`.bashrc`, `.zshrc`, or PowerShell `$PROFILE`):

```bash
export GOOSE_PROVIDER="openai"
export GOOSE_MODEL="gpt-4o"
export OPENAI_API_KEY="YOUR_RESPAN_API_KEY"
export OPENAI_HOST="https://api.respan.ai"
export OPENAI_BASE_PATH="api/chat/completions"
```

`OPENAI_HOST` is the origin only. `OPENAI_BASE_PATH` is the path goose appends to it, so the two together resolve to `https://api.respan.ai/api/chat/completions`.

You can set the same values interactively with `goose configure`, choose **Configure Providers**, then **OpenAI**, and enter the host and key when prompted.

No separate OpenAI API key needed. The Respan gateway handles provider authentication.

#### Run goose

```bash
goose
```

For a one-shot, non-interactive run:

```bash
goose run -t "your prompt"
```

All LLM calls now route through Respan.

## Switch models

Change `GOOSE_MODEL` to use any of the 1000+ models available through the gateway.

```bash
export GOOSE_MODEL="gpt-4o"
# export GOOSE_MODEL="claude-sonnet-4-5-20250929"
# export GOOSE_MODEL="gemini/gemini-3.5-flash"
```

See the [full model list](https://platform.respan.ai/platform/models).