> For the complete documentation index, see [llms.txt](https://docs.tensorx.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tensorx.ai/ai-coding-assistants/goose.md).

# Goose

Use TensorX models with Goose — the open-source, on-machine AI agent by Block (Square).

***

## Overview

[Goose](https://block.github.io/goose) is an open-source agent by Block with support for declarative custom providers.

***

## Prerequisites

* **macOS, Linux, or Windows**
* A TensorX API key ([sign up here](https://app.tensorx.ai/register))

***

## Installation

{% tabs %}
{% tab title="macOS (Homebrew)" %}

```bash
brew install block/tap/goose
```

{% endtab %}

{% tab title="Linux / macOS (curl)" %}

```bash
curl -fsSL https://github.com/block/goose/releases/latest/download/download_cli.sh | bash
```

{% endtab %}

{% tab title="Desktop App" %}
Download from [block.github.io/goose](https://block.github.io/goose)
{% endtab %}
{% endtabs %}

***

## Configuration

### Option 1: Using OpenAI-Compatible Provider

Set environment variables and configure Goose:

```bash
export TENSORX_API_KEY=your-tensorx-api-key-here
```

Then configure via the CLI:

```bash
goose configure
```

When prompted:

1. Choose **OpenAI Compatible** as the provider
2. Enter `https://api.tensorx.ai/v1` as the base URL
3. Enter your model name: `z-ai/glm-5.3`

### Option 2: Settings File

Edit `~/.config/goose/config.yaml`:

```yaml
GOOSE_PROVIDER: openai-compatible
GOOSE_MODEL: z-ai/glm-5.3
OPENAI_BASE_URL: https://api.tensorx.ai/v1
OPENAI_API_KEY: your-tensorx-api-key-here
```

{% hint style="warning" %}
Replace `your-tensorx-api-key-here` with your actual TensorX API key from [app.tensorx.ai](https://app.tensorx.ai/dashboard).
{% endhint %}

***

## Model selection

Call `GET /v1/models` with your TensorX API key and use one of the returned IDs. If the integration depends on a capability or token limit, query `GET /v1/model/info` before selecting the model. See [Models](/api-reference/models.md) for examples.

***

## Usage

Start an interactive session:

```bash
goose session
```

Or run a one-shot command:

```bash
goose run "refactor the auth module to use JWT tokens"
```

Goose can:

* Read and edit files in your project
* Run terminal commands
* Search your codebase
* Connect to external tools via MCP extensions

***

## Troubleshooting

### Model Not Responding

1. Verify your API key: `echo $TENSORX_API_KEY`
2. Test the connection:

   ```bash
   curl https://api.tensorx.ai/v1/models \
     -H "Authorization: Bearer $TENSORX_API_KEY"
   ```

### Provider Not Found

Run `goose configure` to reconfigure your provider settings.

***

## See Also

* [Goose Documentation](https://block.github.io/goose)
* [Goose on GitHub](https://github.com/block/goose)
* [Goose Custom Providers](https://github.com/block/goose/blob/main/CUSTOM_DISTROS.md)
* [TensorX Models](https://tensorx.ai/models)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tensorx.ai/ai-coding-assistants/goose.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
