JuliusBrussee/caveman · error
bedrock: invalid API key
Error message
bedrock: invalid API key
What it means
Error "bedrock: invalid API key" thrown in JuliusBrussee/caveman.
Source
Thrown at proxy/providers/bedrock/signing.go:51
copyIfPresent(out, req.Header, "x-amzn-bedrock-guardrail-identifier")
copyIfPresent(out, req.Header, "x-amzn-bedrock-guardrail-version")
copyIfPresent(out, req.Header, "x-amzn-bedrock-performanceconfig-latency")
copyIfPresent(out, req.Header, "x-amzn-bedrock-request-metadata")
copyIfPresent(out, req.Header, "x-amzn-bedrock-service-tier")
copyIfPresent(out, req.Header, "x-amzn-bedrock-trace")
}
if out.Get("content-type") == "" {
out.Set("content-type", "application/json")
}
authKind, err := credentialAuthKind(credential)
if err != nil {
return nil, err
}
if authKind == "bedrock_api_key" {
key := strings.TrimSpace(credential.Key)
if key == "" || strings.ContainsAny(key, "\r\n") {
return nil, fmt.Errorf("bedrock: invalid API key")
}
if mantle {
out.Set("x-api-key", key)
} else {
out.Set("Authorization", "Bearer "+key)
}
return out, nil
}
creds, err := parseAWSCredentials(credential.Key)
if err != nil {
return nil, err
}
// Sign against the SAME URL the proxy will forward to. The caller passes the
// already-resolved upstream (which honors a per-project base URL); re-resolving
// here with an empty route would sign the adapter's fallback host instead, so a
// project with a custom Bedrock endpoint would get a SigV4 Host mismatchView on GitHub (pinned to 27d5a3981a)
Solutions
- Provide a valid Bedrock API key.
When it happens
Trigger: Thrown at proxy/providers/bedrock/signing.go:51 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/241107bade81dda9.
Report an issue: GitHub.