Back to guides
Pricing·September 21, 2026·9 min read

Dify pricing and model API cost: plans, credits and the token bill

Dify's plan fee buys the platform; message credits only buy a trial. Separate the two layers before you budget a workflow, a RAG index or an agent.

Last reviewed on .

Dify pricing has two layers that are billed by two different parties: the platform plan, and the model tokens. Dify Cloud lists Sandbox at $0, Professional at $59 per workspace per month ($590 a year) and Team at $159 per workspace per month ($1,590 a year); the self-hosted Community Edition is free and Enterprise is a custom quote. None of those numbers include your model API spend once the plan's message credits run out — Dify's own plan cards say so.

All figures below were read on September 19, 2026 from Dify's own pages: dify.ai/pricing/dify-cloud and dify.ai/pricing/dify-enterprise. One reading note, because it trips up summaries: the plan cards render the annual figures by default and the monthly ones sit behind a toggle. The monthly values are in the markup (data-monthly="59" and data-monthly="159") and the comparison table further down the same page prints "$59 Per workspace/month" and "$159 Per workspace/month" in plain text. Treat any third-party page quoting only annual prices as incomplete.

What the Dify platform costs

ChannelPublished priceMessage creditsKey limits on the card
Dify Cloud — SandboxFree200 (card shows no "/ month" suffix)1 workspace, 1 member, 5 apps, 50 knowledge documents, 50MB knowledge storage, 30 days log history
Dify Cloud — Professional$59 / workspace / month, or $590 / year5,000 per month3 members, 50 apps, 500 knowledge documents, 5GB storage, 20,000 trigger events per month, unlimited log history
Dify Cloud — Team$159 / workspace / month, or $1,590 / year10,000 per month50 members, 200 apps, 1,000 knowledge documents, 20GB storage, unlimited trigger events
Community Edition (self-hosted)Free softwareNoneSingle workspace; you supply servers, vector database and all model tokens
Dify EnterpriseCustom quoteNoneLicense key on a self-hosted deployment; multiple workspaces, SSO, commercial license authorization
Dify Premium on AWSQuoted only in AWS MarketplaceNoneAn AMI that allows custom branding; the docs page states no price, so none is reproduced here

Two constraints worth knowing before you pick a tier. Dify's FAQ takes the question of whether a Professional plan that has hit its limits can buy more vector space or team seats independently, and answers that it recommends upgrading the plan — and that if the Team plan does not suffice you should contact its support address. So the documented remedy for a limit is the next tier, not a top-up. And payment is by card today: the same FAQ says paying by bank transfer is being explored, is not yet available, and would apply only to annual Team subscriptions. Listed prices exclude applicable taxes.

Message credits are a trial allowance, not a budget

This is the part most "Dify pricing" summaries get wrong. The tooltip on all three Cloud plan cards reads that credits are provided to help you try out models from OpenAI, Anthropic, Gemini, xAI and Tongyi, that they are consumed based on the model type, and that once they are used up you can switch to your own API key. They are not a token budget: Dify's FAQ states that credits are consumed per AI response, at a published per-model rate.

The rates below are read from Dify's FAQ on September 19, 2026 — a selection of its list rather than the whole of it: each rung names more models than the examples quoted here, and the published ladder also carries a 3-credit tier that this table leaves out. They describe what Dify charges credits for — not a statement about those vendors' own catalogues. The response counts are arithmetic over the published allowances, not a Dify quote.

Credits per AI responseExamples from Dify's listSandbox 200 creditsProfessional 5,000 / monthTeam 10,000 / month
25gpt-5.6-sol, gpt-5.58 responses200400
20Claude Opus 4.7 / 4.6 / 4.5, grok-4.5, grok-4.610250500
15gpt-5.6-terra, gpt-5.413333666
10Claude Sonnet 4.6 / 4.5, Gemini 3.5 Flash, qwen3-max205001,000
5Claude Haiku 4.5, gpt-5.6-luna, gemini-3.7-flash401,0002,000
1gpt-5-mini, Gemini 2.5 Flash, qwen-turbo2005,00010,000

Three things follow. First, a production chat app on a 10-credit model exhausts Professional's monthly allowance in 500 answers, which is a small day for anything customer-facing. Second, the same page carries a note that due to model costs some models cannot be used with credits at all and require your own key — so the newest model you want may never have been inside the allowance. Third, embedding models appear in that credit list too, which means indexing a knowledge base competes with chat for the same pool; Dify does not define what counts as one "response" for a batch embedding request, so treat any credit estimate for indexing as an upper bound rather than a rate.

One item this page will not assert: whether Sandbox's 200 credits refill. The Sandbox card shows "200 message credits" with no "/ month" suffix while both paid cards say "/ month", and no FAQ sentence states a refill policy either way.

Bringing your own key: what Dify gates and what it does not

The good news for anyone budgeting the second layer: attaching your own provider key is not a paid feature. On Dify's Cloud comparison table the row "Model Vendor Management — Supports adding and configuring API keys from different model providers for the workspace" carries a check mark on Sandbox, Professional and Team, and the self-hosted table carries it for both Community and Enterprise. A free workspace can therefore add and configure its own provider keys rather than pay for the privilege. What that row does not say is which endpoint URLs a Cloud workspace will accept, and this page did not test that.

What is gated is running several keys behind one model. "LLM API Load Balancing — Adds multiple API keys to models, effectively bypassing the API rate limits" shows a dash on Sandbox and check marks on Professional and Team; on the self-hosted table it shows a dash for Community and a check for Enterprise. That last cell is surprising for an open-source build and this page did not test whether the Community binary actually enforces it — the honest statement is that Dify's own comparison presents it as an Enterprise feature. If you need key-level failover without paying for it, that job belongs to a gateway rather than to Dify. Note also that "Local Models — Supports integration with locally deployed models" appears on the self-hosted comparison and does not appear anywhere in the Cloud comparison's markup.

Wiring an OpenAI-compatible endpoint into Dify

Dify's official OpenAI-API-compatible plugin is version 0.0.66, authored by langgenius — both read from the plugin's own manifest. Its declared configuration explains most of the "my gateway is broken in Dify" reports, and every item below is read from that schema, the manifest and the sibling first-party provider files on September 19, 2026.

Field in the schemaDeclared defaultWhy it matters to cost or behaviour
endpoint_url (API Base URL)Required; placeholder is a /v1 baseIt is the base, not the full chat-completions path. Kunavo's base is https://api.kunavo.com/v1.
api_keyOptional (required: false)A keyless local endpoint is valid, which is why the same plugin serves LM Studio and llama.cpp
context_size (Model context size)Required, defaults to 4096You type it yourself. Leave it at 4096 in a RAG app and retrieved chunks get truncated before the model ever sees them.
function_calling_typeno_callTool calling is off until you set it. Agent and tool nodes fail on an otherwise healthy model.
vision_support, structured_output_supportno_support / not_supportedEach capability is a separate switch, all off by default
api_typechat_completions, with responses as the alternativePicks /chat/completions or /responses per model
Pricing fieldsNone existZero pricing entries in 737 lines, so Dify has no rate to multiply your token counts by

Two structural limits are worth planning around. The plugin declares configurate_methods: customizable-model only — there is no predefined model list and no model auto-discovery, so ten models means ten forms. And it declares exactly five model types: llm, rerank, text-embedding, speech2text and tts. Image generation is not one of them, so an image model behind a gateway is not reachable as a Dify "model" through this plugin at all.

There are two other routes worth knowing. The first-party openai provider accepts a custom openai_api_base, but its api_protocol field defaults to responses — so a gateway that does not implement /v1/responses fails there until you switch it to Chat Completions. The anthropic provider accepts an optional anthropic_api_url alongside its required key, and supports both predefined and customizable models, which is the route that keeps Claude models' built-in parameter sets. Kunavo serves both an OpenAI-shaped and an Anthropic-shaped surface, so all three routes are configurable — but choose deliberately rather than by accident, and note that none of this has been runtime-tested by Kunavo inside a live Dify workspace. These are the plugin's documented settings, not a compatibility certificate.

Knowledge bases: where RAG spend actually appears

Dify's indexing-method documentation offers two options with very different cost shapes. High Quality "uses an embedding model to convert content chunks into vector representations" and supports vector, full-text or hybrid retrieval. Economical uses 10 keywords per chunk, states that no tokens are consumed at the expense of reduced retrieval accuracy, and offers only the inverted index with a TopK setting. The same page warns that once a knowledge base is created in High Quality it cannot switch to Economical later, so this is a one-way door you should walk through on purpose.

Be clear about who handles the embedding step, because it is not us: Kunavo does not serve embeddings and does not serve reranking. If you choose High Quality indexing, that step calls an outside provider or a locally deployed model, configured as its own provider entry in Dify — and Dify's rerank slot, which expects a /rerank endpoint or an explicit Rerank Endpoint URL, is likewise not something we serve. What a gateway can cover here is the llm type: the generation nodes in your workflow. Budget the two separately. RAG implementation covers the retrieval side in more depth.

One more ordering detail for self-hosted deployments: the Docker Compose stack runs an ssrf_proxy, so an endpoint has to be reachable from inside the container network, not merely from the browser on your laptop.

A worked estimate for the model layer

This is illustrative token arithmetic, not a measured workflow cost and not a bill ceiling. Assume one RAG answer sends 12,000 input tokens (system prompt, retrieved chunks and short history, all uncached) and returns 600 output tokens, and that the workflow makes one LLM call per answer. Rates are live Kunavo catalog prices per million tokens.

ModelInput / output per 1MEstimate per answerEstimate per 1,000 answers
GPT-5.6 Luna$0.07 / $0.42$0.00109$1.09
Claude Haiku 4.5$0.40 / $2.00$0.00600$6.00
Gemini 3.8 Flash$0.525 / $2.625$0.00788$7.88
Claude Sonnet 4.6$1.20 / $6.00$0.01800$18.00
Claude Opus 5$2.00 / $10.00$0.03000$30.00

Read it against the credit table above and the two layers snap into focus. A month of 1,000 answers on a model Dify rates at 10 credits needs 10,000 credits — the whole Team allowance, on a $159 plan — while the same volume of token traffic has a catalog estimate of $18.00 on Claude Sonnet 4.6 or $1.09 on GPT-5.6 Luna. Which layer dominates your bill depends entirely on which model each node runs, and the spread across this table is roughly 27×.

Two honest caveats. Input tokens dominate a RAG request, so the number that moves your bill most is how many chunks you retrieve and how long they are — not the output length. And Kunavo's catalog amount is a billing floor rather than a cap: when the upstream reports its charge, the bill is the greater of catalog cost and upstream cost times the applicable markup. Cache behaviour and external tool calls sit outside this example. The minimum top-up is $10 in prepaid credit — a funding minimum, not a task fee or a subscription. See billing details.

Best and cheapest API for Dify: pick per layer

RouteWins whenWhat you give up
Dify message creditsEvaluating models in the first week, across five vendors, with nothing to configureThey run out, some models are excluded from them entirely, and the remedy Dify's FAQ recommends for a plan that has hit its limits is the next tier up
Direct vendor APIOne vendor covers every node, and you want that vendor's own caching and batch discountsA second vendor means a second account, a second key rotation and a second spend dashboard
OpenAI-compatible gatewayNodes switch models and you want one key and one prepaid balance behind themThe compatible plugin has no model catalogue, so every model is a hand-typed form with capability switches that default to off
Anthropic-compatible endpointYou are standardized on Claude models and want their built-in parameter setsIt is a separate provider entry from the OpenAI-compatible one, configured and keyed on its own
Local modelPrivate or low-value nodes, no per-request chargeHardware and operations; Dify lists Local Models on the self-hosted comparison and not on the Cloud one

On "cheapest", keep two questions apart. The cheapest listed rate is a property of a price list. The cheapest way to finish a workflow is a property of your graph: each LLM node in it is a separate model call with its own bill, so a weak model that forces a retry, a second extraction pass or a longer answer can lose to a dearer model that gets it right once. The practical method is to price your real request shape — count the retrieved chunks, not a guess — then run the same workflow twice and compare what each provider account actually recorded. AI cost optimization covers that method; LLM gateway and OpenRouter alternatives compare the gateway options themselves.

Is Dify still the right platform to standardize on?

Yes, on the evidence available. The langgenius/dify repository is not archived, was last pushed on September 18, 2026, and carries 156,347 stars; the latest release is 1.17.1, published September 10, 2026, with 1.17.0 on August 25 and 1.16.1 on July 28 (GitHub API, September 19, 2026). Note that the tags carry no v prefix — a URL built as /releases/tag/v1.17.1 returns 404. The company behind it is LangGenius, Inc., which is the name in the site footer and in Dify's own payment FAQ.

The license deserves a read before a commercial deployment. Dify's LICENSE opens by saying the project is licensed under a modified version of Apache 2.0 with additional conditions: you may not use the source to operate a multi-tenant environment without written authorization — with one tenant defined as one workspace — and you may not remove or modify the logo or copyright information in the Dify console frontend. If removing Dify branding matters, the documented routes are an Enterprise agreement or the Dify Premium AMI, whose docs page says it "allows custom branding" and directs you to AWS Marketplace for the price.

And if self-hosting is the plan, size the box honestly. The Docker Compose guide lists prerequisites of CPU >= 2 Core and RAM >= 4 GiB, then starts 7 core services and 8 dependent components; its own macOS row asks for at least 2 virtual CPUs and 8 GiB of memory in the Docker VM. Free software, paid infrastructure.

Set it up, then check the first charge

If you route Dify's LLM nodes through Kunavo, treat the configuration above as the starting point rather than a verified integration: Kunavo publishes no Dify-specific setup page yet, and no Dify workspace has been runtime-tested against the endpoint here. Add one model through the OpenAI-API-compatible plugin, set the context size and the Function Call Type before anything else, run one bounded workflow, and read the charge your account recorded — because Dify will not show a dollar figure for a gateway-attached model. The OpenAI-compatible API guide covers the endpoint shape, and the integrations index lists the clients that do have published setup pages. Create a Kunavo account when you are ready to fund a key; the minimum is $10 in prepaid credit.

FAQ

How much does Dify cost?

Dify Cloud has three self-serve tiers, read from dify.ai/pricing/dify-cloud on September 19, 2026: Sandbox at $0, Professional at $59 per workspace per month or $590 per year, and Team at $159 per workspace per month or $1,590 per year. Listed prices exclude tax. The self-hosted Community Edition is free software, and Dify Enterprise is a custom quote activated by a license key. None of those figures include model API spend beyond the message credits attached to the Cloud plans.

Do Dify's message credits cover my model usage?

Only as a trial. Dify's own plan cards describe message credits as a way to try out models from OpenAI, Anthropic, Gemini, xAI and Tongyi, and say that once they are used up you switch to your own API key. Credits are consumed per AI response at a per-model rate, not per token: Dify's FAQ lists rates from 1 credit up to 25. Professional's 5,000 monthly credits therefore buy 500 responses on a model rated 10 credits, and a note on the same page says some models cannot be used with credits at all. Checked September 19, 2026.

What is the best API for Dify?

It depends on which layer you are optimizing. A direct vendor API wins when one vendor's models cover everything you build and you want that vendor's own caching and batch discounts. An OpenAI-compatible gateway wins when your workflows switch models per node and you want one key and one balance behind them; the cost is that Dify's compatible plugin ships no model catalogue, so each model is a hand-typed form. Dify's message credits win only for evaluation, because they stop. A locally deployed model wins for private or low-value steps — though Dify lists Local Models on its self-hosted comparison and not on its Cloud comparison.

What is the cheapest API for Dify?

Cheapest listed rate and cheapest way to finish a workflow are different questions. Every LLM node in a Dify workflow is its own model call, billed on its own, so a cheap model that needs a retry node or a second extraction pass can cost more than one accurate call on a dearer model. Start by pricing your actual request shape — retrieved chunks dominate input tokens in a RAG app — then measure the same workflow on two models before deciding. No provider can promise you an absolute lowest price, because the cheapest total depends on how many calls your graph makes.

What is the best model for Dify?

Pick per node, not per app, because Dify lets each node carry its own model. Classification, routing and short extraction nodes run acceptably on a small fast model and are where most of the call volume sits. The final writer node is where quality is visible to the user and is worth a stronger model. One caution specific to Dify: a model added through the OpenAI-API-compatible plugin has Function Call Type defaulting to no_call and Vision and Structured Output defaulting to off, so an Agent or tool-using node will not work on it until those switches are set, regardless of how capable the model itself is.

Does Dify show what my model calls cost?

Not for a model you add through the OpenAI-API-compatible plugin. Dify's first-party predefined model files carry a pricing block — the Anthropic Claude files, for instance, end with input and output rates and a per-token unit — while the compatible plugin's 737-line provider schema contains no pricing fields at all, checked September 19, 2026. Dify therefore has no per-token rate to multiply your token counts by for a gateway-attached model. Read the money figure from that provider's own dashboard instead.

Is self-hosting Dify actually free?

The software is, the infrastructure is not. Dify's Community Edition is free and its own pricing page lists it as free with a single workspace. The Docker Compose deployment starts 7 core services and 8 dependent components, and the quick-start page's stated prerequisites are CPU >= 2 Core and RAM >= 4 GiB, while its own macOS row asks for at least 2 virtual CPUs and 8 GiB in the Docker VM. You also pay for the vector database and for every model token. Note too that the license is a modified Apache 2.0: it bars operating a multi-tenant environment without written authorization and bars removing the console's logo or copyright information.

Dify plan prices, comparison-table marks, credit rates, plugin schemas, indexing and self-host documentation, license and repository status all fetched from Dify's own pages and repositories on September 19, 2026; feature marks were resolved from the pricing pages' own markup rather than a rendered screenshot. Kunavo token rates come from the live catalog. Every dollar example here is illustrative token arithmetic, not a measured workflow cost, and no runtime test of Dify against Kunavo has been performed.