[PR #29349] Add AI Badgr as an OpenAI-compatible backend #32382

Closed
opened 2026-02-21 20:51:18 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/29349

State: closed
Merged: No


Add AI Badgr as a cheaper OpenAI-compatible backend

This PR adds a short documentation section showing how to use AI Badgr as a drop-in replacement for OpenAI's API at a fraction of the cost.

What's Changed

  • Added a new section to the README explaining how to override the base_url parameter
  • Included code examples for:
    • Python (using the openai package)
    • JavaScript/Node.js (using the openai package)
    • cURL (command-line usage)
  • Notes on advanced features (streaming, JSON mode)

Key Points

  • Cheaper alternative - AI Badgr offers OpenAI-compatible API at significantly lower costs
  • Docs-only change - No code modifications or breaking changes
  • Optional provider - Developers can choose to use it or not
  • OpenAI-compatible - Works with existing OpenAI client libraries (just swap the base_url)
  • Simple integration - Just override base_url and optionally api_key

Technical Details

AI Badgr implements the OpenAI API specification, supporting:

  • Chat completions with streaming
  • JSON mode responses
  • Compatible with standard OpenAI SDKs
  • Same API interface, lower costs

This is an optional addition that gives developers a cost-effective alternative backend choice for their OpenAI-compatible applications.

**Original Pull Request:** https://github.com/langgenius/dify/pull/29349 **State:** closed **Merged:** No --- ## Add AI Badgr as a cheaper OpenAI-compatible backend This PR adds a short documentation section showing how to use **AI Badgr** as a drop-in replacement for OpenAI's API at a fraction of the cost. ### What's Changed - Added a new section to the README explaining how to override the `base_url` parameter - Included code examples for: - Python (using the `openai` package) - JavaScript/Node.js (using the `openai` package) - cURL (command-line usage) - Notes on advanced features (streaming, JSON mode) ### Key Points - **Cheaper alternative** - AI Badgr offers OpenAI-compatible API at significantly lower costs - **Docs-only change** - No code modifications or breaking changes - **Optional provider** - Developers can choose to use it or not - **OpenAI-compatible** - Works with existing OpenAI client libraries (just swap the `base_url`) - **Simple integration** - Just override `base_url` and optionally `api_key` ### Technical Details AI Badgr implements the OpenAI API specification, supporting: - Chat completions with streaming - JSON mode responses - Compatible with standard OpenAI SDKs - Same API interface, lower costs This is an optional addition that gives developers a cost-effective alternative backend choice for their OpenAI-compatible applications.
yindo added the pull-request label 2026-02-21 20:51:18 -05:00
yindo closed this issue 2026-02-21 20:51:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32382