# File processing (OCR)

Processa documentos e imagens para extrair texto.

## Extrair texto de documento via OCR

> Processa PDF ou imagem, valida tamanho e quantidade de páginas e retorna o texto extraído.

```json
{"openapi":"3.0.3","info":{"title":"Genier API v3","version":"3.12.0"},"tags":[{"name":"File processing (OCR)","description":"Processa documentos e imagens para extrair texto."}],"servers":[{"url":"https://{host}/{tenant}","description":"Define o host e o tenant usados nas chamadas.","variables":{"host":{"default":"app.genier.ai"},"tenant":{"default":"my-tenant"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"OCRRequest":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Arquivo PDF ou imagem para OCR"},"lang":{"type":"string","description":"Código de idioma do OCR (padrão 'por' para português)","default":"por"}}},"OCRResponse":{"type":"object","properties":{"count":{"type":"integer","description":"Número de páginas processadas (1 para imagens)"},"text":{"type":"string","description":"Texto extraído do arquivo"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v3/ocr":{"post":{"summary":"Extrair texto de documento via OCR","description":"Processa PDF ou imagem, valida tamanho e quantidade de páginas e retorna o texto extraído.","tags":["File processing (OCR)"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/OCRRequest"}}}},"responses":{"200":{"description":"Retorna o texto extraído e a quantidade de páginas processadas.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OCRResponse"}}}},"400":{"description":"Rejeita quando o arquivo está ausente ou excede os limites de tamanho ou páginas.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Falha interna ao processar o OCR.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fortics.com.br/ai-api-reference/reference/file-processing-ocr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
