ScoutExtract Docs

API Reference

Base URL: https://api.ramlabs.dev

All authenticated endpoints require Authorization: Bearer header.


Authentication

POST /v1/auth/register

Create a free API key (no auth required).

Request:

{ "email": "you@example.com", "name": "My App" }

Response (201):

{
  "id": "uuid",
  "key": "rex_...",
  "prefix": "rex_abcd1234",
  "name": "My App",
  "email": "you@example.com",
  "plan": "free",
  "monthlyLimit": 100,
  "rateLimit": 60,
  "message": "Store this key securely — it cannot be retrieved again."
}


Extraction

POST /v1/extract

Extract structured data from a document.

Request Body:

FieldTypeRequiredDescription
documentstringYesDocument content (text or base64-encoded)
documentTypestringNo"text" (default), "pdf", or "image"
schemastring or objectYesTemplate name or custom schema object
optionsobjectNo{ model, temperature, maxTokens, includeConfidence }
Response:
{
  "data": { "...extracted fields..." },
  "confidence": { "field_name": 0.95 },
  "model": "claude-sonnet-4-20250514",
  "usage": { "inputTokens": 245, "outputTokens": 180 },
  "processingTimeMs": 1250
}

GET /v1/schemas

List available pre-built schema templates.

GET /v1/schemas/:name

Get full details of a specific schema template.


API Keys

GET /v1/keys/me

Get current API key info and 30-day usage stats.

DELETE /v1/keys/me

Revoke the current API key (irreversible).


Billing

GET /v1/billing/status

Get current plan, limits, and monthly usage.

POST /v1/billing/checkout

Create a checkout session for a paid plan.

GET /v1/billing/portal

Get the subscription management portal URL.


Rate Limits

PlanRequests/minExtractions/monthPrice
Free60100$0
Starter601,000$49/mo
Pro1205,000$199/mo
Scale30025,000$499/mo
Rate limit exceeded returns HTTP 429.


Error Codes

CodeHTTPDescription
MISSING_DOCUMENT400No document provided
MISSING_SCHEMA400No schema provided
UNKNOWN_TEMPLATE400Invalid template name
INVALID_SCHEMA400Custom schema missing name or fields
EXTRACTION_FAILED500AI extraction error