[Provider]: Support Baidu DuMate (dumate.baidu.com/app) as a built-in provider

Open
#8,667 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
api

Research direction

Start with how the existing quota-tracked providers, Kiro and WorkBuddy, are registered as built-in providers, and how ocx provider add and the dashboard Add provider picker list them. The DuMate upstream wire format and Baidu OAuth flow are not documented in the issue, so the first step is to confirm them against the linked community wrappers. Done means dumate appears in both the picker and the CLI, and its points usage shows in the usage view.

Written by the indexing model from the issue text.

Description

account-pool enhancement needs-info provider tools
Area

Provider adapters

What are you trying to accomplish?

I want to route Codex and Claude Code traffic through OpenCodex to Baidu DuMate (https://dumate.baidu.com/app), Baidu's desktop AI agent product, so that a DuMate account and its points balance can be used as a coding backend instead of only inside the DuMate client. DuMate signs in with a Baidu account and charges per-message points, so the workflow I need is: add DuMate as a provider in OpenCodex once, then pick a DuMate model in Codex or Claude Code and let the proxy handle protocol translation, streaming, and credit accounting.

What prevents this today?

OpenCodex ships 40+ built-in providers, but none for DuMate. The generic "OpenAI-compatible endpoint" provider entry cannot reach it either, because DuMate's upstream is not a plain OpenAI-compatible API: it is the desktop client / web app backend with Baidu account OAuth and a points-based quota, so auth and request shapes both need provider-specific handling. Community adapters exist that wrap DuMate into OpenAI and Anthropic compatible local endpoints, which proves the mapping is feasible, but nothing in OpenCodex itself understands that wire format today.

What should OpenCodex do?

Add a built-in DuMate provider (adapter plus preset) so it appears in the dashboard Add provider picker and in ocx provider add. The adapter would translate inbound Responses / Chat Completions / Anthropic Messages requests into DuMate's upstream wire format, carry streaming and tool calls where DuMate supports them, handle Baidu account auth the way other OAuth providers do, and surface DuMate points consumption in the dashboard usage view like other quota-tracked providers (Kiro credits and WorkBuddy credits are existing precedents).

Example usage or interface
ocx provider add dumate
codex -m "dumate/dumate-ultra" "Refactor auth.ts to use the shared session helper"

Dashboard equivalent: Providers -> Add provider -> DuMate -> sign in with a Baidu account -> pick a model tier, then run Codex or Claude Code against it with the normal provider/model routing syntax.

Alternatives or workarounds

Point the generic OpenAI-compatible provider entry at a local community gateway such as dumate-api (OpenAI + Anthropic compatible) or dumate2api (adds a Responses adapter for Codex CLI). This works but requires running a separate third-party process outside OpenCodex, loses native Baidu OAuth and points accounting, and its protocol mappings are not shipped, versioned, or tested with OpenCodex. A built-in adapter would remove the extra hop and give one supported configuration surface.

Additional context
Checks
  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.
Dominant language
TypeScript
Stars
16.9k
Forks
1.3k
Avg merge
1d 4h
Merged PRs (30d)
814

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lidge-jun/opencodex

All issues in lidge-jun/opencodex

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.