> ## Documentation Index
> Fetch the complete documentation index at: https://vastai-80aa3a82-auto-openapi-update-79df5d46.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List Invoices (v1)

> Returns paginated, formatted invoices for the authenticated user within a required date range, with a next_token for keyset pagination.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/v1/invoices/
openapi: 3.1.0
info:
  title: Vast.ai API
  description: >-
    Vast.ai REST API for managing GPU cloud instances, machine operations, and
    AI/ML workflows.


    ## AI Agent Quick-Start


    Install the CLI skill for your agent (Claude Code, Cursor, Windsurf, etc.):
      npx skills add vast-ai/vast-cli

    CLI reference:
    https://raw.githubusercontent.com/vast-ai/vast-cli/master/vastai/SKILL.md

    SDK reference:
    https://raw.githubusercontent.com/vast-ai/vast-cli/master/vastai_sdk/SKILL.md


    ## Auth

    All endpoints require `Authorization: Bearer $VAST_API_KEY`.

    Get your key at: https://cloud.vast.ai/manage-keys/


    ## Key Quirks

    - `gpu_ram` in CLI = GB; in REST API = MB (CLI auto-converts)

    - SSH keys must be registered BEFORE creating an instance (VM: no recovery;
    Docker: can add post-create)

    - `onstart` field is limited to 4048 characters -- gzip+base64 for longer
    scripts

    - `POST /api/v0/asks/{id}/` (create instance) returns `new_contract` as the
    instance ID, not `id`

    - Poll trap: if `actual_status` becomes `exited`, `unknown`, or `offline` it
    will never reach `running` -- destroy and retry
  version: 1.0.0
  contact:
    name: Vast.ai Support
    url: https://discord.gg/vast
servers:
  - url: https://console.vast.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/v1/invoices/:
    get:
      tags:
        - Billing
      summary: List Invoices (v1)
      description: >-
        Returns paginated, formatted invoices for the authenticated user within
        a required date range, with a next_token for keyset pagination.
      parameters:
        - name: select_filters
          in: query
          required: true
          description: >
            **`when`** (required). Date range in unix seconds (UTC). Operators:
            `gte`, `gt`, `lte`, `lt`.


            **`service`** (optional). Filter by payment service: `transfer`,
            `stripe_payments`, `bitpay`, `coinbase`, `crypto.com`,
            `instance_prepay`, `paypal_manual`, `wise_manual`. Operators: `eq`,
            `neq`, `in`, `notin`.


            **Examples**:

            ```json

            // January 2026, all services

            {"when":{"gte":1767225600,"lte":1769903999}}


            // Only PayPal and Wise payouts

            {"when":{"gte":1767225600,"lte":1769903999},"service":{"in":["paypal_manual","wise_manual"]}}


            // Everything except crypto

            {"when":{"gte":1767225600,"lte":1769903999},"service":{"notin":["bitpay","coinbase","crypto.com"]}}

            ```
          schema:
            type: string
        - name: order_by
          in: query
          required: false
          description: >
            Sort results by column. Columns: `paid_on`, `amount_cents`, `when`.
            Direction: `asc` or `desc` (default `desc`).


            Example: `[{"col":"paid_on","dir":"desc"}]`
          schema:
            type: string
        - name: latest_first
          in: query
          required: false
          description: >-
            Sort newest invoices first. If `order_by` is also set, `order_by`
            takes precedence.
          schema:
            type: boolean
            default: true
            example: true
        - name: limit
          in: query
          required: false
          description: Max results per page.
          schema:
            type: integer
            minimum: 1
            default: 60
            example: 20
        - name: after_token
          in: query
          required: false
          description: >-
            Pass the `next_token` value from the previous response to fetch the
            next page of results. When the response returns `next_token: null`,
            there are no more pages.
          schema:
            type: string
            example: eyJ2YWx1ZXMiOiB7ImlkIjogMjY3MjU5N30sICJvc19wYWdlIjogMH0=
      responses:
        '200':
          description: >-
            Invalid date range or no results: {"success": false, "error":
            "Invalid date range", ...} or {"success": true, "count": 0,
            "results": [], ...}
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: True when request succeeded
                  count:
                    type: integer
                    description: Number of formatted results returned
                  total:
                    type: integer
                    description: Total matching invoices
                  results:
                    type: array
                    items:
                      type: object
                    description: >-
                      Formatted invoice entries with start, end, type, source,
                      description, amount, metadata, and items fields
                  next_token:
                    type: string
                    description: Cursor for the next page, or null
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key must be provided in the Authorization header

````