Skip to main content
Glama

infer

Run one metered inference (OpenAI-compatible), paid per token in Bitcoin BSV from your prepaid channel. Returns the completion plus a receipt: satoshis charged, model routed to, remaining balance, and the broker-signed usage receipt. Needs a funded channel key: send the HTTP header "Authorization: Bearer channelId:channelSecret" with the MCP request, or pass apiKey. Thinking models (claude-sonnet-5, claude-opus-5, claude-opus-5-5, claude-fable-5-1) bill their hidden reasoning as output, and maxTokens is raised to at least 1024 for them. On failure the tool returns isError with text "error: (): ". Codes: no_channel_key (no Authorization header and no apiKey); invalid_channel (401: channel not found, bad secret, or closed; open a new one); insufficient_balance (402: the channel cannot cover the worst case for this call; the text includes requiredSats and balanceSats; top up at the website, or lower maxTokens / turn off webSearch); invalid_request (400: unknown model or policy, a model whose provider is not enabled, or a malformed prompt; call list_models); upstream_failed (502: the model provider failed; nothing is charged, retry or pick another model). Nothing is charged on any error. This server does not verify its own receipt: check usageReceipt offline with @bsvkey/x402-bsv-client (verifyReceipt, verifyCharge, verifyMeter) against the key at /v1/receipt-key.

Input Schema

NameRequiredDescriptionDefault
modelNoModel id or policy: auto|cheapest|best, claude-*, grok-*.auto
apiKeyNochannelId:channelSecret for a funded channel. Omit to use the Authorization header (preferred).
promptYesThe user prompt.
systemNoOptional system prompt.
maxTokensNoMax output tokens.
webSearchNoLet the model search the live web (adds a per-search fee).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full disclosure burden and does so thoroughly: per-token metering, what the receipt contains, that thinking models bill hidden reasoning as output, the maxTokens floor raised to 1024 for those models, that nothing is charged on any error, and that the server does not verify its own receipt. The enumerated error codes with HTTP statuses and per-code causes go well beyond a typical tool description.

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?

Content is front-loaded: what it does, what it returns, auth requirement, then behavioral caveats, then errors. The error-code enumeration is long but each code carries a distinct action, so it earns its space; the paragraph is dense enough that an agent must parse one large block rather than discrete sections.

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?

There is no output schema, and the description compensates by naming the returned fields (completion, satoshis charged, model routed to, remaining balance, usageReceipt) and pointing at the offline verification path. For a paid, mutating-in-effect call with no annotations, nothing an agent needs in order to call it safely appears to be missing.

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 coverage is 100%, so the schema already documents all six parameters; the description nonetheless adds behavior the schema cannot express, notably that apiKey is the fallback and the Authorization header is preferred, and that maxTokens is silently raised to at least 1024 for thinking models. It does not add much to 'prompt', 'system', or 'webSearch' beyond what the schema states.

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

Purpose4/5

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

The opening sentence names a specific verb and resource ('run one metered inference') plus the payment rail (Bitcoin BSV prepaid channel), which implicitly separates it from x402_infer and xrp_infer. It stops short of naming those siblings, so an agent must infer the routing rather than being told it.

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

Usage Guidelines4/5

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

Prerequisites are explicit (a funded channel key is required, via Authorization header or apiKey) and error remediation routes the agent to concrete next steps: call list_models on invalid_request, top up or lower maxTokens on insufficient_balance, retry on upstream_failed. There is no explicit statement of when to prefer this over the x402_infer/xrp_infer siblings, which is the only gap.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.