varg.ai Folders API

Group files into folders and file generated output automatically

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 7

GET /workspaces List folders #
POST /workspaces Create a folder #
GET /workspaces/{id} Get a folder #
PATCH /workspaces/{id} Rename a folder or change its slug #
GET /workspaces/{id}/files List files in a folder #
POST /workspaces/{id}/files Add files to a folder #
DELETE /workspaces/{id}/files/{file_id} Remove a file from a folder #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/varg-ai:varg-ai-folders-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

varg-ai-folders-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: varg Folders 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 billing: 1 credit =

    1 cent = $0.01, and models are priced pass-through — you pay what the

    provider charges, no markup. Every amount comes as integer credits

    (`*_cents` / `credits` fields) and as dollars (`*_usd` fields).


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


    **Rate limits** (sliding one-minute windows; a `429` carries `Retry-After`

    and `X-RateLimit-*`):

    - every request with an API key or session: 1,200 a minute per credential;

    - every request without one: 120 a minute per IP;

    - job submits: 60 a minute per key (300 across a team);

    - keyless search (`GET /skills/search`): 3 a minute per IP, then

    `429 sign_in_required` — sign in (`vargai login`) or send a key to keep

    searching.'
servers:
- url: https://api.varg.ai/v2
security:
- bearerAuth: []
tags:
- name: Folders
  description: Group files into folders and file generated output automatically
paths:
  /workspaces:
    get:
      tags:
      - Folders
      operationId: listFolders
      summary: List folders
      description: Lists the caller's folders. File counts are not included; use the single-folder endpoint for those.
      parameters:
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 50
      - name: cursor
        in: query
        description: Offset returned as `nextCursor` by the previous page.
        schema:
          type: integer
          minimum: 0
          default: 0
      responses:
        '200':
          description: Page of folders
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderList'
              example:
                data:
                - id: 7c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f
                  name: Campaign assets
                  slug: campaign-assets-3f9a1c2e
                  visibility: private
                  team_id: null
                  created_at: '2026-10-01T09:30:00Z'
                  updated_at: null
                nextCursor: null
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      tags:
      - Folders
      operationId: createFolder
      summary: Create a folder
      description: 'Creates a folder. It is the same object the dashboard shows. There is no

        delete endpoint; remove folders from the dashboard.


        Fails with 422 `workspace_owner_unresolvable` when the account has no

        app user to own the folder (for example a service account).'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FolderCreateRequest'
            example:
              name: Campaign assets
      responses:
        '201':
          description: Folder created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderEnvelope'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: The account has no app user who can own a folder
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: workspace_owner_unresolvable
                  message: This account has no app user to own a folder. Create the folder from the dashboard, or use a key belonging to a user account.
  /workspaces/{id}:
    get:
      tags:
      - Folders
      operationId: getFolder
      summary: Get a folder
      description: Returns one folder, including its `file_count`.
      parameters:
      - name: id
        in: path
        required: true
        description: Folder id (uuid) or slug.
        schema:
          type: string
        example: campaign-assets
      responses:
        '200':
          description: The folder
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderEnvelope'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Unknown folder (or not owned by the caller)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: workspace_not_found
                  message: Unknown workspace
    patch:
      tags:
      - Folders
      operationId: updateFolder
      summary: Rename a folder or change its slug
      description: Send `name`, `slug`, or both. An empty body is rejected with 400.
      parameters:
      - name: id
        in: path
        required: true
        description: Folder id (uuid) or slug.
        schema:
          type: string
        example: campaign-assets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FolderUpdateRequest'
            example:
              name: Q4 campaign
      responses:
        '200':
          description: The updated folder (without `file_count`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderEnvelope'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Unknown folder (or not owned by the caller)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: workspace_not_found
                  message: Unknown workspace
  /workspaces/{id}/files:
    get:
      tags:
      - Folders
      operationId: listFolderFiles
      summary: List files in a folder
      description: Lists the folder's files, most recently added first. This endpoint has no tool, kind, search or favorites filters; use `GET /files` with the `workspace` query parameter for those.
      parameters:
      - name: id
        in: path
        required: true
        description: Folder id (uuid) or slug.
        schema:
          type: string
        example: campaign-assets
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 50
      - name: cursor
        in: query
        description: Offset returned as `nextCursor` by the previous page.
        schema:
          type: integer
          minimum: 0
          default: 0
      responses:
        '200':
          description: Page of files
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderFileList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Unknown folder (or not owned by the caller)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: workspace_not_found
                  message: Unknown workspace
    post:
      tags:
      - Folders
      operationId: addFilesToFolder
      summary: Add files to a folder
      description: 'Adds up to 100 files to the folder. A file can be in several folders.

        Partial success: the response sorts every requested id into `linked`,

        `already_linked` or `not_found` (unknown or not owned by the caller),

        so one bad id does not lose the rest.'
      parameters:
      - name: id
        in: path
        required: true
        description: Folder id (uuid) or slug.
        schema:
          type: string
        example: campaign-assets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FolderFilesRequest'
      responses:
        '200':
          description: Result per file id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderFilesResult'
              example:
                linked:
                - file_abc123
                already_linked: []
                not_found:
                - file_typo
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Unknown folder (or not owned by the caller)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: workspace_not_found
                  message: Unknown workspace
  /workspaces/{id}/files/{file_id}:
    delete:
      tags:
      - Folders
      operationId: removeFileFromFolder
      summary: Remove a file from a folder
      description: Removes the file from this folder only. The file itself is kept and stays in any other folder. To delete the file, use `DELETE /files/{id}`.
      parameters:
      - name: id
        in: path
        required: true
        description: Folder id (uuid) or slug.
        schema:
          type: string
        example: campaign-assets
      - name: file_id
        in: path
        required: true
        schema:
          type: string
        example: file_abc123
      responses:
        '200':
          description: File removed from the folder
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderFileRemoved'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Unknown folder (`workspace_not_found`) or the file is not in this folder (`file_not_in_workspace`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: file_not_in_workspace
                  message: File is not in this workspace
components:
  schemas:
    Folder:
      type: object
      description: A folder that groups files. Folders are shared with the dashboard, so a folder created through the API appears in the web app.
      required:
      - id
      - name
      - slug
      - visibility
      - team_id
      - created_at
      - updated_at
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: Campaign assets
        slug:
          type: string
          description: URL-safe identifier. Accepted anywhere a folder id is accepted. Not guaranteed unique.
          example: campaign-assets-3f9a1c2e
        visibility:
          type: string
          enum:
          - private
          - public
        team_id:
          type:
          - string
          - 'null'
          description: Set when the folder belongs to a team rather than a personal account.
        created_at:
          type: string
          format: date-time
        updated_at:
          type:
          - string
          - 'null'
          format: date-time
        file_count:
          type: integer
          description: Number of files in the folder. Only returned by create (always 0) and by get-one, not by the list endpoint.
    FolderFilesRequest:
      type: object
      required:
      - file_ids
      properties:
        file_ids:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: string
          example:
          - file_abc123
          - file_def456
    FolderFileList:
      type: object
      required:
      - data
      - nextCursor
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FolderFile'
        nextCursor:
          type:
          - integer
          - 'null'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: model_not_found
            message:
              type: string
              example: 'Unknown model: flux-shnell'
            details: {}
    FolderFilesResult:
      type: object
      description: Partial success. Each requested file id lands in exactly one bucket.
      required:
      - linked
      - already_linked
      - not_found
      properties:
        linked:
          type: array
          description: Files newly added to the folder.
          items:
            type: string
        already_linked:
          type: array
          description: Files that were already in the folder.
          items:
            type: string
        not_found:
          type: array
          description: Ids that do not exist or are not owned by the caller.
          items:
            type: string
    FolderUpdateRequest:
      type: object
      description: At least one of `name` or `slug` is required.
      minProperties: 1
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 128
        slug:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
    FolderCreateRequest:
      type: object
      required:
      - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 128
          example: Campaign assets
        slug:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          description: Lowercase alphanumeric words joined by single hyphens. Derived from the name (with a short random suffix) when omitted.
    FolderList:
      type: object
      required:
      - data
      - nextCursor
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Folder'
        nextCursor:
          type:
          - integer
          - 'null'
          description: Pass as `cursor` to fetch the next page. Null on the last page.
    FolderEnvelope:
      type: object
      required:
      - workspace
      properties:
        workspace:
          $ref: '#/components/schemas/Folder'
    FolderFileRemoved:
      type: object
      required:
      - unlinked
      - file_id
      - workspace_id
      properties:
        unlinked:
          type: boolean
          const: true
        file_id:
          type: string
        workspace_id:
          type: string
          format: uuid
          description: Resolved folder id.
    FolderFile:
      type: object
      description: A file inside a folder.
      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'
          additionalProperties: true
        filename:
          type:
          - string
          - 'null'
        title:
          type:
          - string
          - 'null'
        subtitle:
          type:
          - string
          - 'null'
        thumbnail_url:
          type:
          - string
          - 'null'
        origin:
          type: string
          enum:
          - upload
          - generated
        created_by:
          type:
          - string
          - 'null'
          format: uuid
          description: Id of the user who created the file, when known.
        tool:
          type:
          - string
          - 'null'
        expires_at:
          type:
          - string
          - 'null'
          format: date-time
        created_at:
          type:
          - string
          - 'null'
          format: date-time
  responses:
    Unauthorized:
      description: Missing or invalid API key / JWT
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unauthorized:
              value:
                error:
                  code: unauthorized
                  message: Invalid or missing API key or JWT
    ValidationError:
      description: Request body failed validation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalid:
              value:
                error:
                  code: invalid_request
                  message: 'Body validation failed (text: Required)'
  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.

        '