> ## 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.

# Billing Usage API (Beta)

> Get paginated billing usage data for the authenticated user. NOTE: This is a beta endpoint and may be subject to change.

Exports usage data for a user. Descriptions of response fields can be found below:

* **timestamp**: The timestamp the billing usage entry was created
* **sku**: The product associated with the billing usage entry
* **pricePerUnitUsd**: The price per unit in USD
* **unit**: The number of units consumed
* **amount**: The total amount charged for the billing usage entry
* **currency**: The currency charged for the billing usage entry
* **notes**: Notes about the billing usage entry
* **inferenceDetails.requestId**: The request ID associated with the inference
* **inferenceDetails.inferenceExecutionTime**: Time taken for inference execution in milliseconds
* **inferenceDetails.promptTokens**: Number of tokens requested in the prompt. Only present for LLM usage.
* **inferenceDetails.completionTokens**: Number of tokens used in the completion. Only present for LLM usage.


## OpenAPI

````yaml GET /billing/usage
openapi: 3.0.0
info:
  description: The Venice.ai API.
  termsOfService: https://venice.ai/legal/tos
  title: Venice.ai API
  version: '20260626.184905'
  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 USDC credits 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: 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 USDC 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-ai/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. Alternatively, stake DIEM tokens for daily credits (1 DIEM =
      $1/day).
    name: x402
externalDocs:
  description: Venice.ai API documentation
  url: https://docs.venice.ai
paths:
  /billing/usage:
    get:
      tags:
        - Billing
      summary: /api/v1/billing/usage
      description: >-
        Get paginated billing usage data for the authenticated user. NOTE: This
        is a beta endpoint and may be subject to change.
      operationId: getBillingUsage
      parameters:
        - description: Accept header to specify the response format
          in: header
          name: Accept
          schema:
            example: application/json, text/csv
            type: string
        - schema:
            type: string
            description: Filter by currency
            enum:
              - USD
              - VCU
              - DIEM
              - BUNDLED_CREDITS
            example: USD
          required: false
          name: currency
          in: query
        - schema:
            type: string
            format: date-time
            description: End date for filtering records (ISO 8601)
            example: '2024-12-31T23:59:59.000Z'
          required: false
          name: endDate
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            maximum: 500
            default: 200
            description: Number of items per page
            example: 200
          required: false
          name: limit
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            default: 1
            description: Page number for pagination
            example: 1
          required: false
          name: page
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
            description: Sort order for createdAt field
            example: desc
          required: false
          name: sortOrder
          in: query
        - schema:
            type: string
            format: date-time
            description: Start date for filtering records (ISO 8601)
            example: '2024-01-01T00:00:00.000Z'
          required: false
          name: startDate
          in: query
      responses:
        '200':
          description: Successful response
          headers:
            Content-Disposition:
              schema:
                description: attachment; filename=billing_usage.csv
                example: attachment; filename=billing_usage.csv
                type: string
            x-pagination-limit:
              schema:
                description: Number of items per page
                example: 200
                type: number
            x-pagination-page:
              schema:
                description: Current page number
                example: 1
                type: number
            x-pagination-total:
              schema:
                description: Total number of items
                example: 1000
                type: number
            x-pagination-total-pages:
              schema:
                description: Total number of pages
                example: 5
                type: number
          content:
            application/json:
              schema:
                type: object
                properties:
                  warningMessage:
                    type: string
                    description: >-
                      A warning message to disambiguate DIEM usage from legacy
                      DIEM (formerly VCU) usage
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        amount:
                          type: number
                          description: The total amount charged for the billing usage entry
                        currency:
                          type: string
                          enum:
                            - USD
                            - VCU
                            - DIEM
                            - BUNDLED_CREDITS
                          description: The currency charged for the billing usage entry
                          example: USD
                        inferenceDetails:
                          type: object
                          nullable: true
                          properties:
                            completionTokens:
                              type: number
                              nullable: true
                              description: >-
                                Number of tokens used in the completion. Only
                                present for LLM usage.
                            inferenceExecutionTime:
                              type: number
                              nullable: true
                              description: >-
                                Time taken for inference execution in
                                milliseconds
                            promptTokens:
                              type: number
                              nullable: true
                              description: >-
                                Number of tokens requested in the prompt. Only
                                present for LLM usage.
                            requestId:
                              type: string
                              nullable: true
                              description: Unique identifier for the inference request
                          required:
                            - completionTokens
                            - inferenceExecutionTime
                            - promptTokens
                            - requestId
                          description: >-
                            Details about the related inference request, if
                            applicable
                        notes:
                          type: string
                          description: Notes about the billing usage entry
                        pricePerUnitUsd:
                          type: number
                          description: The price per unit in USD
                        sku:
                          type: string
                          description: The product associated with the billing usage entry
                        timestamp:
                          type: string
                          description: The timestamp the billing usage entry was created
                          example: '2025-01-01T00:00:00.000Z'
                        units:
                          type: number
                          description: The number of units consumed
                      required:
                        - amount
                        - currency
                        - inferenceDetails
                        - notes
                        - pricePerUnitUsd
                        - sku
                        - timestamp
                        - units
                  pagination:
                    type: object
                    properties:
                      limit:
                        type: number
                      page:
                        type: number
                      total:
                        type: number
                      totalPages:
                        type: number
                    required:
                      - limit
                      - page
                      - total
                      - totalPages
                required:
                  - data
                  - pagination
                additionalProperties: false
                description: The response schema for the billing usage endpoint
                example:
                  data:
                    - amount: -0.1
                      currency: DIEM
                      inferenceDetails: null
                      notes: API Inference
                      pricePerUnitUsd: 0.1
                      sku: grok-imagine-image-image-unit
                      timestamp: {}
                      units: 1
                    - amount: -0.06356
                      currency: DIEM
                      inferenceDetails:
                        completionTokens: 227
                        inferenceExecutionTime: 2964
                        promptTokens: 339
                        requestId: chatcmpl-4007fd29f42b7d3c4107f4345e8d174a
                      notes: API Inference
                      pricePerUnitUsd: 2.8
                      sku: zai-org-glm-5-1-llm-output-mtoken
                      timestamp: {}
                      units: 0.000227
                  pagination:
                    limit: 1
                    page: 200
                    total: 56090
                    totalPages: 56090
            text/csv:
              schema:
                description: CSV formatted billing usage data
                type: string
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedError'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardError'
        '500':
          description: Inference processing failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardError'
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
    StandardError:
      type: object
      properties:
        error:
          type: string
          description: A description of the error
      required:
        - error
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````