> ## Documentation Index
> Fetch the complete documentation index at: https://docs.venice.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Venice API is OpenAI-compatible: use any OpenAI SDK with the base URL `https://api.venice.ai/api/v1` and a Venice API key, or pay per request from a USDC wallet through x402 with no account.
> Read model IDs from `GET /models` or `GET /models/traits` at runtime instead of hardcoding them from memory or from these pages. Models are added and retired often.
> Every model's price is in https://docs.venice.ai/pricing.md. Quote video and audio jobs with `POST /video/quote` or `POST /audio/quote` before you queue them.
> Search these docs from an MCP client at https://docs.venice.ai/mcp. The full agent guide is https://docs.venice.ai/agents.md.

# x402 交易记录

> Get paginated x402 transaction history for a wallet address. Requires Sign-in-with-x authentication for the same EVM or Solana wallet.



## OpenAPI

````yaml GET /x402/transactions/{walletAddress}
openapi: 3.0.0
info:
  description: The Venice.ai API.
  termsOfService: https://venice.ai/legal/tos
  title: Venice.ai API
  version: '20261111.072015'
  x-guidance: >-
    Venice.ai is an OpenAI-compatible inference API supporting text, image,
    audio, and video generation.


    **Authentication options:**

    - API Key: Use Bearer token in Authorization header

    - x402 Wallet: Use a prepaid x402 credit balance via EVM or Solana wallet
    (no account required)


    **For x402 wallet access:**

    1. POST /x402/top-up without headers to get payment requirements

    2. Choose one of the returned Base or Solana payment options and sign a USDC
    payment using the x402 SDK

    3. POST /x402/top-up with PAYMENT-SIGNATURE header to add credits

    4. Call any inference endpoint with SIGN-IN-WITH-X header


    **Pricing:** Prepaid credits consumed per request. Check /models for
    available models and their capabilities.
servers:
  - url: https://api.venice.ai/api/v1
security:
  - BearerAuth: []
tags:
  - description: >-
      Generate speech/audio, transcribe audio, and manage asynchronous audio
      generation jobs.
    name: Audio
  - description: >-
      Given a list of messages comprising a conversation, the model will return
      a response. Supports multimodal inputs including text, images, audio
      (input_audio), and video (video_url) for compatible models.
    name: Chat
  - description: >-
      Create vector embeddings from text. `input` must be a string or an array
      of strings. Token arrays are not supported. LangChain OpenAIEmbeddings
      must set `check_embedding_ctx_length=False` to send text instead of
      tiktoken IDs.
    name: Embeddings
  - description: >-
      Evaluate a state against typed questions and get structured answers
      (yes/no probabilities, option picks with distributions, rubric scores).
      **Beta**: This API is currently in beta and may be unstable.
      Request/response schemas and behavior may change without notice.
    name: Decisions
  - description: List and describe the various models available in the API.
    name: Models
  - description: Generate and manipulate images using AI models.
    name: Image
  - description: Generate videos using AI models.
    name: Video
  - description: List and retrieve character information for use in completions.
    name: Characters
  - description: >-
      Billing and usage analytics. **Beta**: This API is currently in beta and
      may be unstable. Endpoints, request/response schemas, and behavior may
      change without notice.
    name: Billing
  - description: Proxy JSON-RPC requests to blockchain nodes. Billed per credit.
    name: Crypto RPC
  - description: >-
      Wallet-based API access using the x402 protocol. No API key required —
      authenticate with an EVM or Solana wallet.


      **How it works:**

      1. **Authenticate** — Send a `SIGN-IN-WITH-X` header (base64-encoded
      signed SIWX payload) with any request. EVM wallets sign an EIP-4361 SIWE
      message; Solana wallets sign the Solana SIWX message with Ed25519. See the
      `siwx` security scheme for the exact format.

      2. **Top up** — `POST /x402/top-up` without a payment header returns an
      `accepts` array with Base and Solana USDC payment options. Choose one
      entry, sign it using the x402 SDK (`npm install x402`), and re-submit with
      the `PAYMENT-SIGNATURE` header (the legacy `X-402-Payment` and `X-PAYMENT`
      names are also accepted).

      3. **Use any endpoint** — All inference endpoints (chat, image, audio,
      video, embeddings) accept `siwx` as an alternative to `BearerAuth`.
      Charges are deducted from your x402 credit balance.

      4. **Monitor balance** — `GET /x402/balance/{walletAddress}` returns your
      current balance. The `X-Balance-Remaining` response header on inference
      calls also reports it.


      **Quick start (5 lines):**

      ```

      import { VeniceClient } from 'venice-x402-client'

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

      await venice.topUp(10) // $10 USDC on a supported x402 rail

      const res = await venice.chat({ model: 'zai-org-glm-5-1', messages: [{
      role: 'user', content: 'Hello!' }] })

      ```


      **Payment:** USDC on Base (chain ID 8453) or Solana mainnet. Minimum
      top-up: $5.
    name: x402
externalDocs:
  description: Venice.ai API documentation
  url: https://docs.venice.ai
paths:
  /x402/transactions/{walletAddress}:
    get:
      tags:
        - x402
      summary: /api/v1/x402/transactions/{walletAddress}
      description: >-
        Get paginated x402 transaction history for a wallet address. Requires
        Sign-in-with-x authentication for the same EVM or Solana wallet.
      operationId: getX402Transactions
      parameters:
        - description: >-
            base64-encoded JSON SIWX payload proving EVM or Solana wallet
            ownership. The legacy `X-Sign-In-With-X` header is also accepted
            during migration.
          in: header
          name: SIGN-IN-WITH-X
          required: true
          schema:
            example: siwx_example_token
            type: string
        - schema:
            type: string
            pattern: ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
            description: EVM or Solana wallet address.
            example: 0xYOUR_WALLET_ADDRESS
          required: true
          name: walletAddress
          in: path
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
            description: Maximum number of transactions to return.
            example: 50
          required: false
          name: limit
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
            maximum: 9007199254740991
            default: 0
            description: Number of transactions to skip before returning results.
            example: 0
          required: false
          name: offset
          in: query
      responses:
        '200':
          description: x402 transaction history for the wallet.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      walletAddress:
                        type: string
                        description: Normalized wallet address.
                        example: 0xyour_wallet_address
                      currentBalance:
                        type: number
                        description: Current wallet balance in USD.
                        example: 12.35
                      transactions:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Ledger entry identifier.
                              example: ledger_01HZY8M4W4Y6QZ8B6Q4P0V3J2K
                            amount:
                              type: number
                              description: Signed USD amount for the transaction.
                              example: -0.15
                            balanceAfter:
                              type: number
                              description: >-
                                Wallet balance in USD after the transaction was
                                applied.
                              example: 12.35
                            type:
                              type: string
                              description: >-
                                Transaction type such as TOP_UP, CHARGE, or
                                REFUND.
                              example: TOP_UP
                            createdAt:
                              type: string
                              description: ISO timestamp when the transaction was created.
                              example: '2026-04-03T12:34:56.000Z'
                            requestId:
                              type: string
                              nullable: true
                              description: >-
                                Associated request identifier when the
                                transaction came from usage.
                            modelId:
                              type: string
                              nullable: true
                              description: >-
                                Associated model identifier when the transaction
                                came from usage.
                          required:
                            - id
                            - amount
                            - balanceAfter
                            - type
                            - createdAt
                            - requestId
                            - modelId
                          additionalProperties: false
                      pagination:
                        type: object
                        properties:
                          limit:
                            type: number
                            description: Maximum number of transactions returned.
                            example: 50
                          offset:
                            type: number
                            description: Number of transactions skipped.
                            example: 0
                          hasMore:
                            type: boolean
                            description: >-
                              Whether more results are available after this
                              page.
                            example: false
                        required:
                          - limit
                          - offset
                          - hasMore
                        additionalProperties: false
                    required:
                      - walletAddress
                      - currentBalance
                      - transactions
                      - pagination
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedError'
        '401':
          description: >-
            Invalid Sign-in-with-x proof. A request without the header gets
            `402` instead.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/X402SignInError'
        '403':
          description: Authenticated wallet does not match the requested wallet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardError'
        '500':
          description: An unknown error occurred
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardError'
      security:
        - siwx: []
components:
  schemas:
    DetailedError:
      type: object
      properties:
        details:
          type: object
          properties: {}
          description: Details about the incorrect input
          example:
            _errors: []
            field:
              _errors:
                - Field is required
        error:
          type: string
          description: A description of the error
      required:
        - error
    X402SignInError:
      type: object
      properties:
        error:
          type: string
          description: Human-readable reason the Sign-in-with-X proof was rejected.
          example: This nonce has already been used
        code:
          type: string
          description: Machine-readable `X402_SIGN_IN_*` code naming the failed check.
          example: X402_SIGN_IN_NONCE_REUSED
        invalidReason:
          type: string
          description: >-
            The sign-in-with-x spec code (`invalid_siwx_*`) for the failed
            check, when the spec names it.
          example: invalid_siwx_nonce
      required:
        - error
        - code
      additionalProperties: false
    StandardError:
      type: object
      properties:
        error:
          type: string
          description: A description of the error
      required:
        - error
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http
    siwx:
      description: >-
        Wallet-based authentication using the x402 sign-in-with-x extension.
        Supports EVM wallets on Base (EIP-4361 SIWE, including EIP-1271 smart
        contract wallets) and Ed25519 wallets on Solana mainnet.


        **Header format:** Base64-encoded JSON proof with these fields:

        - `domain` — `api.venice.ai`

        - `address` — EVM or Solana wallet address

        - `uri` — URL of the requested resource

        - `version` — `"1"`

        - `chainId` — `"eip155:8453"` for Base or
        `"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"` for Solana

        - `type` — `"eip191"` for EVM wallets or `"ed25519"` for Solana

        - `nonce` — the `nonce` from the latest 402 challenge
        (`extensions["sign-in-with-x"].info.nonce`), or 32 random hex
        characters. Each nonce works once.

        - `issuedAt` — ISO 8601 time the proof was signed. Proofs older than 5
        minutes are rejected.

        - `expirationTime`, `notBefore`, `statement`, `resources` — optional

        - `signature` — signature over the message built from these fields: an
        EIP-4361 SIWE message for EVM (hex) or the Solana sign-in message
        (base58)


        Venice rebuilds the signed message from these fields, with the bare
        reference on its `Chain ID` line (`8453`,
        `5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`). Proofs from older clients that send
        the signed `message` itself are still accepted.


        **Example (TypeScript, viem):**

        ```

        import { privateKeyToAccount } from 'viem/accounts'

        import { createSiweMessage } from 'viem/siwe'


        const account = privateKeyToAccount(PRIVATE_KEY)

        const fields = { domain: 'api.venice.ai', address: account.address, uri:
        'https://api.venice.ai/api/v1/chat/completions', version: '1' as const,
        nonce: crypto.randomUUID().replace(/-/g, ''), issuedAt: new
        Date().toISOString(), statement: 'Sign in to Venice AI' }

        const message = createSiweMessage({ ...fields, chainId: 8453, issuedAt:
        new Date(fields.issuedAt) })

        const signature = await account.signMessage({ message })

        const header = btoa(JSON.stringify({ ...fields, chainId: 'eip155:8453',
        type: 'eip191', signature }))

        // Set header: SIGN-IN-WITH-X: <header>

        ```


        **SDK:** `npm install venice-x402-client` provides `VeniceClient` and
        `createAuthFetch` which handle this automatically.


        **Billing:** x402 users pay from a prepaid x402 credit balance. Top up
        via `POST /x402/top-up`. When balance is insufficient, endpoints return
        `402` with structured top-up instructions.
      in: header
      name: SIGN-IN-WITH-X
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.