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_key401No Authorization header was sent.
invalid_api_key401The key is mistyped or revoked.
insufficient_balance402The request costs more than your balance. Nothing is charged; the error includes both amounts.
style_not_found404The style id isn't in the catalog.
invalid_request422A field is missing or out of range.
param names the field.rate_limited429Too many requests this minute. Wait for
Retry-After seconds.too_many_inflight429Too many writes running at once on this key.
server_error500Something broke on our side. Any charge is refunded automatically.
Limits
Writesper key60 a minute, 4 running at once.
Other endpointsper key300 a minute.
Regionsper request1–50.
Charactersper request800 written (400 with glitter), from up to 20,000 sent. The rest returns in remaining_text.
Line lengthper region100 characters.
Body sizeper request256 KB.