> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# goose

> Use deAPI's LLMs in goose, the open-source AI agent for the terminal and desktop, through a custom provider file and the OpenAI-compatible endpoint.

[goose](https://github.com/aaif-goose/goose) is an open-source AI agent that works in your terminal and as a desktop app. It reads custom providers from JSON files, so adding deAPI takes one file and your API key. The chat models are served through the OpenAI-compatible endpoint at `https://oai.deapi.ai/v1`.

The steps below were checked with goose 1.61 and `qwen3.8-flash`, in a chat and with a tool call.

***

### Prerequisites

* goose installed. See the [goose installation guide](https://goose-docs.ai/docs/getting-started/installation).
* A deAPI API key from the [deAPI Dashboard](https://app.deapi.ai/settings/api-keys). See [API Keys](https://docs.deapi.ai/api-keys.md).

***

### 1. Add the provider file

Save the file below as `deapi.json` in goose's `custom_providers` directory:

| System | Path |
| - | - |
| macOS and Linux | `~/.config/goose/custom_providers/deapi.json` |
| Windows | `%APPDATA%\Block\goose\config\custom_providers\deapi.json` |

```json deapi.json theme={null}
{
  "name": "deapi",
  "engine": "openai",
  "display_name": "deAPI",
  "description": "LLMs on deAPI through its OpenAI-compatible API",
  "api_key_env": "DEAPI_API_KEY",
  "base_url": "https://oai.deapi.ai/v1/chat/completions",
  "models": [
    { "name": "deepseek-v4.1-flash", "context_limit": 1000000 },
    { "name": "deepseek-v4.1-flash:economy", "context_limit": 1048576 },
    { "name": "glm-5.3", "context_limit": 1000000 },
    { "name": "glm-5.3-flash", "context_limit": 1048576 },
    { "name": "gpt-6-luna", "context_limit": 1050000 },
    { "name": "hy3", "context_limit": 262144 },
    { "name": "kimi-k3", "context_limit": 1000000 },
    { "name": "qwen3.8-flash", "context_limit": 1000000 },
    { "name": "qwen3.8-max", "context_limit": 1000000 },
    { "name": "seed-2.0-lite", "context_limit": 262144 },
    { "name": "seed-2.0-mini", "context_limit": 262144 },
    { "name": "seed-2.0-pro", "context_limit": 262144 },
    { "name": "seed-2.1-turbo", "context_limit": 262144 },
    { "name": "gemini-3.8-flash", "context_limit": 1048576 }
  ],
  "supports_streaming": true,
  "requires_auth": true
}
```

The current list of chat models and their context sizes is always in `GET https://oai.deapi.ai/v1/models`. See [Chat completions](https://docs.deapi.ai/openai-compatibility.md#chat-completions-llms).

***

### 2. Set your API key

```bash theme={null}
export DEAPI_API_KEY="sk-dp-1234-AbCdEf..."
```

In goose Desktop you can instead open **Settings → Models → Configure providers**, select **deAPI** and paste the key there. goose then keeps it in its keychain.

***

### 3. Start a session

```bash theme={null}
goose session --provider deapi --model qwen3.8-flash
```

To make deAPI the default, set `GOOSE_PROVIDER=deapi` and `GOOSE_MODEL=qwen3.8-flash`, or choose them in `goose configure`.

***

### Choosing a model

* `qwen3.8-flash` is a fast, low-cost default for everyday agent work.
* `qwen3.8-max` and `kimi-k3` suit long, multi-step tasks.
* Every model supports tool calling, which goose uses for its extensions.

These models reason before they answer, and reasoning tokens are billed as output tokens. For prices and per-model details, see [Chat completions](https://docs.deapi.ai/openai-compatibility.md#chat-completions-llms).

> [!TIP]
>
> To let goose show what a session cost, add `input_token_cost` and `output_token_cost` (USD per token) to each model in the file. The values are in `pricing` on each model in `GET /v1/models`.

***

### Troubleshooting

| Symptom | Cause |
| - | - |
| `401 invalid_api_key` | `DEAPI_API_KEY` is not set in the shell that started goose, or the key is no longer active |
| `429 insufficient_quota` | The account balance or the key's spend limit is used up |
| deAPI is not in the provider list | The file is not in the `custom_providers` directory, or it is not valid JSON |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.