{"uid":"cap_1iPRQBv65hVOL8QZeSpSk","slug":"clervo-ai-messages-api-93ad19b3","name":"Clervo AI Messages API","description":"Clervo lets software use AI models and agent tools with pay-per-use x402 payments, without managing separate provider accounts or API keys.","url":"https://api.clervo.dev/v1/messages","method":"POST","headers":{},"bodySchema":null,"responseSchema":{"type":"json","example":{"id":"msg_example","role":"assistant","type":"message","model":"clervo/allam-2-7b","usage":{"input_tokens":1,"output_tokens":1},"content":[{"text":"Idempotency keeps retries from becoming a second logical operation or charge.","type":"text"}],"stop_reason":"end_turn","stop_sequence":null}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"down","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_BABcDOX7Am6jisa3fzVeT","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Send a chat message to an AI language model via pay-per-use x402 micropayment, without managing provider accounts or API keys","exampleAgentPrompt":"Use Clervo to send this message to the allam-2-7b model: 'Explain idempotency in one sentence' — it'll charge per call via x402 so no API key needed.","exampleUseCases":[{"title":"LLM calls inside an agent pipeline","prompt":"My agent needs to query an AI model on each step of a workflow — use Clervo to send each prompt to allam-2-7b and get a response, paying per call so I don't have to set up any provider accounts."},{"title":"Prototype app with no subscription","prompt":"I'm building a quick prototype that needs AI text generation but I don't want to sign up for an OpenAI or Anthropic account — can you call Clervo's messages endpoint with my prompt and pay the per-call fee in USDC?"},{"title":"Multi-model comparison on a budget","prompt":"Send the same question — 'What are the trade-offs of microservices?' — to Clervo's AI endpoint using the clervo/allam-2-7b model and show me the response and token usage so I can compare costs."}],"resultDescription":"Returns a JSON object with a message ID, the assistant role, the model used, the generated text content as an array of text blocks, token usage counts for input and output, and a stop reason indicating why generation ended.","failureModes":["Payment failure: x402 payment not provided or insufficient USDC balance — request rejected before inference","Invalid model identifier: unrecognized model string returns an error","Malformed message body: missing required fields returns a 4xx validation error","Rate limiting: too many concurrent requests may be throttled","Context length exceeded: prompt too long for selected model","Network timeout: inference takes too long and connection drops"],"whenToPreferThis":"Choose this endpoint when you need LLM inference without managing provider API keys or subscriptions, especially in agent or software contexts where pay-per-use x402 micropayments (USDC) are preferable to flat-rate billing. Ideal for lightweight agent pipelines, prototypes, or multi-tenant systems where provisioning separate provider accounts per user is impractical.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T20:25:07.122Z","isFirstParty":false}