Reference

Errors & limits

Errors share one shape with a stable code you can branch on. Limits keep every key fast.

Request

curl https://www.deepscribble.com/api/v1/handwriting \
  -H "Authorization: Bearer $DEEPSCRIBBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Dear Sam,\nThank you for the flowers. They made my whole week!",
    "regions": [
      {
        "x": 40,
        "y": 84,
        "width": 520,
        "height": 44
      },
      {
        "x": 40,
        "y": 148,
        "width": 520,
        "height": 44
      },
      {
        "x": 40,
        "y": 212,
        "width": 520,
        "height": 44
      }
    ]
  }'

Response

{
  "error": {
    "type": "billing_error",
    "code": "insufficient_balance",
    "message": "This request costs ₹0.12 and your balance is ₹0.05. Add credit at https://www.deepscribble.com/developers/billing.",
    "cost": "0.118",
    "balance": "0.050"
  },
  "request_id": "req_3b8e1f0c9d2a4e7f8a6b5c4d3e2f1a0b"
}

Error codes

missing_api_key401
No Authorization header was sent.
invalid_api_key401
The key is mistyped or revoked.
insufficient_balance402
The request costs more than your balance. Nothing is charged; the error includes both amounts.
style_not_found404
The style id isn't in the catalog.
invalid_request422
A field is missing or out of range. param names the field.
rate_limited429
Too many requests this minute. Wait for Retry-After seconds.
too_many_inflight429
Too many writes running at once on this key.
server_error500
Something broke on our side. Any charge is refunded automatically.

Limits

Writesper key
60 a minute, 4 running at once.
Other endpointsper key
300 a minute.
Regionsper request
1–50.
Charactersper request
800 written (400 with glitter), from up to 20,000 sent. The rest returns in remaining_text.
Line lengthper region
100 characters.
Body sizeper request
256 KB.
NextPricing