plandex-ai/plandex · error
No api keys/credentials provided for models
Error message
No api keys/credentials provided for models
What it means
initClients returns HTTP 400 'No api keys/credentials provided for models' when authVars is empty AND the server runs in cloud mode (IS_CLOUD env set). In cloud mode, users must supply model credentials (or use integrated models); without any, LLM clients cannot be initialized, so the request is rejected as a client configuration problem. Self-hosted (IS_CLOUD unset) deployments skip this check.
Source
Thrown at app/server/handlers/client_helper.go:74
if apiErr != nil {
log.Printf("Error getting integrated models: %v\n", apiErr)
http.Error(w, "Error getting integrated models", http.StatusInternalServerError)
return initClientsResult{}
}
if hookResult.GetIntegratedModelsResult != nil && hookResult.GetIntegratedModelsResult.IntegratedModelsMode {
merged := map[string]string{}
for k, v := range hookResult.GetIntegratedModelsResult.AuthVars {
merged[k] = v
}
if authVars[shared.AnthropicClaudeMaxTokenEnvVar] != "" {
merged[shared.AnthropicClaudeMaxTokenEnvVar] = authVars[shared.AnthropicClaudeMaxTokenEnvVar]
}
authVars = merged
}
if len(authVars) == 0 && os.Getenv("IS_CLOUD") != "" {
log.Println("No api keys/credentials provided for models")
http.Error(w, "No api keys/credentials provided for models", http.StatusBadRequest)
return initClientsResult{}
}
clients := model.InitClients(authVars, settings, orgUserConfig)
return initClientsResult{
clients: clients,
authVars: authVars,
}
}
View on GitHub (pinned to e2d772072e)
Solutions
- Configure model API keys/credentials for your account or org (dashboard integrations settings)
- Ensure the client sends authVars with at least one valid credential in the request
- Verify integrated models are enabled so the hook supplies authVars
- If self-hosting, confirm IS_CLOUD is set only when the cloud credential requirement is intended
Example fix
// before
req := shared.TellPlanRequest{} // no authVars
// after
req := shared.TellPlanRequest{
AuthVars: map[string]string{"OPENAI_API_KEY": os.Getenv("OPENAI_API_KEY")},
} Defensive patterns
Strategy: validation
Validate before calling
// client: ensure credentials exist before invoking plan operations
if len(authVars) == 0 {
return errors.New("configure model API keys in settings before running plans")
} Type guard
func hasCredentials(authVars map[string]string) bool {
for _, v := range authVars { if v != "" { return true } }
return false
} Prevention
- Configure org/user API keys or integrated models before first use
- Always populate authVars in API requests on cloud deployments
- After revoking an integration, add a replacement credential source
- Only set IS_CLOUD on deployments where enforced credentials are intended
When it happens
Trigger: Tell/Build/Apply plan or loadContexts requests in cloud deployments when: the user/org has no stored API keys or integrated models, the client sends an empty authVars map, or deprecated apiKeys field is omitted and integrated models are not enabled.
Common situations: New user account with no model credentials configured yet; API client upgraded to the authVars flow while still sending nothing; org integration revoked leaving authVars empty after the hook merge; keys stored under wrong env var names so the map ends up empty.
Understand the failure class
Background: "API key is required" / "API key not found" / "No API key was set": the missing-api-key error family across 16 libraries — this error's family across 16 libraries.
Related errors
- Built-in local model pack %s can't be used on Plandex Cloud
- Local model pack %s can't be used on Plandex Cloud
- Built-in local model %s can't be used on Plandex Cloud
- error resolving org: %v
- refresh failed - create request: %w
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/d75b8a7d17ba3a4a.
Report an issue: GitHub.