> ## 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.

# LiteLLM

> Connecting NanoGPT to LiteLLM's OpenAI-compatible router

> [!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).

# LiteLLM Integration

Configure LiteLLM to proxy requests through NanoGPT while preserving the legacy `reasoning_content` field expected by its OpenAI-compatible connector.

## Quick configuration

Add NanoGPT to your `litellm.yaml` (or the equivalent configuration source):

```yaml theme={null}
model_list:
  - model_name: nano-gpt
    litellm_params:
      model: openai/gpt-6.1-sol
      api_base: https://api.nano-gpt.com/api/v1legacy/
      api_key: ${NANO_GPT_API_KEY}
```

Set your API key before launching LiteLLM:

```bash theme={null}
export NANO_GPT_API_KEY='your-api-key-here'
litellm --config litellm.yaml
```

LiteLLM's OpenAI adapter expects streaming deltas in `delta.reasoning_content`, so the `v1legacy` endpoint is the recommended base URL. If you upgrade your LiteLLM deployment to parse the modern `delta.reasoning` field, you can switch the base URL to `https://api.nano-gpt.com/api/v1/` instead.

You can also swap `model` to `anthropic/claude-opus-5.5` or `google/gemini-flash-latest` if you want a different default.


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