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

# List files

> List the caller's files. Filter by creation criteria (`?tool=speech`,
`?model=eleven_turbo_v2`, `?q=hello`), by kind (`?kind=image|video|audio`
for media type, `?kind=upload|generated` for origin), or by date range
(`?from=`, `?to=`, ISO 8601).




## OpenAPI

````yaml /openapi.yaml get /files
openapi: 3.1.0
info:
  title: varg API
  version: 2.0.0
  description: |
    Unified REST API for AI media generation at `api.varg.ai/v2`.

    One API key, ~80 models across 8 providers, async jobs, stable output URLs
    on `s3.varg.ai`, files with lineage, and transparent credit billing
    (1 credit = 1 cent = $0.01).

    **The async job pattern:** every generation request returns `202 Accepted`
    with a job object (`status: queued`). Poll `GET /jobs/{id}` until the job
    reaches a terminal status (`completed`, `failed`, or `cancelled`), then read
    `output.outputs[0].url`. Alternatively, set `options.webhook_url` in the
    request to receive an HMAC-signed callback when the job finishes.
servers:
  - url: https://api.varg.ai/v2
security:
  - bearerAuth: []
tags:
  - name: Generation
    description: >-
      Create generation jobs (image, video, speech, music, transcription,
      ffmpeg, render, pipeline)
  - name: Tools
    description: Discover tools, their schemas, and call any tool generically
  - name: Jobs
    description: Poll and manage job lifecycle
  - name: Files
    description: Upload, import, probe, and manage files
  - name: Lineage
    description: Resolve which job produced a file
  - name: Pricing
    description: Estimate costs and browse the price catalog
  - name: Billing
    description: Balance, usage, and transaction history
  - name: Account
    description: Identity and API key management
paths:
  /files:
    get:
      tags:
        - Files
      summary: List files
      description: >
        List the caller's files. Filter by creation criteria (`?tool=speech`,

        `?model=eleven_turbo_v2`, `?q=hello`), by kind
        (`?kind=image|video|audio`

        for media type, `?kind=upload|generated` for origin), or by date range

        (`?from=`, `?to=`, ISO 8601).
      operationId: listFiles
      parameters:
        - name: tool
          in: query
          schema:
            type: string
        - name: model
          in: query
          schema:
            type: string
        - name: q
          in: query
          schema:
            type: string
          description: Search in prompts/titles
        - name: kind
          in: query
          schema:
            type: string
            enum:
              - image
              - video
              - audio
              - upload
              - generated
        - name: limit
          in: query
          schema:
            type: integer
            default: 50
            maximum: 100
        - name: cursor
          in: query
          schema:
            type: integer
            default: 0
        - name: from
          in: query
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: File list
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/File'
                  nextCursor:
                    type:
                      - integer
                      - 'null'
components:
  schemas:
    File:
      type: object
      properties:
        id:
          type: string
          example: file_abc123
        url:
          type: string
        media_type:
          type: string
        size_bytes:
          type: integer
        hash:
          type:
            - string
            - 'null'
        metadata:
          type:
            - object
            - 'null'
          example:
            width: 1920
            height: 1080
        filename:
          type:
            - string
            - 'null'
        title:
          type:
            - string
            - 'null'
          description: AI-generated title
        subtitle:
          type:
            - string
            - 'null'
        thumbnail_url:
          type:
            - string
            - 'null'
        origin:
          type: string
          enum:
            - upload
            - generated
        tool:
          type:
            - string
            - 'null'
          description: The tool of the job that produced this file (via lineage)
        created_at:
          type:
            - string
            - 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        varg API key (`varg_...`). Get one at [app.varg.ai](https://app.varg.ai)
        or run `bunx vargai login`. App sessions may alternatively send a
        Supabase JWT.

````