APIAgent-ready
Error responses say what to do next
The errors an agent meets most now carry a hint, the next call to make, a valid example body, or the wait before retrying, beside the fields they always had.
The most common API errors now tell the caller how to recover, in optional fields at the top level of the body. Nothing was renamed or removed: error, code, status codes and headers are exactly what they were.
- A 401 names the credentials the API accepts in
hint, andnextlists where to get one: self-registration (while it is open) and the OAuth token endpoint. - Agent management, agent keys and inbox, and approval decisions take a person's credential only. Sent a valid API key, they now answer 401 with their own message (it used to read only "Authentication required"), a
hintthat the route needs a dashboard session or a JWT, and an emptynext, instead of pointing you at a new key. Approval decisions say so before checking scopes, so a key is never told to fetch a scope that still would not let it in. - A 403 for a new key wider than the calling token says to ask only for scopes that token holds.
- A 400 for a body that fails validation lists each failing field in
issues, with its path and the reason, plus ahint. Price computation, batch computation, price verification, function registration and agent self-registration also returnexample, a minimal body that passes. - A body that is not JSON answers
code: invalid_jsonwith a hint on price computation, batch computation, price verification, function registration, API key and embed token creation, costs, credits, customers, disputes, invoices, orders, payments, pricing models, routing policies, webhooks, usage outcomes, data contributions and marketplace listings. Batch computation, price verification, function registration, costs, credits, customers, disputes, invoices, data contributions and new marketplace listings used to answer 500 here. The agent manifest lists the exact operations; other routes are unchanged. - A 429 from the general rate limits carries
retry_after(always equal to theRetry-Afterheader) andlimit. A daily quota says it is one: it resets afterretry_afterseconds, and the response names the ways past it sooner. A self-registered agent's daily limit carries the samehint,retry_afterandlimit, and itsnextis a list of steps like every othernext: apay_per_callstep where the call can be paid for, and aclaimstep. - A 403
insufficient_scopekeepsrequired_scopesand adds ahinton how to get a key that carries the scope.
The agent manifest, llms.txt and the OpenAPI contract list the new fields. For help, write to support@last-price.ai.