Quickstart
This walkthrough takes you from zero to a first successful OCR scan.
1. Create an account
Sign up to get a session token (JWT) and your organization’s free monthly credits.
curl -X POST https://api-ocr.vanguardinitiative.com/v1/auth/signup \
-H 'content-type: application/json' \
-d '{"email":"demo@acme.com","password":"demo-pass-123"}'2. Mint an API key
Use the session token to create an API key. The key is shown once — store it now.
curl -X POST https://api-ocr.vanguardinitiative.com/v1/auth/keys \
-H "authorization: Bearer $TOKEN" \
-H 'content-type: application/json' \
-d '{"name":"cli","scopes":["ocr"]}'3. Run OCR
Send a document image with your API key.
curl -X POST https://api-ocr.vanguardinitiative.com/v1/ocr/scan \
-H "authorization: Bearer $API_KEY" \
-F image=@passport.jpg -F type=PASSPORTconst form = new FormData();
form.append('image', file); // a File/Blob
form.append('type', 'PASSPORT');
const res = await fetch('https://api-ocr.vanguardinitiative.com/v1/ocr/scan', {
method: 'POST',
headers: { authorization: 'Bearer ' + API_KEY },
body: form,
});
const data = await res.json();import requests
with open('passport.jpg', 'rb') as f:
res = requests.post(
'https://api-ocr.vanguardinitiative.com/v1/ocr/scan',
headers={'authorization': f'Bearer {API_KEY}'},
files={'image': f},
data={'type': 'PASSPORT'},
)
print(res.json())200 Extraction result
{
"status": "success",
"service": "ocr",
"data": { "documentType": "PASSPORT", "surname": "..." },
"credits": 1,
"latencyMs": 842,
"stored": null
}4. Check your balance
curl https://api-ocr.vanguardinitiative.com/v1/account/balance \
-H "authorization: Bearer $TOKEN"That’s it. From here, explore Speech‑to‑Text, Chat, or the full API Reference.