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

# Goose

> Using NanoGPT with goose through a custom provider file

> [!NOTE]
>
> These examples use the direct API host, `https://api.nano-gpt.com`. It has no IPv6 address, so clients with only IPv6 should use `https://nano-gpt.com` with the same paths. See [API Hosts](https://docs.nano-gpt.com/api-reference/miscellaneous/api-hosts.md).

# Using goose with NanoGPT

[goose](https://github.com/aaif-goose/goose) connects to OpenAI-compatible services through a custom provider file. Save the file below and goose lists NanoGPT like any other provider.

## Setup

1. Get your API key from [nano-gpt.com/api](https://nano-gpt.com/api).

2. Save this file as `nanogpt.json` in goose's `custom_providers` directory:

   * macOS and Linux: `~/.config/goose/custom_providers/`
   * Windows: `%APPDATA%\Block\goose\config\custom_providers\`

   ```json theme={null}
   {
     "name": "nanogpt",
     "engine": "openai",
     "display_name": "NanoGPT",
     "description": "NanoGPT OpenAI-compatible API",
     "api_key_env": "NANOGPT_API_KEY",
     "base_url": "https://api.nano-gpt.com/api/v1/chat/completions",
     "models": [
       {
         "name": "anthropic/claude-sonnet-5.5",
         "context_limit": 1000000
       },
       {
         "name": "deepseek/deepseek-v4.1-flash",
         "context_limit": 1000000
       }
     ],
     "supports_streaming": true,
     "requires_auth": true
   }
   ```

3. Set your key and start goose with the NanoGPT provider:

   ```bash theme={null}
   export NANOGPT_API_KEY='your-api-key-here'
   goose session --provider nanogpt --model anthropic/claude-sonnet-5.5
   ```

   To run a single prompt instead of a session:

   ```bash theme={null}
   goose run --provider nanogpt --model anthropic/claude-sonnet-5.5 -t "Summarize this repository"
   ```

## Adding models

Add any NanoGPT text model to the `models` list. goose needs tool calling, so pick models whose `capabilities.tool_calling` is `true`. [`GET /api/v1/models?detailed=true`](https://docs.nano-gpt.com/api-reference/endpoint/models) returns that flag and each model's `context_length`; set `context_limit` to that value or lower.

This file was checked with goose 1.61.1. goose sends its requests, including its tool definitions, to [`/api/v1/chat/completions`](https://docs.nano-gpt.com/api-reference/endpoint/chat-completion) with your key as a Bearer token.


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