---
schema_version: "1"
id: b0b2ec2931c3e65dbd7605a5dd7ef67043a6e18c62279d16ab3f8598b76c8a7b
title: Use the OCR Model to Detect Text
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/einstein-vision-language/einstein/guides/Detect-Text-in-Images/use-ocr-model.md
canonical_url: https://developer.salesforce.com/docs/analytics/einstein-vision-language/guide/use-ocr-model.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 84a6956ec8f93049e758447957da75a217cfffbda95579fc1bfb96e798d3413d
products:
  - Einstein Vision and Language
  - Einstein Vision and Language Repo
---
# Use the OCR Model to Detect Text

In this walkthrough, you use the Einstein OCR API to pass an image into the OCR model. The model detects any text in the image and returns the text and other details in the response.

## Step 1: Get a Token

A valid JWT token is required to make API calls.

1. Find your key file. If you already created an account, locate the `einstein_platform.pem` file that you downloaded as part of that process. This file contains your private key.

2. Install cURL. You use the cURL command-line tool throughout the following walkthrough. The tool is installed by default on Linux and OSX. If you don’t already have it installed, download it from [https://curl.haxx.se/download.html](https://curl.haxx.se/download.html). Alternatively, you can use Postman to make API calls.

3. Get a token. The Einstein Intent API uses the OAuth 2.0 JWT bearer token flow for authorization. Use the [token page](https://api.einstein.ai/token) to upload your key file and generate a JWT token.

## Step 2: Call the OCR Model

Copy and paste the following cURL call into a text editor and replace `<TOKEN>` with your valid token. This command works on Windows. If you're on Linux, it can require some format changes, such as from double quotes to single quotes. This command uses the model OCRModel.

```cURL
curl -X POST -H "Authorization: Bearer <TOKEN>" -F sampleLocation="https://www.publicdomainpictures.net/pictures/240000/velka/emergency-evacuation-route-signpost.jpg" -F modelId="OCRModel" https://api.einstein.ai/v2/vision/ocr
```

The URL references this image.
![Signpost](https://developer.salesforce.com/media/emergency-evacuation-route-signpost.jpeg)

You get a response like the following JSON.

```json
{
    "object": "predictresponse",
    "probabilities": [
        {
            "probability": 0.99937266,
            "label": "ROUTE",
            "boundingBox": {
                "minX": 588,
                "minY": 692,
                "maxX": 1145,
                "maxY": 807
            },
            "attributes": {
                "pageNumber": "1"
            }
        },
        {
            "probability": 0.99471515,
            "label": "EMERGENCY",
            "boundingBox": {
                "minX": 355,
                "minY": 217,
                "maxX": 1370,
                "maxY": 328
            },
            "attributes": {
                "pageNumber": "1"
            }
        },
        {
            "probability": 0.99469215,
            "label": "EVACUATION",
            "boundingBox": {
                "minX": 345,
                "minY": 433,
                "maxX": 1376,
                "maxY": 567
            },
            "attributes": {
                "pageNumber": "1"
            }
        }
    ],
    "task": "text"
}
```

![EmergencyEvacuationRoute](https://developer.salesforce.com/media/emergency-evacuation-route-signpost_ocr.jpg)
