Skip to content

fix: multi-provider auth and API type support#7

Open
interplanetarychris wants to merge 4 commits intojgarzik:mainfrom
interplanetarychris:fix/multi-auth-header
Open

fix: multi-provider auth and API type support#7
interplanetarychris wants to merge 4 commits intojgarzik:mainfrom
interplanetarychris:fix/multi-auth-header

Conversation

@interplanetarychris
Copy link

Summary

  • Fix keyring-proxy to accept both Authorization: Bearer and x-api-key headers for Anthropic-style APIs
  • Fix empty basePath for Anthropic vendor (OpenClaw includes /v1 in requests)
  • Fix API type mapping per provider in bot config generation (anthropic-messages vs openai-completions)
  • Add OpenRouter as new provider option
  • Add API key format hints to dashboard for better UX

Changes

File Change
proxy/src/routes/proxy.ts Accept x-api-key header in addition to Authorization: Bearer
proxy/src/types.ts Empty basePath for Anthropic (was /v1)
src/bots/templates.ts Set correct api type per provider
dashboard/src/config/providers/ Add OpenRouter, add keyHint to all providers

Test plan

  • Create bot with Venice provider - verify requests work
  • Create bot with Anthropic provider - verify x-api-key header accepted
  • Create bot with OpenAI provider - verify Authorization: Bearer works
  • Verify dashboard shows key format hints

🤖 Generated with Claude Code

interplanetarychris and others added 4 commits February 3, 2026 15:21
OpenClaw sends different auth headers based on API type:
- openai-completions: Authorization: Bearer <apiKey>
- anthropic-messages: x-api-key: <apiKey>

The keyring-proxy now accepts both authentication methods, fixing
401 "Missing authorization" errors for Anthropic and Venice providers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
OpenClaw's anthropic-messages API includes /v1 in its request path,
so the vendor basePath should be empty to avoid double /v1/v1 in the
forwarded URL.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
BotMaker was hardcoding 'openai-responses' API type for all providers.
Now correctly maps:
- openai → openai-responses
- anthropic → anthropic-messages
- venice → openai-completions (OpenAI-compatible)
- google → google-gemini

Added tests for anthropic and venice proxy configurations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add OpenRouter as a new provider with curated model list
- Add keyHint field to provider configs for API key format hints
- Dynamic API key placeholder in AddKeyForm based on selected provider
- Update Venice model list with current recommended models

Provider key hints:
- OpenAI: sk-...
- Anthropic: sk-ant-...
- Google: AIza...
- Venice: VENICE-INFERENCE-KEY-...
- OpenRouter: sk-or-...

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
{ id: 'anthropic/claude-opus-4-5', label: 'Claude Opus 4.5' },
{ id: 'anthropic/claude-sonnet-4-5', label: 'Claude Sonnet 4.5' },
{ id: 'openai/gpt-5.2', label: 'GPT-5.2' },
{ id: 'google/gemini-3-pro', label: 'Gemini 3 Pro' },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be gemini-3-pro-preview

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.

2 participants