venice-x402
Wallet credits and x402 payments on Base
Developer Setup
Setup & Installation
npx skills add https://github.com/veniceai/skills --skill venice-x402npx skills add https://github.com/veniceai/skills --skill venice-x402Overview
What This Skill Does
Wallet credits and x402 payments on Base
Application
When to use this Skill
- Configuring integration settings for custom agent workflows.
- Optimizing query execution and response latency in production.
- Developing clean, standard-compliant implementations for enterprise services.
- Troubleshooting connection timeouts and authentication handshakes.
- Monitoring API rate limits and execution pipelines programmatically.
Documentation
Show Skills.md file
Venice x402 (wallet credits)
x402 is Venice's wallet-based payment flow. Pay per request with USDC on Base, no account required. Three admin endpoints plus the protocol-level 402 response returned by every inference endpoint.
| Endpoint | Auth | Purpose |
|---|---|---|
POST /x402/top-up |
None (discovery) / X-402-Payment (settlement) |
Discover payment requirements, then settle a signed USDC transfer. |
GET /x402/balance/{walletAddress} |
SIWE (X-Sign-In-With-X) |
Current USD balance for a wallet. |
GET /x402/transactions/{walletAddress} |
SIWE | Paginated ledger: TOP_UP, CHARGE, REFUND. |
For the SIWE header format itself, see venice-auth.
Pay with a wallet: end-to-end
1. Call an inference endpoint with no balance → 402
Any inference endpoint (e.g. POST /chat/completions) returns a 402 with structured topUpInstructions and siwxChallenge when the wallet balance is too low. The PAYMENT-REQUIRED response header carries the x402 v2 paymentRequired object (base64-encoded JSON containing x402Version, error, resource, accepts[], and optional extensions) — it is not the same payload as the 402 body, which is a richer balance/top-up document.
{
"error": "Payment required",
"code": "PAYMENT_REQUIRED",
"message": "Insufficient x402 balance",
"suggestedTopUpUsd": 10,
"minimumTopUpUsd": 5,
"supportedTokens": ["USDC"],
"supportedChains": ["base"],
"topUpInstructions": {
"step1": "POST /api/v1/x402/top-up with no payment header to get payment requirements",
"step2": "Sign a USDC transfer authorization using the x402 SDK (createPaymentHeader)",
"step3": "POST /api/v1/x402/top-up with the signed X-402-Payment header",
"receiverWallet": "<RECEIVER_WALLET_ADDRESS>",
"tokenAddress": "<USDC_TOKEN_ADDRESS>",
"tokenDecimals": 6,
"network": "eip155:8453",
"minimumAmountUsd": 5
},
"siwxChallenge": {
"info": { "domain": "api.venice.ai", "statement": "Sign in to Venice AI", ... },
"supportedChains": ["eip155:8453"]
}
}
Recommendations