kagi fastgpt
Answer queries using Kagi’s FastGPT API for quick, factual responses.
Synopsis
Description
Thekagi 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 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.
Output Format
Fields
| Field | Type | Description |
|---|---|---|
meta | object | Request metadata from the API |
data.output | string | FastGPT’s answer |
data.tokens | integer | Token count reported by the API |
data.references | array | Supporting references when available |
Examples
Basic Queries
Processing Output
Quick Reference Tool
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success - answer received |
| 1 | Error - see stderr |
- Missing API token
- Insufficient API credit
- Rate limiting
- Network error
Comparison with Assistant
| Feature | FastGPT | Assistant |
|---|---|---|
| Token | API | Session |
| Speed | Faster | Slightly slower |
| Conversations | Single query | Threaded |
| Cost | API credit | Included with subscription |
| Use case | Quick facts | Complex discussions |
When to Use FastGPT
Good for:- Quick factual questions
- Simple explanations
- Single-turn queries
- Automated workflows
- Cost-sensitive operations
- Multi-turn conversations
- Complex reasoning chains
- Context-dependent queries
- Creative writing
Best Practices
Clear Questions
Error Handling
Caching Strategy
See Also
- assistant - Conversational AI
- summarize - Content summarization
- Authentication - API token setup
Last updated: March 2026