You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Docs] BYOK section does not cover custom_provider headers, the path #126 was resolved to #211
README.md (the "Use your own API key (BYOK)" section, lines 82-100)
Problem and suggested improvement
#126 was resolved with the ruling that third-party BYOK belongs in custom_provider rather than minimax_api, since minimax_api is the official endpoint and should keep a fixed auth header. That is a clear answer, but a user cannot currently reach it from the documentation, for two separate reasons.
1. custom_provider and its headers option are undocumented.
custom_provider appears nowhere outside code and two test files:
The README's BYOK section documents mcode provider add, never naming custom_provider or mentioning that headers can be set at all. So a user who is told "use custom_provider with Authorization: Bearer" has nothing to follow.
2. The documented command cannot express it.
mcode provider add is the only documented way to configure BYOK, and its request type has no field for headers (packages/tui/src/cli/provider-command.ts:9-20):
There is no --header flag. The only route to options.headers is hand-editing the config file — which, per (1), is not documented either. A user following the README lands on a provider that sends x-api-key, gets login fail: Please carry the API secret key in the 'X-Api-Key' field, and has no documented next step. That is the path #126 walked.
Suggested improvement
Two things, in order of cost:
Extend the BYOK section to show a relay that authenticates with Authorization: Bearer, name custom_provider as the supported path for any endpoint that is not the official one, and show the options.headers block. Worth stating that api may be omitted: resolveCustomProviderApi (model-resolver-byok.ts:142-150) defaults to anthropic-messages, the same value minimax_api pins at line 61, so a relay serving /v1/messages needs no extra configuration.
Consider a --header 'Name: value' flag on mcode provider add, repeatable. Without it the documented interface cannot produce the configuration the documentation would be describing, and every such user has to be told to edit a file by hand.
Happy to open a PR for the README part if that is welcome — it is documentation only and does not touch the design decision in #126. I am not proposing any change to minimax_api.
Activity