All guides / App platforms

Use XHuoAPI in Dify

Dify's OpenAI-API-compatible provider is configured per model: each model you add gets its own endpoint and key entry.

Before you start

Verify first

Before touching the tool, confirm the key and model work with curl. This rules out half of the 'I configured it and nothing happens' cases.

curl https://api.xhuoapi.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v3.2","messages":[{"role":"user","content":"ping"}]}'

Steps

1

Avatar (top right) → Settings → Model Provider, find OpenAI-API-compatible and click Add Model.

2

Fill in: Model Type LLM, Model Name, API Key, API endpoint URL, plus context length and max output tokens.

Model Name:        deepseek-v4-pro
API endpoint URL:  https://api.xhuoapi.ai/v1
API Key:           sk-...
3

Dify sends a validation request on save. Once it passes, the model appears in the model dropdown of your apps.

Notes

Known issue: the OpenAI-API-compatible provider always sends max_tokens, but gpt-5.x models require max_completion_tokens, so validation fails with a 400. For gpt-5.x use Dify's built-in OpenAI provider with a custom base URL instead — it switches the parameter automatically for model names starting with gpt-5. DeepSeek, GLM, Kimi, Claude and gpt-4.x are unaffected.
Stop the base URL at /v1. Do not append /chat/completions; the client adds that path itself and you will get a 404 if you include it.
The model ID must match the pricing page exactly (deepseek-v4-pro, not DeepSeek V4 Pro). Case and hyphens matter.

Commonly used models

These are common choices for this kind of tool; click a model to see its price in each tier. The full list is on the pricing page.

Steps follow the tool's current official documentation; the UI may change after updates. Tell us if something no longer matches.