Skip to main content
Glama

Chat completions with x402 payment

chat_completions

Send a chat completion request to any supported model. Paid tool: x402 payment (Solana USDC) is required — the first call returns 402 with the exact price; retry with _meta["x402/payment"]. Responses are non-streaming. Pass either mode (auto/eco/premium) or model (explicit id) — one of the two is required; model wins if both are sent. Use this tool to generate text; inspect models and prices first with the free list_models tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoSmart routing profile (auto/eco/premium).
modelNoExplicit model id (see list_models / /v1/models). Mutually exclusive with mode.
messagesYesChat messages (text content only).
max_tokensNoMax output tokens (billed upfront, §4.2). MCP calls are non-stream: cap per config.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
modelNo
usageNo
objectNo
choicesNo
createdNo

TDQS

A4.6/5.0
Behavior5/5

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

Annotations are all neutral false flags, so the description carries the full burden — and it discloses everything the agent needs: the paid x402 (Solana USDC) flow, the first-call-returns-402 with exact price then retry using _meta["x402/payment"], non-streaming responses, and the model-wins-if-both precedence rule. That covers the two biggest surprises for an agent: payment mechanics and response mode.

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

Conciseness5/5

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

Four dense sentences, each earning its place: purpose, payment flow, mode/model rules, and sibling pointer. The most critical information (paid, 402-first-call) is front-loaded immediately after the purpose, before any optional routing details appear.

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

Completeness4/5

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

For a complex, non-idempotent, paid (no write) tool with an output schema, it covers payment handshake, streaming behavior, parameter precedence, and the cost-free alternative. The only notable gap is no mention of get_price_estimate, though the 402-flow actually makes price pre-check less critical.

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 baseline is 3. The description adds an unambiguous behavioral rule — 'model wins if both are sent' — that clarifies the anyOf relationship beyond the schema's 'mutually exclusive' phrasing, and it explains billing for max_tokens (upfront, §4.2). That is genuine added semantics, pushing it slightly above baseline.

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?

The description states a specific verb and resource: 'Send a chat completion request to any supported model' and closes with 'Use this tool to generate text'. It differentiates against the sibling by offering 'inspect models and prices first with the free list_models tool', so the agent can distinguish generation from inspection.

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?

The description gives clear when-to-use advice ('Use this tool to generate text; inspect model names first with free list_models'), plus two conditions for calling: the mode/model requirement and the 402-payment retry. It does not explicitly address the sibling get_price_estimate; a hint that price can also be pre-checked there would make the usage guidance complete.

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.

TDQS

A4.6/5.0
Disambiguation5/5

Each tool has a clearly distinct responsibility: list_models shows the catalog, get_price_estimate computes a cost, and chat_completions generates text. The free vs paid and read-only vs state-changing boundaries are also clear, so an agent can select the right tool without ambiguity.

Naming Consistency3/5

Two tools follow a clear verb_noun pattern (list_models, get_price_estimate), but chat_completions breaks the pattern as a noun/resource name rather than an action. The naming is readable and snake_case is consistent, but the conventions are mixed.

Tool Count5/5

Three tools is exactly the right scope for this server: list models, estimate cost, and generate chat completions. Each tool earns its place and there is no obvious bloat or redundancy.

Completeness5/5

The server covers the complete workflow: inspect models and prices, get a cost estimate for a request, then pay and generate a completion. There are no apparent dead ends or missing operations for the stated purpose of paid model access through Bridgenode.