Description
Custom OpenAI-compatible providers (e.g., NVIDIA API) fail authentication with "No API key found for provider" error despite having correctly configured auth credentials in both openclaw.json and auth-profiles.json. The provider configuration is recognized by the gateway and shows in openclaw models status, but the auth lookup consistently fails at runtime, causing all requests to fall back to the first working provider.
Environment
Configuration
~/.openclaw/openclaw.json
{
"models": {
"providers": {
"nvidia": {
"baseUrl": "https://integrate.api.nvidia.com/v1",
"api": "openai-completions",
"models": [{
"id": "moonshotai/kimi-k2.5",
"name": "Kimi K2.5 (NVIDIA)",
"cost": {"input": 0.6, "output": 3.0, "cacheRead": 0.1, "cacheWrite": 0.6},
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 262144,
"maxTokens": 8192
}]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "nvidia/moonshotai/kimi-k2.5",
"fallbacks": ["anthropic/claude-haiku-4-5"]
},
"models": {
"nvidia/moonshotai/kimi-k2.5": {
"alias": "kimi",
"params": {"stream": true}
}
}
}
}
}
~/.openclaw/agents/main/agent/auth-profiles.json
{
"profiles": {
"nvidia": {
"type": "api_key",
"provider": "openai",
"key": "nvapi-..."
}
}
}
Steps to Reproduce
- Configure custom provider in
models.providers with "api": "openai-completions"
- Add auth profile to
auth-profiles.json with proper structure
- Restart gateway:
openclaw gateway restart
- Check status:
openclaw models status (shows provider configured, auth marked as "Missing")
- Make request:
openclaw agent -m "test"
Expected Behavior
- Auth system should match provider name from model string (
nvidia/moonshotai/kimi-k2.5) to auth profile
- API key should be found and used for requests
- Requests should succeed using the configured provider
Actual Behavior
- Gateway logs show:
FailoverError: No API key found for provider "nvidia". Auth store: ~/.openclaw/agents/main/agent/auth-profiles.json
openclaw models status output shows auth profile exists but marks provider as "Missing auth"
- All requests fallback to first working provider (Anthropic Claude)
- Provider never successfully authenticates
Investigation & Attempted Solutions
Tried multiple approaches without success:
- ✅ Provider config with
"api": "openai-completions" (required field)
- ✅ Various provider names:
openai-nvidia, nvidia, nvidia-custom
- ✅ Multiple auth profile formats matching documentation
- ✅ Using
openclaw models auth paste-token --provider nvidia
- ✅ Environment variable:
OPENAI_NVIDIA_API_KEY in ~/.openclaw/.env
- ✅ Running
openclaw doctor --fix
- ❌ Auth lookup still fails every time
Logs
Gateway startup (shows model recognized):
{"subsystem":"gateway"} agent model: nvidia/moonshotai/kimi-k2.5
{"subsystem":"gateway"} listening on ws://127.0.0.1:18789 (PID 99675)
Auth failure at runtime:
lane task error: FailoverError: No API key found for provider "nvidia".
Auth store: /Users/computa/.openclaw/agents/main/agent/auth-profiles.json
openclaw models status output:
- openai effective=profiles | profiles=2 | openai:default=sk-proj-..., nvidia=nvapi-8w...
Missing auth
- nvidia Run `openclaw configure` or set an API key env var.
Impact
Severity: High - Blocks use of cost-effective providers
- Custom provider costs: $0.60/$3.00 per million tokens (input/output)
- Fallback to Claude Haiku: $1/$5 per million tokens
- Cost impact: 10x more expensive (~$650/month additional cost at current usage)
- Affects any custom OpenAI-compatible provider (NVIDIA, local inference, proxies)
Related Configurations That Work
- Built-in providers (Anthropic, OpenAI, OpenRouter) work correctly
- Direct curl requests to NVIDIA API succeed with same credentials
- Auth system works for providers without custom names
Possible Root Cause
Auth lookup system may not properly handle:
- Custom provider names in model strings (e.g.,
nvidia/model-id)
- Mapping between provider name in config vs auth-profiles
- Dynamic provider registration vs built-in provider hardcoding
Workaround
None found. Must use built-in providers or fallback to more expensive alternatives.
Additional Context
- Followed documentation at https://docs.openclaw.ai/gateway/authentication
- Configuration matches examples from community guides
- API key is valid (tested with direct curl)
- Issue persists across multiple gateway restarts and config variations
Description
Custom OpenAI-compatible providers (e.g., NVIDIA API) fail authentication with "No API key found for provider" error despite having correctly configured auth credentials in both
openclaw.jsonandauth-profiles.json. The provider configuration is recognized by the gateway and shows inopenclaw models status, but the auth lookup consistently fails at runtime, causing all requests to fall back to the first working provider.Environment
Configuration
~/.openclaw/openclaw.json{ "models": { "providers": { "nvidia": { "baseUrl": "https://integrate.api.nvidia.com/v1", "api": "openai-completions", "models": [{ "id": "moonshotai/kimi-k2.5", "name": "Kimi K2.5 (NVIDIA)", "cost": {"input": 0.6, "output": 3.0, "cacheRead": 0.1, "cacheWrite": 0.6}, "reasoning": true, "input": ["text", "image"], "contextWindow": 262144, "maxTokens": 8192 }] } } }, "agents": { "defaults": { "model": { "primary": "nvidia/moonshotai/kimi-k2.5", "fallbacks": ["anthropic/claude-haiku-4-5"] }, "models": { "nvidia/moonshotai/kimi-k2.5": { "alias": "kimi", "params": {"stream": true} } } } } }~/.openclaw/agents/main/agent/auth-profiles.json{ "profiles": { "nvidia": { "type": "api_key", "provider": "openai", "key": "nvapi-..." } } }Steps to Reproduce
models.providerswith"api": "openai-completions"auth-profiles.jsonwith proper structureopenclaw gateway restartopenclaw models status(shows provider configured, auth marked as "Missing")openclaw agent -m "test"Expected Behavior
nvidia/moonshotai/kimi-k2.5) to auth profileActual Behavior
FailoverError: No API key found for provider "nvidia". Auth store: ~/.openclaw/agents/main/agent/auth-profiles.jsonopenclaw models statusoutput shows auth profile exists but marks provider as "Missing auth"Investigation & Attempted Solutions
Tried multiple approaches without success:
"api": "openai-completions"(required field)openai-nvidia,nvidia,nvidia-customopenclaw models auth paste-token --provider nvidiaOPENAI_NVIDIA_API_KEYin~/.openclaw/.envopenclaw doctor --fixLogs
Gateway startup (shows model recognized):
Auth failure at runtime:
openclaw models statusoutput:Impact
Severity: High - Blocks use of cost-effective providers
Related Configurations That Work
Possible Root Cause
Auth lookup system may not properly handle:
nvidia/model-id)Workaround
None found. Must use built-in providers or fallback to more expensive alternatives.
Additional Context