Reference
Limits, headers and error codes shared by every product.
Usage & Limits
Read-only endpoints to inspect your key, your usage and your balance. They are authenticated with your API key (any scope), keep working when your balance is used up, and do not count against your rate limit.
/v1/me
Returns the authenticating key's metadata and the owner's email.
curl https://alapi.deep.sa/v1/me -H "Authorization: Bearer sk-alapi-..."
{
"key": {
"name": "Production",
"prefix": "sk-alapi-abc",
"scopes": ["models", "alembedding"],
"expires_at": null,
"rate_limit_per_minute": 60,
"daily_request_limit": null,
"created_at": "2026-01-01T00:00:00Z",
"last_used_at": "2026-01-02T12:00:00Z"
},
"email": "you@example.com"
}
/v1/me/usage
Returns per-day, per-key, per-model usage for a date range.
Query parameters: start and end (YYYY-MM-DD, default the last 30 days), granularity=day. The range must not exceed 90 days.
curl "https://alapi.deep.sa/v1/me/usage?start=2026-01-01&end=2026-01-31" \
-H "Authorization: Bearer sk-alapi-..."
{
"start": "2026-01-01",
"end": "2026-01-31",
"granularity": "day",
"data": [
{ "date": "2026-01-01", "key_prefix": "sk-alapi-abc", "model": "allam-7b",
"requests": 12, "tokens_prompt": 800, "tokens_completion": 1500, "failed": 0, "wallet_sar": 0 },
{ "date": "2026-01-01", "key_prefix": "sk-alapi-abc", "model": "google/gemini-3.8-flash",
"requests": 2, "tokens_prompt": 3000, "tokens_completion": 1000, "failed": 0, "wallet_sar": 0.0162 }
]
}
/v1/me/balance
Returns what pays for your calls, in the order it is used: the requests you bought before plans (any model) and old alOCR pages, then your plan's usage, then your wallet. A team member sees the team's shared balance.
curl https://alapi.deep.sa/v1/me/balance -H "Authorization: Bearer sk-alapi-..."
{
"legacy": {
"requests": { "balance": 500, "used": 120, "remaining": 380 },
"ocr_pages": { "balance": 300, "used": 50, "remaining": 250 }
},
"plan": {
"name": "Starter", "period_end": "2026-11-13T09:00:00Z", "trial_ends_at": null,
"auto_renews": true, "cancelled_at": null, "requests_at_once": 1, "requests_per_minute": 60,
"usage": {
"month": { "used_percent": 3, "resets_at": "2026-11-13T09:00:00Z" }
}
},
"wallet": { "currency": "SAR", "balance": 42.5 },
"team": null
}
Plan usage is shown as a percentage of the month's limit, with the time it resets. usage is null on a plan without a usage limit, and plan is null without a plan. wallet.balance is in SAR before VAT.
/v1/me/credits
Deprecated
Use /v1/me/balance. This endpoint returns your old prepaid balance only and will be removed. Responses carry Deprecation and Link headers.
Returns your old prepaid request and OCR page balances.
curl https://alapi.deep.sa/v1/me/credits -H "Authorization: Bearer sk-alapi-..."
{
"requests": { "balance": 500, "used": 120, "remaining": 380 },
"ocr_pages": { "balance": 300, "used": 50, "remaining": 250 },
"team": null
}
The team object is null unless you are an active member of a team.
wallet_sar in /v1/me/usage is what the calls took from your wallet, in SAR.
Billing and automatic renewal
A plan is paid a month at a time. When you pay with “Save this card for automatic renewal” ticked, the card is saved once the payment is confirmed and the plan renews itself at the end of each month: we email you three days before with the amount and the last four digits of the card. If the card is declined we try again on each of the next two days, and the plan stays usable meanwhile; after the third decline the plan ends and calls are paid from your wallet. Without a saved card, renew by hand from the dashboard.
To change plan, choose “Switch at renewal” on the pricing page or the dashboard: the new plan starts when the current month ends and nothing is charged before then. Undo the change from the dashboard at any time before that date.
We never see or store your card number: the card is entered in our payment provider's form and we keep only its reference. To remove the card, open the dashboard's Payment method card and choose Remove card; automatic renewal turns off and the reference is deleted at the provider.
Rate limits & expiry
Keys may carry a per-minute and a daily request limit. When exceeded, requests return 429 with these headers:
HTTP/1.1 429 Too Many Requests
Retry-After: 42
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1893456000
{ "error": { "message": "Rate limit exceeded...", "type": "rate_limit_error" } }
A key past its expiry returns 401 with the api_key_expired code:
HTTP/1.1 401 Unauthorized
{ "error": { "message": "API key expired", "type": "auth_error", "code": "api_key_expired" } }
CSV export
Signed-in users can download their request logs as CSV from the Usage and Dashboard pages (GET /logs/export?start=&end=).
Ready to Get Started?
Generate an API key from your dashboard and start building