Skip to content

feat(auth): standardize provider credentials with api_key and oauth_token#261

Merged
jlia0 merged 2 commits intomainfrom
feat/oauth-token-auth
Mar 25, 2026
Merged

feat(auth): standardize provider credentials with api_key and oauth_token#261
jlia0 merged 2 commits intomainfrom
feat/oauth-token-auth

Conversation

@jlia0
Copy link
Copy Markdown
Collaborator

@jlia0 jlia0 commented Mar 25, 2026

Description

Standardize credential field naming across providers and add flexible auth options. Rename auth_token to api_key for both providers, add Anthropic api_key support alongside existing oauth_token, and use CLAUDE_CODE_OAUTH_TOKEN for OAuth-based Anthropic auth. When no credentials are configured in settings, processes inherit environment variables directly, enabling Docker deployments with container-level env vars.

Changes

  • Rename auth_token to api_key in Settings type and all references (CLI, invoke, README)
  • Add oauth_token field for Anthropic, exported as CLAUDE_CODE_OAUTH_TOKEN (clears ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN)
  • Add api_key field for Anthropic, exported as ANTHROPIC_API_KEY (oauth_token takes priority if both set)
  • Split CLI flags into --oauth-token and --api-key (replacing --auth-token)
  • Update README docs and settings example JSON

Testing

  • Verified types compile with new field names
  • Manual review of env override logic in invoke.ts

Checklist

  • PR title follows conventional commit format (type(scope): description)
  • I have tested these changes locally
  • My changes don't introduce new warnings or errors
  • I have updated documentation if needed

jlia0 and others added 2 commits March 25, 2026 02:11
Switch built-in Anthropic provider from ANTHROPIC_API_KEY to
CLAUDE_CODE_OAUTH_TOKEN for OAuth-based auth. Clears ANTHROPIC_API_KEY
and ANTHROPIC_AUTH_TOKEN when OAuth token is set to prevent conflicts.

- Rename settings field from auth_token to oauth_token for Anthropic
- Update CLI --oauth-token flag (--auth-token still accepted)
- Update README docs and settings example

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…y support

Standardize credential field names across providers: rename OpenAI's
auth_token to api_key, and add api_key support for Anthropic alongside
existing oauth_token. When no credentials are configured, the process
inherits environment variables directly (useful for Docker deployments).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jlia0 jlia0 merged commit 5d6d745 into main Mar 25, 2026
@jlia0 jlia0 deleted the feat/oauth-token-auth branch March 25, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant