Skip to main content
stepfun-ai avatar

GOT-OCR 2.0 API

stepfun-ai/got-ocr/v2

Extract text from images — documents, scene text, tables, formulas, charts, and sheet music — returning one recognized text string per image, optionally as formatted Markdown/LaTeX.

0.05

Model Input

Input

  • https://images.unsplash.com/photo-1586339949216-35c2747cc36d?w=800

URLs of the image(s) to extract text from.

Additional Settings

Customize your input with more control.

Return the recognized text in formatted (Markdown/LaTeX) mode.

You need to be logged in to run this model and view results.
Log in

Model Output

Output

https://media.modelrunner.ai/cnaewUf6kKpmWEnNIHiiy.octet-stream

Generated in 36.185 seconds
Logs (1 lines)

Model Example Requests

Examples

Example output 1Example output 2

GOT-OCR 2.0 API

GOT-OCR 2.0 is a image-to-text AI model by stepfun-ai. On ModelRunner it runs through a REST API or via MCP from any AI assistant, at $0.05 per response.

POST https://queue.modelrunner.run/stepfun-ai/got-ocr/v2

cURL

# Submit a request to the queue. Input fields go at the top level of the
# body. The optional reserved "metadata" object holds your own flat string
# tags — stored on the request, never sent to the model; filter later with
# GET https://queue.modelrunner.run/requests?metadata=<url-encoded JSON>.
curl -X POST https://queue.modelrunner.run/stepfun-ai/got-ocr/v2 \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "do_format": false,
    "input_image_urls": [
      "https://images.unsplash.com/photo-1586339949216-35c2747cc36d?w=800"
    ],
    "metadata": {
      "project": "my-project"
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/stepfun-ai/got-ocr/v2/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/stepfun-ai/got-ocr/v2/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("stepfun-ai/got-ocr/v2", {
  input: {
    "do_format": false,
    "input_image_urls": [
      "https://images.unsplash.com/photo-1586339949216-35c2747cc36d?w=800"
    ]
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/stepfun-ai/got-ocr/v2",
    headers=headers,
    json={
      "do_format": false,
      "input_image_urls": [
        "https://images.unsplash.com/photo-1586339949216-35c2747cc36d?w=800"
      ]
    },
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

NameTypeRequiredDescription
input_image_urlsarrayyesURLs of the image(s) to extract text from.
do_formatbooleannoReturn the recognized text in formatted (Markdown/LaTeX) mode. Default: false.

Machine-readable: OpenAPI schema · llms.txt

Use GOT-OCR 2.0 from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and GOT-OCR 2.0 becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint stepfun-ai/got-ocr/v2.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run stepfun-ai/got-ocr/v2 on ModelRunner to generate text”. MCP setup guide.

Model Details

Model Details

GOT-OCR 2.0 reads text out of images. Pass one or more image URLs and it returns the recognized text — one string per image — covering printed documents, handwritten and scene text, as well as structured content like tables, math formulas, charts, and sheet music. Its strength is general optical character recognition across many content types in a single model: where plain OCR stops at flat text, GOT-OCR 2.0 also recovers layout-bearing and notation-heavy material. Enable formatted mode to get the result as Markdown/LaTeX so tables and equations come back with their structure intact rather than as a flat run of characters.

## Best for - Pulling the text out of scanned or photographed documents and receipts - Reading scene text and signage from natural photos - Extracting tables, math formulas, and charts as structured Markdown/LaTeX (set `do_format` to true) - Transcribing sheet music and other notation-heavy images - Batch OCR over a set of images in one call — each image yields its own text string

## Choose another model when - You want to translate or summarize the recognized text rather than just extract it — use a text model after OCR - You need word-level bounding boxes or precise layout coordinates — this returns text, not positional geometry - Your input is audio or video rather than an image — use a speech-to-text or video model

## Tips - Pass each page or photo as a separate entry in `input_image_urls`; the output array returns one recognized-text string per image, in order. - Set `do_format` to true when the image contains tables, equations, or sheet music and you want Markdown/LaTeX structure preserved; leave it false for plain text where a flat transcript is fine. - Use clear, well-lit, reasonably high-resolution images — blur, glare, and skew reduce recognition accuracy.

## Advanced Configuration - `do_format` (boolean, default `false`): when `true`, the recognized text is returned in formatted mode (Markdown/LaTeX), preserving the structure of tables and mathematical/musical notation. Leave it `false` for a plain-text transcript.

To run via the ModelRunner JavaScript client: ```js import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("stepfun-ai/got-ocr/v2", { input: { input_image_urls: [ "https://media.modelrunner.ai/example-document.png" ], do_format: true, }, }); ```