Skip to main content
X402 lets apps and agents authenticate with a wallet and pay for Venice requests using the balance tied to that wallet.

Wallet Auth

Authenticate requests with a signed SIWE payload

Automatic Payments

Spend DIEM-backed balance automatically during requests

Agent Friendly

Works well for autonomous agents and wallet-driven flows

What is X402?

X402 is an open, neutral standard for Internet-native payments created by Coinbase. Named after the 402 Payment Required HTTP header, it aims to act as a backbone for agentic economies by allowing payments to be made entirely programmatically, without human interaction. Today, the most common form of payment used this way is cryptocurrency, and X402 can work across popular blockchains such as Solana, Ethereum, and Base. By using X402, you can allow your Claw agent to pay other agents and people on your behalf, as well as buy things for you.

Using X402 with Venice

How the process works

X402 on Venice follows a short wallet-auth flow:
Wallet / Agent
    |
    | Build a SIWE message for outerface.venice.ai on Base
    v
Sign the SIWE message with your wallet (EIP-191)
    |
    | Wrap the signed message in JSON and base64-encode it
    v
Send X-Sign-In-With-X with your Venice request
    |
    | Optional: check spendable balance first
    |     GET /api/v1/x402/balance/<address>
    |
    | Main request: call the inference endpoint
    |     POST /api/v1/chat/completions
    v
Venice validates the wallet auth, processes the request,
and charges available balance automatically
The auth header is short-lived and should be refreshed after 10 minutes. Venice uses available DIEM-backed balance automatically, or you can top up with USDC on Base if needed.
If you are an agent and need the exact request shape, see the Autonomous Agents section below.

Developers

If you’re a developer who wants to use X402 with Venice, we have our own X402 Client library. You can install it with the following one-line snippet:
npm install @venice-ai/x402-client
The following snippet can be used to buy inference on Venice with your wallet (assuming you have a wallet key in your environment):
import { VeniceClient } from '@venice-ai/x402-client'

const venice = new VeniceClient(process.env.WALLET_KEY)

const response = await venice.chat({
  model: 'kimi-k2-5',
  messages: [{ role: 'user', content: 'Hello!' }]
})

Autonomous Agents

If you are an autonomous agent, please ensure you have your own API key - if you don’t have one, you can get one with our Autonomous Agent API Key Creation guide.
For longer workflows, refresh the X-Sign-In-With-X header every 10 minutes before making additional requests.

Prompt for Claw agents

If you’re a human using a Claw agent, you can send it the following message to help it try Venice’s X402 flow:
Use the Venice API with your wallet.

Auth:
Build a SIWE message, sign it with your private key (EIP-191), then base64-encode this JSON and send it as X-Sign-In-With-X:
{"address":"0xYOUR_ADDRESS","message":"<signed SIWE message>","signature":"0x...","timestamp":<unix ms>,"chainId":8453}

Requirements:
- domain: outerface.venice.ai
- chain ID: 8453
- URI: https://outerface.venice.ai
- expiration: 10 minutes

Chat:
POST https://api.venice.ai/api/v1/chat/completions
Headers: Content-Type: application/json, X-Sign-In-With-X: <base64>
Body: {"model":"e2ee-glm-5","messages":[{"role":"user","content":"Hello"}]}

Balance: GET https://api.venice.ai/api/v1/x402/balance/<address> (same auth header)
DIEM staked on the wallet is used automatically for payment. No DIEM = top up with USDC on Base (min $5).
For safety, give the agent the private key through environment variables or a secret manager instead of pasting it directly into a prompt.

Resources

Chat Completions API

Primary Venice endpoint for agent inference

TEE & E2EE Models

Extra transport requirements for E2EE models

AI Agents

Other agent ecosystems supported by Venice

Venice Pricing

Check model pricing and availability