Integrations
Dify
Add your stack to Dify as an OpenAI-API-compatible model provider and use it in chatbots, workflows and agents.
Dify is a platform for building LLM apps — chatbots, workflows and agents — in a visual editor. Its OpenAI-API-compatible model provider accepts a custom base URL, so your stack shows up in every model picker in the workspace.
Prerequisites
- A key from your stack's API keys page. See Authentication.
- The id of the model you want to call — see Models. The
examples below use
qwen/qwen3.5-9b. - Workspace admin rights in Dify, to add a model provider.
Add the model
Open the model providers
Click your avatar → Settings → Model Provider. In recent versions the same page is under Integrations → Model Provider.
Install OpenAI-API-compatible
Since Dify 1.0 providers are plugins. If OpenAI-API-compatible isn't listed, install it from the Marketplace section on the same page.
Add a model
On the provider's card, click Add Model and fill in:
Field Value Model Type LLM Model Name qwen/qwen3.5-9bAPI Key Your Stac key API Base URL https://api.trystac.com/v1Completion mode Chat Model context size Raise it — Dify's default of 4096 is far too small Function Call Type Tool Call, if the model supports tool calling; otherwise leave Not Support Leave the other fields on their defaults. Older versions of the plugin label the URL field API endpoint URL.
Save
Dify validates the credentials with a test call before saving. A saved model means the key and URL work.
Example
Create a Chatbot app, pick qwen/qwen3.5-9b in the model selector at
the top right of the editor, and send a message in the Debug and Preview
panel:
You: Name three primary colors.
Assistant: Red, blue, and yellow.The request shows up under Usage & Logs in the dashboard, the same as any other client.
Limitations
- The model name must be on your plan. Type the exact value from
Models in Model Name; a model your key's plan doesn't
include returns
403. - Agents need tool calling. Agent apps and agent nodes only call tools when Function Call Type is set and the model supports tool calling.
- Long blocking calls time out. Streaming apps are fine; a workflow node
that waits for the full answer fails with
503if generation runs past roughly 90 seconds. - Instructions turn off automatic retrieval. When the app has
instructions, Dify sends them as a
systemmessage, and a key left on Automatic then skips the knowledge base. Set it to Enabled on the key Dify uses. - One completion per request,
logit_biasis dropped, and rate limits are per key. See Differences that matter.
Next steps
- OpenAI compatibility — what the provider is talking to, and what differs from OpenAI.
- Knowledge base — when to use Stac's retrieval instead of Dify's knowledge feature.
- Errors & rate limits — which status codes to retry.