Using BeatAPI in Dify

Using BeatAPI in Dify

Dify is an LLMOps platform for building chat apps, agents, and workflows. BeatAPI is added as a model provider once and is then selectable on every app in the workspace.

Prerequisites

  1. A Dify workspace — the cloud service or a self-hosted deployment.
  2. A BeatAPI API key — create one in Dashboard → API Keys.

Step 1: Open model settings

Click your avatar at the top right, choose Settings, then Model Provider in the left menu.

Step 2: Add BeatAPI

Two routes reach the same result. The first is faster; the second keeps BeatAPI separate from any other provider you use.

Option A: Reuse the OpenAI provider

  1. Find the OpenAI provider and click Configure.
  2. Fill in:
FieldValue
API KeyYour BeatAPI API key
API Base URLhttps://api.beatapi.io/v1
  1. Save, then enable the models you intend to use in the model list.

Dify’s OpenAI model list is Dify’s own; it is not read from the endpoint. Enabling a model that BeatAPI does not serve produces a not_found at run time, inside whatever app you built on it. Enable only IDs from the table below or from the pricing page.

Option B: Add a custom model provider

  1. Scroll to Custom Model and click + Add Model.
  2. Fill in:
FieldValue
Model NameBeatAPI or any label
Model TypeLLM
API KeyYour BeatAPI API key
API endpoint URLhttps://api.beatapi.io/v1
Endpoint model nameThe exact model ID, for example claude-sonnet-5

Repeat for each model you want available. This route is more typing but the list only ever contains models that actually work.

Step 3: Models

Model IDContextChoose it for
claude-fable-5-1LongThe newest generation, for demanding apps
claude-sonnet-5LongBalanced quality and cost
claude-haiku-4-5-20251001LongClassification, routing, and other cheap steps
gpt-6-astraLongThe newest OpenAI generation, billed flat
gemini-3.7-flashLongFast and inexpensive
deepseek-v4-pro-0813LongStrong reasoning at a low rate
minimax-m3Very longDocuments past the usual context ceiling

Full details are on the Text API pages; rates on the pricing page.

A few models change rate with load or context length: the DeepSeek family doubles on weekday peak hours in Beijing time, Hunyuan hy3 has its own daily peak window, and the GPT-5.6 and Grok families bill a higher tier past a context threshold. A Dify workflow that runs on a schedule can sit entirely inside a peak window without anyone noticing. See the pricing page footnotes.

Step 4: Build and publish

  1. Create an app — Chatbot, Text Generator, Agent, or Workflow.
  2. In Model Settings, select the BeatAPI model.
  3. Write the system prompt, using {{variable}} for user input and {{context}} for knowledge-base content.
  4. Test in the preview panel, then Publish — as an API, an embed, or a shared link.

Parameters worth setting

ParameterEffectSuggested
TemperatureOutput randomness0.7 creative, 0.3 precise
Max TokensOutput length cap2000–4000
Top PNucleus sampling0.9

FAQ

Dify cannot connect

  1. Base URL must be https://api.beatapi.io/v1 — with /v1, no trailing slash.
  2. Confirm the key is active in Dashboard → API Keys.
  3. Self-hosted deployments: confirm the Dify server can reach api.beatapi.io, not just your browser.

A model fails only at run time

It was enabled in Dify’s list but is not served by the account. Cross-check the ID against the pricing page.

402 insufficient_credits

The balance is exhausted. Add credits from the dashboard. A published app fails for its users while the balance is empty, so this is worth alerting on.

429 rate_limit_exceeded

The key exceeded its request rate — likely from a workflow fanning out. Reduce concurrency in the workflow, or raise the allowance; the per-minute rate rises with lifetime top-ups and is shown on the dashboard.

Controlling spend

  • Give each app its own BeatAPI key so by_api_key in GET /v1/usage attributes cost per app.
  • Route cheap steps — classification, routing, extraction — to a cheap model and reserve the strong model for the final answer.
  • Cap Max Tokens on every node; workflow nodes inherit generous defaults.

Support

Open a support ticket from the dashboard and include the request_id from the failing response.