Tencent/WeKnora · error
API key is required for Exa provider
Error message
API key is required for Exa provider
What it means
validateProviderParameters requires a non-empty APIKey for the Exa web-search provider. Exa's API is key-authenticated, so creating, updating, or test-validating an Exa provider without params.APIKey fails with this error.
Source
Thrown at internal/application/service/web_search_provider.go:177
}
if params.EngineID == "" {
return fmt.Errorf("engine ID is required for Google provider")
}
case types.WebSearchProviderTypeTavily:
if params.APIKey == "" {
return fmt.Errorf("API key is required for Tavily provider")
}
case types.WebSearchProviderTypeOllama:
if params.APIKey == "" {
return fmt.Errorf("API key is required for Ollama provider")
}
case types.WebSearchProviderTypeBaidu:
if params.APIKey == "" {
return fmt.Errorf("API key is required for Baidu provider")
}
case types.WebSearchProviderTypeExa:
if params.APIKey == "" {
return fmt.Errorf("API key is required for Exa provider")
}
case types.WebSearchProviderTypeZhipu:
if err := infra_web_search.ValidateZhipuParameters(params); err != nil {
return err
}
case types.WebSearchProviderTypeMetaso:
if err := infra_web_search.ValidateMetasoParameters(params); err != nil {
return err
}
case types.WebSearchProviderTypeDuckDuckGo:
// No API key required
case types.WebSearchProviderTypeKeenable:
// No API key required (keyless by default; an optional key lifts the rate limit)
case types.WebSearchProviderTypeSearxng:
if err := infra_web_search.ValidateSearxngBaseURL(params.BaseURL); err != nil {
return err
}
}View on GitHub (pinned to 988cbb0330)
Solutions
- Set params.APIKey to a valid Exa API key from the Exa dashboard before saving the provider.
- Check config binding/marshalling so the key lands in the APIKey field, not a sibling field.
- Ensure the secret is present in the environment/secret store at startup.
- Strip quotes/whitespace that can make the loaded value look empty or invalid after trimming.
Example fix
// before
{ "type": "exa", "apiKey": "" }
// after
{ "type": "exa", "apiKey": "<your-exa-api-key>" } Defensive patterns
Strategy: validation
Validate before calling
if provider.Type == types.WebSearchProviderTypeExa && strings.TrimSpace(provider.APIKey) == "" {
return errors.New("exa provider requires an API key")
} Try / catch
err := svc.CreateProvider(ctx, p)
if err != nil && strings.Contains(err.Error(), "required for Exa") {
// prompt the user for their Exa API key before retrying
return fieldError("apiKey", err)
} Prevention
- Copy the Exa key at setup time and verify it via a cheap API ping before saving.
- Centralize provider creation through a helper that enforces key presence per type.
- Keep keys out of committed config; inject via env and fail fast when missing.
- Re-validate providers after key rotation.
When it happens
Trigger: CreateProvider or UpdateProvider with type 'exa' and APIKey == ""; tests (e.g. TestValidateProviderParametersExa) that construct Exa params without a key.
Common situations: Signing up for Exa but not copying the API key into config; rotating keys and leaving the field empty temporarily; YAML/JSON config where the key is nested under the wrong field so it unmarshals 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
- API key is required for Ollama provider
- API key is required for Baidu provider
- API key is required for Metaso provider
- query is empty
- API key is required for Exa provider
AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02).
Data as JSON: /api/errors/9b1d95ac790ba62f.
Report an issue: GitHub.