Skip to content
NavenDocs
QuickstartAPI referenceOpen Naven
NavenDocs
Introduction
QuickstartHow x402 Payments WorkBuyer/Client GuideNaven CLISeller/Server Guide

Build with Naven

AI GatewayQuickstartJev evaluationsModels and pricingAPI referenceRetries and recovery

Payments

Resources

Naven Network
AI Gateway

Retries and recovery

Handle interrupted x402 evaluations and model calls without authorizing an unnecessary second payment.

Keep the request body and PAYMENT-SIGNATURE until you receive both a successful result and a successful PAYMENT-RESPONSE. If a request is interrupted, first check the authorization or transaction status before signing another payment.

Recovery of a recently completed call is best-effort and time-limited. An immediate retry with the same body and signature may return the same result, but the API is not a durable store for evaluation or generation responses. Save every successful result and payment receipt in your own application.

Response handling

ResponseAction
400, invalid_request / invalid_modelCorrect the input or choose a current model before obtaining payment.
400, invalid_paymentCheck your client's payment-header encoding.
413Reduce the request body. The error body may be plain text.
402 without a signed requestReview and sign the returned x402 offer.
402, payment_failedInspect the PAYMENT-RESPONSE receipt and wallet state before signing again.
409, request_processingThe same payment is currently being processed by this instance; retry shortly with the same body and signature.
409, payment_reusedDo not reuse that signature with a different body.
502, generation_failedEvaluation or generation failed. No settlement was requested; retry the same signed request while its authorization remains valid.
503, verification_unavailableRetry the same signed request after the facilitator recovers.
503, settlement_unavailableSettlement may be uncertain. Check the authorization and chain state before retrying or signing again.
503, catalog_unavailableWait for current model pricing before requesting a new payment offer.
503, service_unavailableThe gateway is not configured or is temporarily disabled.
Timeout or lost connectionCheck payment status before creating a new authorization.

If settlement succeeds but the result is lost and cannot be recovered, contact support with the payer address, route, model, approximate call time, and transaction hash. Never send a private key or seed phrase.

Browser playground

The playground saves an in-progress signed request in the current tab's session storage. Retry saved request resends the original route, body, and signature without asking for another wallet approval. Keep the tab open until the result and payment receipt are both displayed.

API reference

Jev evaluations, model discovery, Chat Completions, and x402 response formats.

Stocks

Add quotes, company profiles, daily prices, earnings, financial statements, and company news to an agent.

On this page

Response handlingBrowser playground