Skip to main content

Error Reference

This guide catalogs all error messages from the kagi CLI, organized by category with explanations and solutions.

Error Format

Plain text errors follow this pattern:
Examples:
  • Error: missing credentials - this command requires KAGI_SESSION_TOKEN
  • Error: Auth error: Kagi Search API request rejected: HTTP 403 Forbidden
HTTP errors may include a short diagnostic suffix copied from Kagi’s response body:
Transport errors include the request URL when the HTTP client exposes it:
Automation can request compact JSON stderr instead:
The JSON error envelope uses stable top-level fields:

Authentication Errors

”missing credentials”

Message:
Meaning: No authentication token is configured. Solution:

“this command requires KAGI_SESSION_TOKEN”

Message:
Meaning: Command needs a session token, but you may have only an API key or legacy API token configured. Solution:
This same requirement applies to session-token web-product commands such as:

“this command requires KAGI_API_TOKEN”

Message:
Meaning: Command needs API token, but you may have only session token configured. Solution:

“auth check failed”

Message:
Meaning: Token is invalid, expired, or rejected. Causes:
  • Token expired
  • Token revoked
  • Token regenerated in Kagi settings
  • Account doesn’t have required access
Solution:
  1. Log into kagi.com
  2. Navigate to Settings → Account (session) or API
  3. Generate new token
  4. Update configuration:
  5. Verify: kagi auth check

”Insufficient credit”

Message:
Meaning: API token is valid but you have no remaining API credit. Solution:
  1. Check API credit in Kagi settings
  2. Add credit if needed
  3. Or use subscriber features (no credit required)

Configuration Errors

”Config file not found”

Message:
Meaning: No configuration file exists yet. Solution: This is informational. Run kagi auth set to create it, or use environment variables.

”quick query cannot be empty”

Message:
Meaning: kagi quick received an empty string after trimming whitespace. Solution:

“Permission denied”

Message:
Meaning: Cannot read/write configuration file. Solution:

“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_TOKEN is invalid or expired
  • the current Kagi account state no longer authorizes Translate
  • Kagi changed the bootstrap cookie behavior
Solution:

Command Errors

”this search option requires KAGI_SESSION_TOKEN”

Message:
Meaning: You used a session-only search option like --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:
Meaning: The --length option only works with subscriber summarizer mode. Solution:

“lens named ‘abc’ was not found”

Message:
Meaning: kagi search --lens was given a non-numeric value, but no enabled lens has that exact name. Solution:
Use a numeric index when names are duplicated or numeric-looking:

“—engine is only supported for the paid public summarizer API”

Message:
Meaning: The --engine option doesn’t work with subscriber mode. Solution:

“—cache is only supported for the paid public summarizer API”

Message:
Meaning: The --cache option doesn’t work with subscriber mode. Solution:

“translate —to cannot be ‘auto’; pass an explicit target language code”

Message:
Meaning: Translate can auto-detect the source language, but the target language must always be explicit. Solution:

“—url or —text required”

Meaning: Summarize command needs content to summarize. Solution:

“invalid ask-page URL”

Message:
Meaning: kagi ask-page requires an absolute http or https URL. Solution:

“ask-page URL must use http or https”

Message:
Meaning: Local file URLs are not supported by ask-page. Solution: Use a normal web URL, or ask the question through a different command surface.

”ask-page question cannot be empty”

Message:
Meaning: The URL alone is not enough. The command requires a page question too. Solution:

“batch query failed”

Message:
Meaning: At least one query in kagi batch failed. The error lists how many queries succeeded and includes each failed query with its underlying error. Solution:
  1. Retry the failed query by itself to reduce noise:
  2. If the error includes 401 or 403, refresh the relevant credential:
  3. 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
Solution:
  1. Check internet connection
  2. Try again later
  3. Add retry logic:

“Failed to connect”

Meaning: Cannot establish connection to Kagi. Causes:
  • No internet
  • DNS failure
  • Firewall/proxy blocking
Solution:

“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
Solution:

Parse Errors

”failed to serialize search response”

Meaning: Response couldn’t be parsed as JSON. Causes:
  • API returned unexpected format
  • Version mismatch
  • Corrupted response
Solution:
  1. Update kagi CLI:
  2. 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:
  1. Wait a few minutes
  2. Add delays between requests:
  3. 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

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:
  1. Check Troubleshooting
  2. Search GitHub Issues
  3. Create new issue with:
    • Error message (exact text)
    • Command you ran
    • kagi version (kagi --version)
    • OS and version