Integrate with Quotra Gateway to access decentralized AI models via pay-per-call (x402).
Quotra uses x402 (HTTP 402 Payment Required) for pay-per-call authentication. No JWT tokens or API keys are required. Simply make a request, and if payment is needed, the server will respond with a 402 Payment Required status and payment headers.
1. Send POST request to the chat endpoint with your message 2. If payment is required, server responds with 402 + headers: - x-402-accept: payment requirements (amount, token) - x-402-pay-to: treasury address - x-402-network: chain (e.g. eip155:84532) 3. Send USDC payment via your wallet to the facilitator 4. Retry the request with X-PAYMENT header containing the payment proof
Content-Type: application/json X-PAYMENT: <payment_tx_hash> (only on retry after 402)
/api/v1/[delegationId]/chatOpenAI-compatible chat completions endpoint. Proxies your request securely to the underlying provider AI model.
{
"chat": "Hello!",
"systemPrompt": "You are a helpful assistant.",
"maxOutputTokens": 1500
}{
"text": "Hello there, how may I assist you today?",
"usage": {
"prompt_tokens": 12,
"completion_tokens": 18
}
}Standard HTTP status codes are used to indicate success or failure.
Payment is required to process the request. Check response headers for payment details.
Listing is expired, inactive, or out of quota.
Rate limit exceeded for the provider endpoint.