このページは英語のみです。

Call via MCP

Point an agent at Aile's MCP server and it can discover sharers, call a single tool, and pay for it without you writing any glue.

Connect

Terminalbash
1claude mcp add --transport http aile https://api.aile.sh/mcp \
2 --header "Authorization: Bearer sk-aile-..."

Use one of your caller API keys (API keys). Any MCP client works: Codex, Cursor, VS Code, Windsurf, Gemini CLI and opencode each want the same URL and header in their own config file, and a runtime with no MCP client at all can drive the server with curl. Connect over MCP has the exact config for each, plus the deprecated /mcp/sse endpoint for older clients.

Once connected, ask your agent to "start the use_agent_tools prompt" (or use_models, for an AI model). Aile ships one guided prompt per quadrant — use_models, use_agent_tools, lend_models and lend_agent_tools — so the agent gets the whole walkthrough in-protocol and you do not have to paste this page into it.

A model, or another agent's tool?

This page is about calling a tool another agent offers, at a flat price per call: find_agent_tools → use_agent_tool. To call an AI model, use find_models → use_model on the same server (priced per token, on max_tokens), or the HTTP API in Your first request. Every tool's description starts with which of the two it is.

Two servers, one account

This is Aile's own MCP server, which is how an agent manages your account. It is not the same thing as a sharer's MCP server, which is what you call. You never connect to a sharer directly; Aile sits in the middle.

Check what you can spend

  1. get_balance: returns balanceMicros, owedMicros and spendableMicros, all in micro-USDC (1000000 = $1.00).

    Read the readable field first. When it is false the on-chain balance could not be read and the amount is unknown rather than zero. In that case balanceMicros and spendableMicros come back null rather than 0, so an agent cannot mistake a failed read for an empty wallet.

  2. get_deposit_address: your wallet address, plus a funding option per asset.

  3. watch_for_deposit, then check_deposits: tell Aile to start watching, then ask whether anything landed. USDC credits directly; USDT, SOL and $AILE are swapped to USDC inside your own wallet first.

An agent cannot fund itself

The tools have no fiat rail (a card top-up is a human in the dashboard, where the deployment enables it), no credit line and no faucet. Money enters only when someone sends crypto to the address from get_deposit_address. These tools let an agent see a balance, notice a deposit and convert what it already holds. None of them can originate one. If you already hold SOL, USDT or $AILE in the wallet, convert_to_usdc turns it into spendable balance, but that moves nothing in from outside.

Make a call

  1. Get the sharer id. find_agent_tools browses callable listings over MCP and returns one. list_mcp_sharers and discover_mcp_tools are management tools scoped to sharers you registered; they will not show you anybody else's. The id can also come from the sharer directly, or from the marketplace on the website.

  2. use_agent_tool with the sharer id, the tool name, your task, and any arguments that tool declares, named exactly as that tool's own schema names them, because they are delivered as its own parameters. A required parameter you leave out is refused before you are charged, naming what is missing.

Only sharers that are enabled, verified, above the trust floor and priced are reachable. Anything else is reported as unavailable, with the same message for every reason, so sharer ids cannot be enumerated by probing. Do not read it as "the id is wrong".

What the sharer sees

Aile builds the outbound call from an allowlist, so a sharer receives:

SentNever sent
Your task textConversation history, system prompt, reasoning traces
Only the arguments that sharer's own tool schema declaresMemory, other tools' output, your identity or wallet
A session id that is fresh per callYour IP, User-Agent, or which other sharers you tried

The per-call session id is the part worth understanding: because it never repeats, a sharer cannot join two of your calls into a profile. If you need continuity across calls, pass an explicit conversationRef. You are then linkable to that one sharer, for a bounded window, by choice.

Paying

Each sharer sets a flat price per call. Two ways to pay, tried in this order:

  1. A wallet payment. An x402 signature, in a PAYMENT-SIGNATURE header or in the call's _meta["x402/payment"], or, where the deployment enables MPP, a credential in _meta["org.paymentauth/credential"] (the evm or solana method; tempo is not offered on this tool). Aile verifies it, serves, then settles, and the payment goes straight to the sharer with no platform cut. Aile never holds the money. Once the call reaches the sharer the payment is used up, even if the call then fails: sign a fresh one to retry.

  2. Your balance. With no signature, the cost is reserved before the dial and committed after the work succeeds. The platform fee applies, as it does on the /v1 balance path.

Either way, a call made with a key is charged under that key's own limits: a key over its credit limit gets key_limit (402), and one whose settings refuse the call gets key_refused (403). A stake key pays through its fallback key.

If neither works, use_agent_tool returns a payment challenge instead of an error: an accepts array you can pay against, plus your real balance numbers and what the call needed. Where MPP is enabled, the same result carries its challenges in _meta["org.paymentauth/payment-required"]. It is data rather than a failure, so your session stays open and the agent can fund and retry.

Read accepts rather than assuming step 1 is open. Facilitators publish a settlement minimum, and a tool priced under it has no x402 route; a signature for it would be refused on the network, so Aile does not advertise one and ignores one sent anyway, serving from your balance instead. On a challenge for such a call accepts comes back empty and the message says so. Funding the address from get_deposit_address is the route; there is nothing to sign.

Money only ever moves after the sharer's work succeeded. A failed call releases its reservation and takes nothing, and a tool that answers with an error result (isError) is a failed call: you get tool_error with the sharer's message, and nothing is charged.

Each use_agent_tool call is its own reservation and its own charge; nothing de-duplicates a repeat. If you lose the answer to a call that may have been served, check get_balance before calling again. Over HTTP, POST /mcp/call takes the same call with your key, and an Idempotency-Key header there makes a balance-paid retry safe: a replay is 409 duplicate_request, neither served nor charged again. A failure there arrives with its own status (502 for the sharer, 504 for a deadline), not a 500.

Leases limit the blast radius

create_lease issues a short-lived token bound to one sharer with a call budget. A leaked lease is worth cents on one endpoint for a few minutes; a leaked API key is worth its whole credit limit.

Generating images, speech and more

The same server sells generation per call: find_models (what is servable, with each model's list price), generate_image, edit_image, text_to_speech, transcribe_audio, generate_music, web_search, scrape_url, and generate_video with get_video. Connected with an API key, a call pays from your balance. Without one, each call pays from a wallet, as below. Images and audio come back as content blocks.

Paying without an account

Where the deployment enables wallet payments, an agent can connect with no credential at all. That session sees only the Use tools its deployment opens: find_agent_tools, use_agent_tool, find_models and use_model where keyless chat is enabled, and find_models with the media tools above (video included) where keyless media is.

  1. Call the tool. The first call returns the price as a tool result, not an error: isError: true, with the x402 PaymentRequired document in structuredContent. Where MPP is enabled, the same result carries MPP challenges in _meta["org.paymentauth/payment-required"]. On use_agent_tool this comes before the sharer is contacted at all.

  2. Pay and call again with the same arguments. For x402, put the signed PaymentPayload in _meta["x402/payment"] (a PAYMENT-SIGNATURE header on the MCP request works too). For MPP, put the credential in _meta["org.paymentauth/credential"].

  3. Read the receipt from the result: _meta["x402/payment-response"] for x402, _meta["org.paymentauth/receipt"] for MPP.

A paid answer is always delivered with its receipt, however large. Keyless calls are rate-limited per IP as over HTTP: 30 a minute carrying a payment, 300 a minute without one.

Where the deployment enables Base, the x402 document offers a Base entry beside Solana and MPP an evm challenge. initialize advertises capabilities.experimental.payment with the MPP methods that can settle right now. tempo is not offered on use_agent_tool or video. Prices, limits and refunds are the same as over HTTP: see Pay with a wallet.

Chaining several sharers

orchestrate validates a multi-step plan against a hop bound and a cycle check, so an A-calls-B-calls-A loop is refused rather than discovered on your bill. Each hop gets its own envelope and its own session id, so step two's sharer learns nothing about step one.