Skip to main content
Glama

create_payment

Create a Lightning invoice to pay for one AI service call. Returns payment ID and invoice details for instant micropayment.

Instructions

Create a Lightning invoice to pay for one AI service call. Returns JSON: { paymentId, invoice (BOLT11), amount (sats), expiresAt }. Each payment covers exactly one tool call — call this once per operation. Typical flow: list_models → create_payment → check_payment_status → call tool. The invoice expires in 10 minutes. Call list_models first to discover modelId values. modelId is optional — omit it to use the default (best) model. Some tools require extra params at payment time because pricing depends on them: generate_text requires prompt (price = f(char count)); send_sms, place_call, ai_call require phoneNumber; generate_video requires duration, mode, generate_audio; animate_image requires duration (100 sats/sec); edit_image requires resolution (1K=200, 2K=300, 4K=450 sats). If required params are missing, the response includes an error with the missing field names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolNameYesTool name to pay for (e.g., 'generate_text', 'generate_image', 'generate_video', 'send_sms', 'place_call')
modelIdNoOptional. AI model ID from list_models. Omit for default (best) model.
promptNoRequired for generate_text: the exact prompt (price calculated from char count, locked to payment)
systemPromptNoFor generate_text: include if using a custom system prompt (affects price)
fileContextNoFor generate_text: include extracted file text if attaching a file (affects price)
phoneNumberNoRequired for send_sms and place_call: phone in E.164 format (e.g., +14155550100)
messageNoRequired for send_sms: message text (max 120 chars)
durationMinutesNoRequired for place_call with audioUrl: duration in minutes (1-30)
durationNoRequired for generate_video: duration in seconds (3-15)
modeNoFor generate_video: quality mode (default: 'pro'). standard: 300 sats/sec (no audio), 400 sats/sec (audio). pro: 450 sats/sec (no audio), 550 sats/sec (audio).
generate_audioNoFor generate_video: include AI audio track (default: false). Adds 100 sats/sec.
resolutionNoFor edit_image: output resolution. 1K=200 sats, 2K=300 sats, 4K=450 sats. Default: 1K.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Discloses return JSON structure, invoice expiration (10 minutes), error behavior for missing required params, and pricing dependencies for each target tool. Completely transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections for purpose, return values, workflow, expiration, and per-tool requirements. Slightly long but all content is necessary; no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Comprehensive coverage of all aspects: purpose, workflow, return values, expiration, error handling, and detailed conditional parameter requirements for each tool. No gaps given the complexity of 12 parameters and multiple dependent tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema already has 100% description coverage for all 12 parameters. The description adds significant value by explaining why parameters are required (pricing formulas) and giving specific pricing rules per tool (e.g., generate_text price per char, generate_video modes with costs).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool creates a Lightning invoice for one AI service call. Immediately distinguishes from sibling tools like get_cost_estimate and check_payment_status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly describes the typical workflow (list_models → create_payment → check_payment_status → call tool) and advises to call once per operation. Also details when extra parameters are required based on the tool being paid for.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cnghockey/sats4ai-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server