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

# Retrieve File

> Read a file's metadata at /v1/files/{file_id}

## Overview

Returns a file's size, purpose, and `expires_at`. Use [the content endpoint](/api-reference/endpoint/files-content) to download the bytes.


## OpenAPI

````yaml GET /v1/files/{file_id}
openapi: 3.1.0
info:
  title: Morph API
  version: 1.2.0
  description: >-
    The Morph public API at api.morphllm.com: OpenAI- and Anthropic-compatible
    inference (chat completions, messages), the Batch API, Fast Apply code
    editing, Compact context compression, Reflex classification, and
    fine-tuning. Model ids, prices, and context windows are served live at
    https://www.morphllm.com/api/models/json.
  contact:
    name: Morph
    url: https://morphllm.com
    email: info@morphllm.com
  license:
    name: Proprietary
    url: https://morphllm.com/privacy/tos
servers:
  - url: https://api.morphllm.com
    description: Production
security: []
tags:
  - name: chat
    description: >-
      OpenAI- and Anthropic-compatible chat inference, including Fast Apply and
      WarpGrep models.
  - name: compact
    description: Context compression for long agent conversations.
  - name: reflex
    description: 'Per-turn classifiers: realtime prediction and batches.'
  - name: fine-tuning
    description: Reflex fine-tuning job lifecycle.
  - name: batch
    description: >-
      OpenAI-compatible Batch API: upload a JSONL file, run it at half price,
      download the results.
  - name: models
    description: Model listing and management.
  - name: telemetry
    description: Usage reporting hooks.
paths:
  /v1/files/{file_id}:
    get:
      tags:
        - batch
      summary: Retrieve a file
      description: >-
        Read a file's metadata: size, purpose, and when it expires. Use the
        `/content` endpoint for the bytes.
      operationId: getFile
      parameters:
        - schema:
            type: string
            description: The `file_` prefixed id of the file whose metadata you want.
            example: file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f
          required: true
          description: Identifies the file to read.
          name: file_id
          in: path
      responses:
        '200':
          description: File metadata.
          content:
            application/json:
              example:
                id: file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f
                object: file
                bytes: 48211
                created_at: 1780000000
                expires_at: 1782592000
                filename: requests.jsonl
                purpose: batch
                status: uploaded
              schema:
                $ref: '#/components/schemas/FileObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    FileObject:
      type: object
      properties:
        id:
          type: string
          description: >-
            File identifier, `file_` prefixed. Pass it as `input_file_id` when
            creating a batch.
          example: file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f
        object:
          type: string
          description: Object type, always `file`.
          example: file
        bytes:
          type: integer
          description: Size of the file in bytes.
          example: 48211
        created_at:
          type: integer
          description: Unix timestamp (seconds) for when the file was uploaded.
          example: 1780000000
        expires_at:
          type:
            - integer
            - 'null'
          description: >-
            Unix timestamp (seconds) for when the file and its content are
            deleted. Defaults to 30 days after upload (24 hours on
            zero-data-retention accounts).
          example: 1782592000
        filename:
          type: string
          description: >-
            The filename you uploaded, or the generated name for batch output
            and error files.
          example: requests.jsonl
        purpose:
          type: string
          enum:
            - batch
            - batch_output
          description: >-
            `batch` for files you upload; `batch_output` for the output and
            error files a batch produces.
          example: batch
        status:
          type: string
          enum:
            - uploaded
            - processed
            - error
          description: >-
            Deprecated OpenAI field, kept for SDK compatibility. Always
            `uploaded`.
          example: uploaded
      required:
        - id
        - object
        - bytes
        - created_at
        - expires_at
        - filename
        - purpose
        - status
      description: A file you uploaded, or one a batch wrote for you.
      example:
        id: file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f
        object: file
        bytes: 48211
        created_at: 1780000000
        expires_at: 1782592000
        filename: requests.jsonl
        purpose: batch
        status: uploaded
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_request_error
              description: Machine-readable error code.
            message:
              type: string
              example: The request body is missing the `model` field.
              description: Human-readable explanation of the failure.
          required:
            - code
            - message
      required:
        - error
      description: Standard error envelope returned by every non-2xx response.
      example:
        error:
          code: invalid_request_error
          message: The request body is missing the `model` field.
  responses:
    BadRequest:
      description: Malformed request — missing or invalid fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request_error
              message: The request body is missing the `model` field.
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid API key provided.
    NotFound:
      description: The requested resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_found
              message: No fine-tuning job found with id ftjob-8f2k1.
    RateLimited:
      description: Rate limited — retry after the interval in the Retry-After header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Too many requests. Retry in 12 seconds.
    InternalError:
      description: Internal error — safe to retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: internal_error
              message: Something went wrong on our side.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        Morph API key, passed as `Authorization: Bearer sk-...`. Create keys at
        https://www.morphllm.com/dashboard/api-keys.

````