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

# Retrieve a file



## OpenAPI

````yaml get /v1/files/{file_id}
openapi: 3.1.0
info:
  title: Perplexity AI API
  description: Perplexity AI API
  version: 1.0.0
servers:
  - url: https://api.perplexity.ai
    description: Perplexity AI API
security: []
paths:
  /v1/files/{file_id}:
    get:
      tags:
        - Batches
      summary: Retrieve a file
      operationId: getFile
      parameters:
        - $ref: '#/components/parameters/BatchFileId'
      responses:
        '200':
          description: The file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchFile'
        '404':
          description: File not found or expired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - HTTPBearer: []
components:
  parameters:
    BatchFileId:
      name: file_id
      in: path
      required: true
      schema:
        type: string
      description: File identifier (file_...)
  schemas:
    BatchFile:
      type: object
      required:
        - id
        - object
        - bytes
        - created_at
        - filename
        - purpose
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - file
        bytes:
          format: int64
          type: integer
        created_at:
          type: integer
          format: int64
          description: Unix seconds
        expires_at:
          type: integer
          format: int64
          nullable: true
          description: Unix seconds
        filename:
          type: string
        purpose:
          type: string
          enum:
            - batch
            - batch_output
          description: '`batch` for uploads, `batch_output` for output and error files'
    ApiError:
      type: object
      properties:
        error:
          type: object
          required:
            - message
            - type
            - code
          properties:
            message:
              description: Human-readable error message
              type: string
            type:
              type: string
              description: Error type identifier
            code:
              type: integer
              description: HTTP status code
            param:
              type: string
              description: Parameter that caused the error
              nullable: true
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````