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

# Extraer texto con OCR

> Extrae texto de una imagen mediante el modelo solicitado.



## OpenAPI

````yaml es/openapi/v1/openapi.localized.yaml POST /ocr
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: >-
    Una API de pasarela para acceder a diversos modelos de IA mediante endpoints
    compatibles con OpenAI.
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: Enrutamiento global
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /ocr:
    post:
      tags:
        - Gateway
      summary: Ejecutar OCR
      description: Extrae texto de una imagen mediante el modelo solicitado.
      operationId: createOcr
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OcrRequest'
      responses:
        '200':
          description: Respuesta de OCR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OcrResponse'
components:
  schemas:
    OcrRequest:
      type: object
      required:
        - model
        - image
      properties:
        model:
          type: string
        image:
          type: string
        language:
          type: string
        echo_upstream_request:
          type: boolean
        debug:
          $ref: '#/components/schemas/DebugOptions'
        provider:
          $ref: '#/components/schemas/ProviderRoutingOptions'
    OcrResponse:
      type: object
      additionalProperties: true
    DebugOptions:
      type: object
      description: >-
        Controles de depuración de la pasarela. Estas opciones nunca se reenvían
        al proveedor.
      properties:
        enabled:
          type: boolean
        return_upstream_request:
          type: boolean
        return_upstream_response:
          type: boolean
        trace:
          type: boolean
        trace_level:
          type: string
          enum:
            - summary
            - full
    ProviderRoutingOptions:
      type: object
      description: >-
        Preferencias de enrutamiento de proveedores para la selección de la
        pasarela.
      properties:
        order:
          type: array
          items:
            type: string
        only:
          type: array
          items:
            type: string
        ignore:
          type: array
          items:
            type: string
        include_alpha:
          type: boolean
          description: >-
            Incluir proveedores alpha en el enrutamiento (desactivado de forma
            predeterminada).
        allow_fallbacks:
          type: boolean
          nullable: true
          description: Permitir recurrir a otro proveedor apto tras un fallo.
        require_parameters:
          type: boolean
          nullable: true
          description: >-
            Exigir que el proveedor admita los parámetros solicitados antes del
            enrutamiento.
        required_execution_region:
          type: string
          nullable: true
          description: >-
            Restringir el enrutamiento a proveedores con la región de ejecución
            solicitada.
        required_data_region:
          type: string
          nullable: true
          description: >-
            Restringir el enrutamiento a proveedores con la región de datos
            solicitada.
        require_zero_data_retention:
          type: boolean
          nullable: true
          description: >-
            Restringir el enrutamiento a proveedores que admiten la retención
            cero de datos.
        data_collection:
          type: string
          nullable: true
          enum:
            - allow
            - deny
        zdr:
          type: boolean
          nullable: true
        enforce_distillable_text:
          type: boolean
          nullable: true
        quantizations:
          type: array
          nullable: true
          items:
            type: string
        sort:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          description: >-
            Ordenar los proveedores para esta solicitud, por ejemplo, por
            precio, latencia o rendimiento.
        max_price:
          type: object
          properties:
            prompt:
              oneOf:
                - type: number
                - type: string
            completion:
              oneOf:
                - type: number
                - type: string
            image:
              oneOf:
                - type: number
                - type: string
            audio:
              oneOf:
                - type: number
                - type: string
            request:
              oneOf:
                - type: number
                - type: string
        preferred_min_throughput:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
        preferred_max_latency:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Autenticación con token Bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.