OhMyGPT
Ocr

Recognize document text

POST
/v1/ocr

Extract the text of a document or image. Send the document in the model's own field: file (a URL or base64 data) for Zhipu GLM-OCR, document for Mistral OCR. Other fields go to the model unchanged, and the response is the model's own. Billed per page or by tokens, as listed in each model's pricing.

Authorization

ApiKeyAuth
headerAuthorization<token>

Request Body

application/json
  1. body

Send file or document, whichever the model reads; other fields are passed to the model unchanged.

document?

The document input, such as {"type": "document_url", "document_url": "https://…"} (Mistral OCR)

file?string

The document or image as a URL or base64 data (Zhipu GLM-OCR)

model*string

An OCR model ID from GET /v1/models

[key: string]?any

Response Body

The model's OCR result

application/json
  1. response
[key: string]?any
Example Request
curl -X POST 'https://api.ohmygpt.com/v1/ocr' \  -H 'Content-Type: application/json' \  -d '{  "model": "string"}'
Example Response
{}