Skip to main content

Authentication

Get your API keys and make your first authenticated request.

1. Get your API keys

Sign up or log in at console.mathpix.com and copy your app_id and app_key from the API keys page.

2. Make a request

Every request requires app_id and app_key headers. Here's a minimal example that processes an image:

curl -X POST https://api.mathpix.com/v3/text \
-H 'app_id: APP_ID' \
-H 'app_key: APP_KEY' \
-H 'Content-Type: application/json' \
--data '{"src": "https://mathpix-ocr-examples.s3.amazonaws.com/cases_hw.jpg"}'

Replace APP_ID and APP_KEY with your actual credentials.

3. Verify the response

A successful request returns JSON with the recognized content:

Example response
{
"text": "\\( x=\\frac{-b \\pm \\sqrt{b^{2}-4 a c}}{2 a} \\)",
"confidence": 0.9985,
"confidence_rate": 0.9985
}

If you see an error field instead, check that your app_id and app_key are correct and that your account is active.

Next steps