Connect a Dify workflow to ChinaGenAI through Dify's OpenAI-API-compatible model provider. The setup uses one site key, a custom API base and the free model label. The endpoint routes requests automatically; this guide does not promise a particular upstream model or Dify feature.
ChinaGenAI exposes POST /v1/chat/completions. If your Dify plugin shows an API Type field, choose Chat Completions API, not Responses. The site endpoint does not expose embeddings, image or audio APIs.
Install Dify's compatible model provider
- In Dify, open Integrations → Model Provider or its Marketplace and install OpenAI-API-compatible.
- Add a customizable model with type LLM. Use the values below for the Chat Completions route.
| Dify field | Value | What it means |
|---|---|---|
| Model type | LLM | Text chat uses the model's language-model route. |
| Model name | free | The exact route label sent in the Chat Completions request. |
| API Key | Your ChinaGenAI site key | Issue or check it through API access; a provider-owned key is a different credential. |
| API Base URL | https://chinagenai.com/v1 | Use the base only. Dify appends the selected chat endpoint. |
| Completion mode | Chat | The gateway accepts Chat Completions, not the legacy text-completion route. |
| API Type | Chat Completions API | If this optional field appears in your plugin version, keep it on /chat/completions. |
| Endpoint model name | free | If shown, enter the same ID; otherwise the optional override can stay blank and Dify uses Model Name. |
Make one short workflow request
After adding the model, select it in a simple Chatflow or workflow node and send one short text prompt. Dify validates credentials during setup, and the compatible provider performs a small request to the configured model endpoint. Treat that validation as a real API call; save the model only when you are ready to use the site key.
Start with one message and a short output. ChinaGenAI currently accepts up to 6 messages and 6,000 serialized input characters, permits one active request per key and two across the site, and caps output at 256 tokens. Dify workflow instructions and conversation history count toward the input. Keep the node's requested output at 256 tokens or less.
Keep model capabilities honest
The endpoint supports text Chat Completions. Although Dify's plugin also lists embeddings, reranking, image, audio and other model types, this site does not expose those APIs. Function tools and JSON settings can be forwarded, but the active upstream model may not support them. Enable those features only after verifying them with the model actually routed to your request.
If Dify cannot connect, replace an expired site key for a 401, check the base URL and free model name for a 400, and review current service status before retrying a 429 or 503. Read the general connection guide for the current limits and route behavior.
Official Dify references
- Dify: Model Providers — install, configure and validate a provider.
- Dify OpenAI-API-compatible plugin README — model type, name, API key, base URL and completion mode.
- Dify plugin configuration schema — optional endpoint model name and Chat Completions versus Responses selection.
Dify's documentation was checked on 21 October 2026. These are documentation-based settings; no Dify workspace or live model request was tested.
Free API access and limits
Check the site free API access and limits before trying to obtain a site key. Read the current status and request limits before using a site key. It is not a source of official provider keys.
ChinaGenAI is not affiliated with the providers named here. This release contains setup guidance and explicitly labeled fictional examples, not claimed live model benchmarks.