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

# Extract Text (OCR)

> Extract text from an uploaded image or PDF document instantly using Optical Character Recognition (OCR).
This is a convenience alias for `GET /api/v1/fetch/{mediaId}?format=txt`. The extracted text is cached in your storage bucket, making subsequent reads lightning fast and free.




## OpenAPI

````yaml GET /api/v1/fetch/{mediaId}.txt
openapi: 3.0.0
info:
  title: Dreep API
  description: The universal media processing and storage API.
  version: 1.0.0
servers:
  - url: https://api.dreep.cloud
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/fetch/{mediaId}.txt:
    get:
      tags:
        - Media
      summary: Extract Text (OCR)
      description: >
        Extract text from an uploaded image or PDF document instantly using
        Optical Character Recognition (OCR).

        This is a convenience alias for `GET
        /api/v1/fetch/{mediaId}?format=txt`. The extracted text is cached in
        your storage bucket, making subsequent reads lightning fast and free.
      parameters:
        - name: mediaId
          in: path
          required: true
          description: Media asset ID (e.g. `2f928a3f-1d2a-4a2b`).
          schema:
            type: string
          example: med_123456789
        - name: exp
          in: query
          description: >-
            Unix timestamp (seconds) when signed URL expires. Required for
            signed folders.
          schema:
            type: integer
          example: 1774118400
        - name: sig
          in: query
          description: >-
            HMAC-SHA256 signature calculated over `assetId:expires` using your
            project's URL Signing Secret. Required for signed folders.
          schema:
            type: string
          example: a3f9e2b1c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1
      responses:
        '200':
          description: Extracted text
          content:
            text/plain:
              schema:
                type: string
                example: |-
                  Invoice #1234
                  Total: $50.00
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: boolean
          example: true
        message:
          type: string
          example: Invalid request parameters
        code:
          type: string
          example: invalid_request
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````