Error Reference
This guide catalogs all error messages from the kagi CLI, organized by category with explanations and solutions.Error Format
Errors follow this pattern:Error: missing credentials - this command requires KAGI_SESSION_TOKENError: Auth error: Kagi Search API request rejected: HTTP 403 Forbidden
Authentication Errors
”missing credentials”
Message:“this command requires KAGI_SESSION_TOKEN”
Message:“this command requires KAGI_API_TOKEN”
Message:“auth check failed”
Message:- Token expired
- Token revoked
- Token regenerated in Kagi settings
- Account doesn’t have required access
- Log into kagi.com
- Navigate to Settings → Account (session) or API
- Generate new token
- Update configuration:
- Verify:
kagi auth check
”Insufficient credit”
Message:- Check API credit in Kagi settings
- Add credit if needed
- Or use subscriber features (no credit required)
Configuration Errors
”Config file not found”
Message:kagi auth set to create it, or use environment variables.
”quick query cannot be empty”
Message:kagi quick received an empty string after trimming whitespace.
Solution:
“Permission denied”
Message:“translate bootstrap did not mint a translate_session cookie”
Meaning: The translate site accepted the request but did not issue the session cookie the CLI needs for follow-on API calls. Likely causes:KAGI_SESSION_TOKENis invalid or expired- the current Kagi account state no longer authorizes Translate
- Kagi changed the bootstrap cookie behavior
Command Errors
”this search option requires KAGI_SESSION_TOKEN”
Message:--lens, --time, --order, --verbatim, or personalization flags without a configured session token. --region, --from-date, and --to-date can use the V1 Search API when KAGI_API_KEY is configured.
Solution:
“search —time cannot be combined with —from-date or —to-date”
Meaning: Kagi’s live search UI treats preset time windows and custom date ranges as separate filter modes. Solution:“search —from-date must use YYYY-MM-DD format”
Meaning: Search date filters require zero-padded ISO dates. Solution:“—length requires —subscriber”
Message:--length option only works with subscriber summarizer mode.
Solution:
“lens ‘abc’ must be a numeric index”
Message:l= value from Kagi’s web UI.
Solution:
“—engine is only supported for the paid public summarizer API”
Message:--engine option doesn’t work with subscriber mode.
Solution:
“—cache is only supported for the paid public summarizer API”
Message:--cache option doesn’t work with subscriber mode.
Solution:
“translate —to cannot be ‘auto’; pass an explicit target language code”
Message:“—url or —text required”
Meaning: Summarize command needs content to summarize. Solution:“invalid ask-page URL”
Message:kagi ask-page requires an absolute http or https URL.
Solution:
“ask-page URL must use http or https”
Message:ask-page.
Solution:
Use a normal web URL, or ask the question through a different command surface.
”ask-page question cannot be empty”
Message:“batch query failed”
Message:kagi batch failed. The error lists how many queries succeeded and includes each failed query with its underlying error.
Solution:
- Retry the failed query by itself to reduce noise:
- If the error includes
401or403, refresh the relevant credential: - If only some queries failed due to rate limits or transient server errors, lower concurrency:
Network Errors
”Network error: request to timed out”
Meaning: Request to the shown URL took too long to complete. Causes:- Slow internet connection
- Kagi service slow
- Rate limiting
- Check internet connection
- Try again later
- Add retry logic:
“Failed to connect”
Meaning: Cannot establish connection to Kagi. Causes:- No internet
- DNS failure
- Firewall/proxy blocking
“DNS resolution failed”
Meaning: Cannot resolve kagi.com hostname. Solution:“SSL/TLS error”
Meaning: Certificate validation failed. Causes:- System time wrong
- Outdated CA certificates
- Corporate proxy
Parse Errors
”failed to serialize search response”
Meaning: Response couldn’t be parsed as JSON. Causes:- API returned unexpected format
- Version mismatch
- Corrupted response
- Update kagi CLI:
- Check raw output:
“failed to parse”
Meaning: General parsing error. Solution:Rate Limit Errors
”Rate limit exceeded”
Meaning: Too many requests in short time. Solution:- Wait a few minutes
- Add delays between requests:
- Reduce request frequency
”Too many requests”
Same as rate limit. Wait and retry with slower pace.Installation Errors
”command not found”
Meaning: kagi not in PATH. Solution:“No such file or directory”
Meaning: Binary missing or wrong path. Solution: Reinstall using install script or package manager.Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Any error (check stderr) |
Debugging Strategy
Step 1: Check Basic Functionality
Step 2: Check Authentication
Step 3: Isolate the Issue
Step 4: Check Environment
Getting Help
If you encounter an error not listed here:- Check Troubleshooting
- Search GitHub Issues
- Create new issue with:
- Error message (exact text)
- Command you ran
- kagi version (
kagi --version) - OS and version