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

# Dify

> Install the NagaAI plugin from the Dify Marketplace and use NagaAI chat models in LLM nodes, chatflows and agents with one API key.

The NagaAI plugin on the [Dify Marketplace](https://marketplace.dify.ai/plugins/nagaai/nagaai) adds NagaAI as a model provider in Dify, so you don't have to set up a generic OpenAI-compatible provider and enter each model's context size and tool support by hand. Its models show up in every LLM model picker: LLM nodes, chatflows and agents.

Dify's plugin SDK talks to OpenAI-compatible providers through Chat Completions only, so the plugin sends its requests to `POST /v1/chat/completions`.

## Before you start

You need a NagaAI [API key](https://naga.ac/dashboard/api-keys) and Dify 1.0 or later, either Dify Cloud or a self-hosted instance with outbound HTTPS access to `api.naga.ac`.

## Connect Dify

**1. Install the plugin**

In Dify, open **Plugins**, find **NagaAI** in the Marketplace and install it. You can also start from the [plugin page](https://marketplace.dify.ai/plugins/nagaai/nagaai).

**2. Add the key**

Open **Settings** > **Model Provider** > **NagaAI**, paste the API key and save. Dify checks the key with a request to the model list, which isn't billed.

**3. Pick a model**

In an LLM node, a chatflow or an agent, open the model picker and choose a NagaAI model. The plugin ships four models with their limits filled in.

| Model | Context (tokens) | Max output (tokens) |
| - | - | - |
| `anthropic/claude-opus-5.5` | 1,000,000 | 128,000 |
| `anthropic/claude-sonnet-5.5` | 1,000,000 | 128,000 |
| `openai/gpt-6.1-sol` | 1,050,000 | 128,000 |
| `deepseek/deepseek-v4.1-flash` | 1,048,576 | 32,768 |

Each of them supports tool calling, image input, structured output and a **Reasoning effort** setting from `none` to `max`. NagaAI runs the nearest level the model supports.

## Add another model

Choose **Add Model** on the NagaAI provider and enter the model id exactly as [`GET /v1/models`](https://docs.naga.ac/get-started/models) lists it. Set the context size from `limits.context_window` of the model's `chat` operation in the same list, and turn on tool calling and vision only if the model's entry lists them. The list needs no key.

What each request cost is in [Logs](https://docs.naga.ac/account/logs.md) in your dashboard.

## Troubleshooting

### Dify rejects the key when you save it

Dify couldn't read the model list with this key. Check that you pasted an API key from the dashboard, with no spaces around it. On a self-hosted instance, also check that the server can reach `https://api.naga.ac` on port 443.

### 400 `model_not_found`

No model has the id you added. Copy the id from `GET /v1/models`, including the vendor prefix, such as `anthropic/claude-sonnet-5.5`.

### 402 `insufficient_quota`

The balance is too low for a paid model. Add credits on the [Credits](https://naga.ac/dashboard/credits) page.


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