Skip to main content

api

API Reference

Submit OCR jobs, poll tasks, export results, and manage webhooks with your API key.

Use the StartOCR HTTP API to submit images and PDFs from your own applications.

OpenAPI document: /api/openapi.json

Authentication

Create an API key from Settings → API Keys (sign in first). Choose scopes:

ScopeAccess
submitPOST /api/ocr (always included)
readGET /api/tasks, GET /api/tasks/:id, GET /api/export/...
exportDELETE /api/tasks/:id
Authorization: Bearer YOUR_API_KEY

Copy your key when it is created — it is shown only once. Revoke compromised keys from Settings.

Submit a job

POST https://startocr.com/api/ocr
Content-Type: application/json

Request body

FieldTypeRequiredDescription
imageBase64stringYesBase64-encoded file bytes, or a data:image/...;base64,... data URI
filenamestringNoOriginal filename (used for type detection)
provider"paddle-ai-studio" | "baidu"NoOCR engine. Defaults to "paddle-ai-studio"
documentType"general" | "invoice"NoWhen "invoice", task metadata includes extracted invoice fields after OCR

Success response

{
  "success": true,
  "taskId": "clx...",
  "provider": "paddle-ai-studio"
}

Get a task

Requires read scope.

GET https://startocr.com/api/tasks/{taskId}

When status is done, the payload includes resultText.

List tasks

GET https://startocr.com/api/tasks?page=1&pageSize=20&status=done

Delete a task

Requires export scope.

DELETE https://startocr.com/api/tasks/{taskId}

Export a result

Requires read scope. Formats: docx, xlsx, pdf.

GET https://startocr.com/api/export/{taskId}/docx

Webhooks

Configure HTTPS endpoints in Settings → Webhooks. Events:

  • ocr.done
  • ocr.failed

Headers:

  • X-Webhook-Signature: sha256=<hex>
  • X-Webhook-Timestamp
  • X-Webhook-Nonce

Verify with HMAC-SHA256 over `${timestamp}.${nonce}.${rawBody}` using the endpoint signing secret.

Providers

  • paddle-ai-studio (default) — async queue processing. Poll GET /api/tasks/:id until done or use webhooks.
  • baidu — synchronous OCR with word-level positions when available.

Billing

Each submission deducts pages based on the document page count before processing starts. Business plan members share the owner's balance. If task creation fails after deduction, pages are refunded automatically.

Errors

HTTPerror codeMeaning
401missing_api_key / invalid_api_keyAuth failed
403user_banned / insufficient_scopeBanned or missing scope
402insufficient_pagesNo remaining page balance
404not_foundTask not found
413payload_too_largeBody exceeds 10 MB
429rate_limited / daily_quota_exceededThrottled
415unsupported_media_typeWrong content type or file magic

CORS

Browser-based calls must originate from an allowed domain. Server-to-server integrations do not require CORS configuration.