Paying per call
Corvane uses HTTP status 402, Payment Required, so an agent can discover the price of a call and pay for it in the same exchange, without an account.
The exchange
- The agent calls a paid endpoint with no
Authorizationheader and no payment. - Corvane answers
402with the price and how to pay, in two formats: x402 terms in the JSON body, and an MPP challenge in theWWW-Authenticate: Paymentheader. The agent uses whichever its wallet supports. - The agent pays and repeats the same request with the proof: an
X-PAYMENTheader for x402, orAuthorization: Payment <credential>for MPP. - Corvane checks the proof and answers
200with the data.
What a 402 looks like
HTTP/1.1 402 Payment Required
WWW-Authenticate: Payment id="...", realm="...", method="test", intent="charge", request="..."
{
"x402Version": 1,
"error": "X-PAYMENT header is required",
"accepts": [{"scheme": "exact", "maxAmountRequired": "20000", "resource": ".../v1/companies", "...": "..."}],
"message": "Test terms only: USD 0.02 per call ..."
}
maxAmountRequired is in the asset's smallest unit (six decimals), so 20000 is USD 0.02. Read the terms from each response rather than hard-coding them, because the receiving details can change.
Test terms
The terms this API returns today are test terms. Payments made against them do not settle and no data is sold for value; a request with a payment header receives a test response. Use them to build and check your agent's payment flow.
Calls that are free
GET /v1/pricing returns the current price list and never asks for payment. Calls sent with a valid API key are billed to that key's plan and never receive a 402.
Prices
See pricing. The price in a 402 response always matches the published price list.