generate_text
Generate text using frontier AI language models. Per-character pricing with a per-request minimum: Kimi K3 (best, ~10 chars/sat, 1M context, default), GPT-OSS-120B (standard, ~1000 chars/sat, 119 languages, best value). Rates and minimums are BTC-pegged and re-quoted hourly, so treat them as approximate — the 402 challenge is the authoritative price. Supports document Q&A via fileContext. For images, use the analyze_image tool. Stable endpoints — models upgrade automatically. Pay per request with Bitcoin Lightning — no API key or signup needed. Requires create_payment with toolName='generate_text' and the exact prompt.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"paymentId": "<paymentId>",
"prompt": "<prompt>"
},
"name": "generate_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The text prompt or question | |
| modelId | No | Optional. Omit to run the model this payment was created for. | |
| fileName | No | Name of the attached file | |
| maxTokens | No | Max tokens in response | |
| paymentId | Yes | Valid payment ID (must be paid) | |
| fileContext | No | Extracted file text to include as context | |
| imageBase64 | No | Base64 data URI for vision analysis (best model only) | |
| systemPrompt | No | Optional system prompt |