feat(tui): support setup-token (OAuth) for Anthropic API calls#40
Merged
jalehman merged 1 commit intoMar 10, 2026
Merged
Conversation
Add two-part fix for OAuth setup-token support in lcm-tui: 1. resolveProviderAPIKey now checks CLAUDE_CODE_OAUTH_TOKEN env var and ~/.openclaw/secrets.json (anthropic-setup-token key) as additional token sources before the provider mode check. Priority order: ANTHROPIC_API_KEY > CLAUDE_CODE_OAUTH_TOKEN > secrets.json > config. 2. summarizeAnthropic now detects the token prefix to choose the correct HTTP auth header: sk-ant-oat tokens use Authorization: Bearer, while sk-ant-api and other tokens use x-api-key (existing behavior). Both token types work transparently with no config change needed.
This was referenced Mar 11, 2026
billzhuang6569
pushed a commit
to billzhuang6569/lossless-claw
that referenced
this pull request
Mar 21, 2026
…an-Engineering#40) Add two-part fix for OAuth setup-token support in lcm-tui: 1. resolveProviderAPIKey now checks CLAUDE_CODE_OAUTH_TOKEN env var and ~/.openclaw/secrets.json (anthropic-setup-token key) as additional token sources before the provider mode check. Priority order: ANTHROPIC_API_KEY > CLAUDE_CODE_OAUTH_TOKEN > secrets.json > config. 2. summarizeAnthropic now detects the token prefix to choose the correct HTTP auth header: sk-ant-oat tokens use Authorization: Bearer, while sk-ant-api and other tokens use x-api-key (existing behavior). Both token types work transparently with no config change needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add OAuth setup-token support to lcm-tui's Anthropic API integration.
Closes #41
Part 1: Token resolution
resolveProviderAPIKeynow checksCLAUDE_CODE_OAUTH_TOKENenv var and~/.openclaw/secrets.json(anthropic-setup-tokenkey) before the provider mode checkANTHROPIC_API_KEYenv >CLAUDE_CODE_OAUTH_TOKENenv >secrets.jsonsetup-token > openclaw.json provider configPart 2: Header selection
summarizeAnthropicdetects token prefix to choose the correct HTTP auth header:sk-ant-oatprefix →Authorization: Bearerheadersk-ant-apior other →x-api-keyheader (existing behaviour)Both token types work transparently with no config change needed. Existing API key users are unaffected.