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

# Upload File

> Upload a file.

<RequestExample>
  ```python Python theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  !pip install vlmrun

  from vlmrun.client import VLMRun
  from pathlib import Path

  client = VLMRun(api_key="<VLMRUN_API_KEY>")

  # Upload the file to the object store
  response = client.files.upload(file=Path("test.pdf"))
  ```

  ```typescript Node.js SDK theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  import { VlmRun } from "vlmrun";

  const client = new VlmRun({ apiKey: "<VLMRUN_API_KEY>" });

  // Upload the file to the object store
  const response = await client.files.upload({ filePath: "test.pdf" });
  console.log(response);
  ```
</RequestExample>


## OpenAPI

````yaml POST /v1/files
openapi: 3.1.0
info:
  title: VLM Run Unified Server
  description: Unified server for VLM Run Agent and API
  termsOfService: https://vlm.run/terms-of-service
  contact:
    name: VLM Run Support Team
    url: https://vlm.run/
    email: support@vlm.run
  version: 2026-05-19.0
servers: []
security: []
paths:
  /v1/files:
    post:
      tags:
        - files
      summary: Upload File Route
      description: Upload a file.
      operationId: upload_file_route_v1_files_post
      parameters:
        - name: purpose
          in: query
          required: false
          schema:
            enum:
              - assistants
              - batch
              - fine-tune
              - vision
              - datasets
            type: string
            default: assistants
            title: Purpose
        - name: generate_public_url
          in: query
          required: false
          schema:
            type: boolean
            description: Whether to generate a public URL for the uploaded file
            default: true
            title: Generate Public Url
          description: Whether to generate a public URL for the uploaded file
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_file_route_v1_files_post'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreFileResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Body_upload_file_route_v1_files_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
      type: object
      required:
        - file
      title: Body_upload_file_route_v1_files_post
    StoreFileResponse:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier of the file
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
          description: Name of the file
        bytes:
          type: integer
          title: Bytes
          description: Size of the file in bytes
        purpose:
          type: string
          enum:
            - assistants
            - batch
            - fine-tune
            - vision
            - datasets
          title: Purpose
          description: Purpose of the file
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Date and time when the file was created (in UTC timezone)
        object:
          type: string
          const: file
          title: Object
          description: Type of the file
          default: file
        public_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Public Url
          description: Presigned URL of the file
      type: object
      required:
        - filename
        - bytes
        - purpose
      title: StoreFileResponse
      description: Response to the file upload API.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````