Skip to content

Feature/dynamic credential overrides#37078

Open
yugborana wants to merge 1 commit into
langgenius:mainfrom
yugborana:feature/dynamic-credential-overrides
Open

Feature/dynamic credential overrides#37078
yugborana wants to merge 1 commit into
langgenius:mainfrom
yugborana:feature/dynamic-credential-overrides

Conversation

@yugborana
Copy link
Copy Markdown

[!IMPORTANT]

Fixes #35440

Summary

Added support for dynamic, per-request LLM credential overrides across all major API endpoints. This feature allows API consumers to pass custom credential IDs at runtime, which temporarily override the workspace's default LLM credentials (like API keys) for the duration of that specific workflow or chat execution.

Motivation and Context

Previously, all workflow and chat executions in Dify were rigidly bound to the default LLM credentials configured at the workspace level. This caused a significant limitation for developers building multi-tenant SaaS applications on top of Dify, as they were forced to absorb all LLM billing costs centrally.

By allowing credential_overrides in the API payload, applications can now dynamically inject their own end-users' API keys into the Dify execution context. This enables Bring-Your-Own-Key (BYOK) architectures and direct usage billing, vastly improving Dify's flexibility as an orchestration backend without requiring architectural changes to the frontend apps.

Screenshots

image image image image image

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@yugborana yugborana requested a review from QuantumGhost as a code owner June 4, 2026 19:33
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 4, 2026
@yugborana yugborana force-pushed the feature/dynamic-credential-overrides branch from 06f3661 to b0d190d Compare June 4, 2026 19:36
@yugborana
Copy link
Copy Markdown
Author

@crazywoola

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Dynamic model provider API key selection per workflow run / per client

1 participant