Skip to main content

kagi fastgpt

Answer queries using Kagi’s FastGPT API for quick, factual responses.

Synopsis

Description

The kagi fastgpt command queries Kagi’s FastGPT API, which provides quick, factual answers optimized for speed and accuracy. Unlike the Assistant which maintains conversation threads, FastGPT is designed for single-question answering. Key characteristics:
  • Fast response times
  • Factual, concise answers
  • No conversation state
  • API-based (consumes credit)

Authentication

Required: KAGI_API_TOKEN FastGPT currently uses Kagi’s legacy /api/v0 API with Bot auth. It requires API access and consumes API credit per request.

Arguments

<QUERY> (Required)

The question or query to answer. Example:

Options

--cache <BOOL>

Enable or disable response caching. Values: true, false Default: true When enabled, identical queries may return cached responses for faster results and reduced API usage. Example:

--web-search <BOOL>

Enable web search augmentation. Values: true Default: true (web search enabled) Note: Kagi’s documentation notes that values other than true for --web-search are currently unsupported in practice.

--local-cache

Store and reuse the response in the local cache under ~/.cache/kagi-cli or KAGI_CACHE_DIR.

--cache-ttl <SECONDS>

Override the local cache TTL. FastGPT defaults to 3600 seconds when --local-cache is enabled.

Output Format

Fields

Examples

Basic Queries

Processing Output

Quick Reference Tool

Exit Codes

Common errors:
  • Missing API token
  • Insufficient API credit
  • Rate limiting
  • Network error

Comparison with Assistant

When to Use FastGPT

Good for:
  • Quick factual questions
  • Simple explanations
  • Single-turn queries
  • Automated workflows
  • Cost-sensitive operations
Not ideal for:
  • Multi-turn conversations
  • Complex reasoning chains
  • Context-dependent queries
  • Creative writing

Best Practices

Clear Questions

Error Handling

Caching Strategy

See Also


Last updated: March 2026