ask_ai
Send prompts or conversations to AI models via LightningProx and pay per request in sats; returns replies, tool calls, model used, and remaining balance.
Instructions
Send a prompt or a conversation to an AI model through LightningProx (24 models: Claude, GPT, Gemini, DeepSeek, Mistral and more), paid in sats from your spend token. Returns the reply text, any tool_use blocks, the model used and your remaining balance. Without a spend token it returns a Lightning invoice (L402) for this exact request.
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": {
"model": "<model>"
},
"name": "ask_ai"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| l402 | No | Optional L402 credential 'macaroon:preimage' to pay for this request without a spend token: send the same arguments that produced the invoice, plus this. | |
| model | Yes | Model ID, e.g. claude-haiku-5-5 (cheap and fast), gpt-4o-mini, gemini-3.8-flash, deepseek-ai/DeepSeek-V4.1-Flash, mistral-small-latest. Call list_models for all IDs. | |
| tools | No | Optional tool definitions in Anthropic format ({name, description, input_schema}), passed through to the model. Tool calls come back as tool_use blocks. | |
| prompt | No | A single user message. Use this or messages. | |
| system | No | Optional system prompt. | |
| messages | No | Anthropic-format conversation: [{"role":"user"|"assistant","content": string or content blocks}]. Use this or prompt. | |
| max_tokens | No | Maximum output tokens (default 1024, max 4096). | |
| tool_choice | No | Optional Anthropic tool_choice, e.g. {"type":"auto"}, {"type":"any"} or {"type":"tool","name":"..."}. |