Skip to main content
Dify can use NEAR AI Cloud through the OpenAI-API-compatible model provider plugin. Configure it as a custom provider, then add each NEAR AI Cloud model you want Dify apps to use.

Prerequisites

  • A Dify workspace where you are an owner or admin.
  • The Dify OpenAI-API-compatible model provider plugin installed or available from the marketplace.
  • A NEAR AI Cloud API key from the NEAR AI Cloud Dashboard.
Use these NEAR AI Cloud values unless you are intentionally testing a different model: The context and output limits above come from the live NEAR AI Cloud /v1/models metadata for z-ai/glm-5.2.

Install or Select the Plugin

In Dify, open Settings -> Model Providers. If OpenAI-API-compatible is not already listed, install it from the Dify marketplace. After installation, select OpenAI-API-compatible from the model provider list.

Add the NEAR AI Cloud Model

Add a custom model with these values: Keep the model name exactly as NEAR AI Cloud returns it. Do not rename it to glm-5.2, GLM-5.2-FP8, or an OpenAI model name unless /v1/models lists that exact ID for the gateway. The four capability fields below the limits default to “off” in the OpenAI-API-compatible plugin, so they must be set explicitly for GLM 5.2 (which advertises tools, structured_outputs, reasoning, and json_mode in /v1/models):
  • Function Call Type defaults to Not Support (no_call). With the default, the plugin does not send the OpenAI tools array to NEAR AI Cloud and marks the model non-tool-capable in agent apps. Set it to Tool Call to enable tool/agent use.
  • Thinking Mode Support defaults to Only Non-Thinking Mode (not_supported), which disables thinking and strips reasoning content from responses. Set it to Both Modes to expose the thinking toggle and the reasoning_effort parameter.
  • Compatibility mode defaults to strict. Set it to Enable extra settings so the thinking toggle is actually transmitted to the backend; in strict mode the enable_thinking parameter is not sent.
  • Structured Output defaults to Not Support. Set it to Support to expose the Response Format parameter (text / json_object / json_schema).
After entering the fields, use Dify’s provider test action. Save the model only after the test succeeds.

Refresh models

Dify custom providers do not necessarily receive the same automatic model updates that Dify system providers receive. Treat the OpenAI-API-compatible NEAR AI Cloud entry as a manual model list. When NEAR AI Cloud releases a new model:
  1. Fetch the live model metadata:
  2. Copy the new model’s exact id.
  3. In Dify, open Settings -> Model Providers -> OpenAI-API-compatible.
  4. Add a new custom model with the copied id, the same URL, and the context/output limits from the live metadata.
  5. Test and save the new model.
For GLM 5.2, the targeted metadata check is:

Curl smoke test

Before debugging Dify settings, verify the model appears in NEAR AI Cloud’s OpenAI-compatible model list:
Then test the same base URL, API key, and model with chat completions:
If curl fails, fix the NEAR AI Cloud key, model ID, or base URL before changing Dify settings.

Troubleshooting

Sources Checked

Sources checked on 2026-06-23: