NezhaGateNezhaGate

Dify connects any OpenAI-compatible service through the OpenAI-API-compatible model provider. Add each model on its own, and change a few defaults.

Written against Dify 1.17 · OpenAI-API-compatible 0.0.68

Before you start

  • A workspace owner or admin account; only they can set up model providers.
  • Install OpenAI-API-compatible (the official langgenius plugin) from the Marketplace.

Add a model

Open Model Provider (under Integrations in newer versions, Settings in older ones), click Add Model on the OpenAI-API-compatible card and fill in the form as below:

FieldValue
Model TypeLLM
Model NameThe exact model id, such as gpt-5.5
API KeyYour NezhaGate API key
API Base URLhttps://nezhagate.com/v1
Completion modeChat
Model context sizeThe model's real context length (see its API doc). The default is 4096; left as is, long conversations get cut.
Upper bound for max tokensThe model's maximum output tokens; this also defaults to 4096.
Function Call TypeTool Call for models with tool calling. The default, Not Support, keeps agents from calling tools.
Vision SupportSupport, for models that take image input.
API TypeKeep Chat Completions API.

The address must include /v1: the plugin appends /chat/completions directly. Leave the other fields at their defaults.

Claude (optional)

You can also install the official Anthropic plugin, set API URL to https://nezhagate.com/anthropic, and add Claude models one by one with Add Model (such as claude-sonnet-5).

Test

Saving sends one very short request to validate (billed on its tiny usage). Then create a chatbot in Studio, pick the model and send a message in the preview.

Troubleshooting

Credentials validation failed with status code 404

The address is missing /v1; it should be https://nezhagate.com/v1.

Validation returns 401 or model not found

401 means the key is wrong; model not found means the model id is misspelled. Use the ids in the API reference.

The agent never calls tools

Function Call Type is still Not Support in the model form; change it to Tool Call.

Long answers or conversations get cut

Model context size and Upper bound for max tokens are still at 4096; raise them to the model's real values.

More integrations