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

  1. Open the model providers

    Click your avatar → Settings → Model Provider. In recent versions the same page is under Integrations → Model Provider.

  2. 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.

  3. Add a model

    On the provider's card, click Add Model and fill in:

    FieldValue
    Model TypeLLM
    Model Nameqwen/qwen3.5-9b
    API KeyYour Stac key
    API Base URLhttps://api.trystac.com/v1
    Completion modeChat
    Model context sizeRaise it — Dify's default of 4096 is far too small
    Function Call TypeTool 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.

  4. 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 503 if generation runs past roughly 90 seconds.
  • Instructions turn off automatic retrieval. When the app has instructions, Dify sends them as a system message, 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_bias is dropped, and rate limits are per key. See Differences that matter.

Next steps