API ReferenceInference
Cryptographically private AI inference (Arcium-encrypted, x402-paywalled)
OpenAI-compatible chat completions. The prompt MUST be Arcium-encrypted client-side using `@solrouter/sdk`'s `encryptPrompt()` helper; the encrypted prompt is processed and the response returned encrypted, without Solrouter ever seeing plaintext. Pay-per-call x402 ($0.005 USDC flat per call). For per-token internal-credit billing with an API key, use POST /api/v1/chat/completions instead.
X-PAYMENT<token>
x402 USDC-on-Solana payment payload
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/api/v1/x402/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "encryptedPrompt": "base64-arcium-ciphertext...", "model": "gpt-oss:20b", "maxTokens": 2048 }'{
"encryptedResponse": "base64-arcium-ciphertext...",
"usage": {
"prompt_tokens": 18,
"completion_tokens": 124,
"total_tokens": 142
},
"cost": 0.005
}{
"error": "missing_required_fields"
}