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

# Agnai

> Connect Agnai to NanoGPT with an OpenAI-compatible chat preset.

Create a key at [nano-gpt.com/api](https://nano-gpt.com/api). Keep the key private; Agnai needs it to make requests using your balance or eligible subscription coverage.

## Create a chat preset

1. Open **Presets** and create or edit a generation preset.
2. Choose **Third-Party / Self-Host** as the service and **OpenAI (Chat Format)** as the format. Choose the chat format, rather than text completions. Labels can differ between Agnai releases.
3. Set **Third Party URL** to `https://nano-gpt.com/api/v1/chat/completions` and enable **Disable Auto-URL**. This tells Agnai to use the full address without adding another path.
4. Paste your NanoGPT key into **Third Party API Key**.
5. Set **Model Override** to `deepseek/deepseek-v4.1-flash-1017-uncensored`, or another exact ID from the [model catalog](https://nano-gpt.com/models/text).
6. Save the preset and select it for your chat. Send a short message and confirm that a reply arrives.

**Use Local Requests** makes the browser send requests instead of Agnai's server. Agnai states that multiplayer is unavailable with this option. Choose it only when that behavior suits your chat.

## Errors and long chats

An authentication error means the key needs checking. A model error needs the exact NanoGPT model ID, including its organization prefix. If an error names an unsupported sampler, remove that setting from the preset before trying again.

Character cards and memory inserts are assembled by Agnai. Keep stable character instructions near the start of the prompt and changing notes later to improve the opportunity for [cached input](https://docs.nano-gpt.com/integrations/long-chat-caching.md). Cache hits depend on the model and route.

Field behavior checked against [Agnai's preset source](https://github.com/agnaistic/agnai/blob/main/web/shared/PresetSettings/General.tsx) and [third-party fields](https://github.com/agnaistic/agnai/blob/main/web/shared/PresetSettings/Fields.tsx), November 29, 2026. This source check is not a live authenticated chat test.


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