Use Dify with TokenMaster
Dify builds chatbots, agents and workflows on top of LLMs. Add TokenMaster models through the official OpenAI-API-compatible model provider.
You will need
- An API key starting with tm- (Console → API keys) — Get an API key
- Base URL:
https://tokenmaster.store/v1 - A model ID, e.g.
deepseek/deepseek-v4-pro(see the model list)
Setup
- Open Settings → Model Provider, install OpenAI-API-compatible from the Marketplace if needed, then click Add Model.
- Set Model Type to LLM and Model Name to a TokenMaster ID, e.g.
deepseek/deepseek-v4-pro. - Enter your
tm-…key in API Key andhttps://tokenmaster.store/v1in API Base URL. - Set Completion mode to Chat and keep API Type on Chat Completions API.
- Fill in Model context size and Upper bound for max tokens from the model page. If your app uses tools or agents, set Function Call Type to Tool Call; turn on Vision Support for models that read images.
- Save — Dify sends a test request to check the settings. Repeat for each model you want.
Good to know
- Models are added one at a time; there is no list sync.
- For Dify Knowledge, add another model with Model Type Text Embedding and model
baai/bge-m3. For embedding models the plugin appends/v1itself, so usehttps://tokenmaster.storeas the base URL. Rerank models are not available. - Not available through TokenMaster: image generation, speech, rerank, the Assistants API, and OpenAI-hosted tools. Chat Completions, the Responses API (stateless), the Anthropic Messages API and embeddings are available.
Checked against Dify OpenAI-API-compatible plugin 0.0.68 on 2026-10-19. Menu names can change between versions.
Troubleshooting
- 401 / invalid API key — check the key was copied in full and has not been deleted in the console.
- 404 — the base URL is wrong. It must end in /v1 unless the guide says otherwise.
- Model not found / not available — use the exact ID from the model list (vendor/model, lowercase). Some vendors are not available in every region.
- Errors mentioning /responses — the tool is using OpenAI's Responses API. TokenMaster accepts it, but statelessly (no previous_response_id) and without OpenAI-hosted tools; if the tool relies on those, switch it to Chat Completions as noted above.
- 402 / insufficient balance — top up in the console; requests are refused rather than run up a debt.