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

# Download file contents

> GET /v1/files/{fileId}/content — stream the raw file bytes.

```bash theme={null}
curl https://api.infery.ai/v1/files/file_abc123.../content \
  -H "Authorization: Bearer $INFERY_API_KEY" \
  --output report.pdf
```

Streams directly from GCS — no buffering, safe for large files. Served through our signed proxy so GCS URLs never leak to the client.


## OpenAPI

````yaml openapi.json GET /v1/files/{fileId}/content
openapi: 3.0.0
info:
  title: Infery Gateway
  description: >-
    Infery Inference Gateway — OpenAI-compatible API for LLMs, embeddings,
    images, audio, and video
  version: '1.0'
  contact: {}
servers:
  - url: https://api.infery.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security: []
tags: []
paths:
  /v1/files/{fileId}/content:
    get:
      tags:
        - Files
      summary: Download file contents
      operationId: downloadFile
      parameters:
        - name: fileId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: >-
            Raw file bytes. `Content-Type` and `Content-Disposition` reflect the
            stored metadata.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
          headers:
            Content-Type:
              schema:
                type: string
              description: MIME type detected at upload via magic bytes
            Content-Length:
              schema:
                type: integer
            Content-Disposition:
              schema:
                type: string
              description: attachment; filename="..."
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: File not found (or not in this workspace)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - ApiKey: []
components:
  schemas:
    ErrorResponseDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetailDto'
      required:
        - error
    ErrorDetailDto:
      type: object
      properties:
        message:
          type: string
          example: Model not found
          description: Human-readable error message
        type:
          type: string
          example: invalid_request_error
          description: Error category
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - quota_exceeded
            - rate_limit_error
            - server_error
        code:
          type: object
          example: model_not_found
          nullable: true
          description: Stable machine-readable error code
        param:
          type: object
          example: model
          nullable: true
          description: >-
            Name of the request parameter that triggered the error, if
            applicable
      required:
        - message
        - type
        - code
        - param
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in format: Bearer inf_***'

````