Download OpenAPI specification:Download
Read your organization's usage, plan cost and invoices from the Zeldoc platform. This is the same data the dashboard shows. Guide: https://docs.zeldoc.ai/reporting-api
Send a reporting token as a bearer token:
Authorization: Bearer zdt_...
An organization admin creates reporting tokens in the dashboard
(Organization → API tokens), where the organization id (org_id) every
path takes is shown too. A token is read-only and belongs to one
organization: it opens the endpoints listed here and nothing else, so it
cannot create keys, invite users or mint further tokens.
curl -s "https://platform.zeldoc.ai/api/orgs/$ORG_ID/key-usage?month=2026-08" \
-H "Authorization: Bearer $ZELDOC_TOKEN" \
-H "User-Agent: my-company-usage-sync/1.0"
Send an explicit, descriptive User-Agent header, for example
my-company-usage-sync/1.0. The platform sits behind Cloudflare, which
rejects the default user agent of some HTTP libraries (Python's urllib, for
one) with error 1010.
Amounts are decimal strings ("12.3456") so no precision is lost; parse
them as decimals, not floats.
prompt_tokens is the whole input, cache reads and writes included.
cache_read_input_tokens and cache_creation_input_tokens are subsets of
it, not additions. The four non-overlapping buckets that provider invoices
use are:
uncached input = prompt_tokens - cache_read_input_tokens - cache_creation_input_tokens
cache write = cache_creation_input_tokens
cache read = cache_read_input_tokens
output = completion_tokens
Models Zeldoc hosts itself (zeldoc_hosted: true) are covered by the
subscription: zero spend, but their tokens and requests count.
What an organization sees of its money is agreed per customer. When usage, the subscription or invoices are not shared with your organization, the matching endpoints answer 403; contact Zeldoc.
Spend, tokens and requests for every API key of the organization over a period, highest spend first, each split by the models it called; plus totals by model, by provider and by each of the organization's key fields. A key is usually held by one person, so per key is per person.
Pick at most one period style: month, year, months, or start_date
with end_date. Without any: the current month to date. Dates are UTC
calendar days, the end is clamped to today, and the response echoes the
range it covered. A range spans at most 366 days; backfill longer periods
as successive ranges. For a daily sync, ask for yesterday as
start_date=end_date=YYYY-MM-DD.
Spend is USD only: a range can span months with different exchange rates. Use the monthly usage endpoint for DKK.
| org_id required | string Your organization id. |
| month | string A single calendar month, |
| year | integer <int32> A calendar year (Jan..Dec), clamped so it never runs past today. |
| months | integer <int32> >= 0 Trailing calendar months ending with the current one. |
| start_date | string <date> First day to include, |
| end_date | string <date> Last day to include, |
{- "end_date": "2019-08-24",
- "key_fields": [
- {
- "default_value": { },
- "display_name": "string",
- "key": "string",
- "options": [
- {
- "key": "string",
- "label": "string"
}
], - "required": true,
- "sort_options_alphabetically": true,
- "type": "text"
}
], - "keys": [
- {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "external": {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "prompt_tokens": 0,
- "request_count": 0,
- "total_tokens": 0
}, - "fields": {
- "property1": true,
- "property2": true
}, - "id": "string",
- "key_prefix": "string",
- "models": [
- {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "model": "string",
- "prompt_tokens": 0,
- "request_count": 0,
- "spend_usd": "string",
- "total_tokens": 0,
- "zeldoc_hosted": true
}
], - "name": "string",
- "product": { },
- "prompt_tokens": 0,
- "recipient_email": { },
- "request_count": 0,
- "spend_usd": "string",
- "total_tokens": 0,
- "zeldoc": {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "prompt_tokens": 0,
- "request_count": 0,
- "total_tokens": 0
}
}
], - "org_id": "string",
- "start_date": "2019-08-24",
- "totals": {
- "by_field": [
- {
- "display_name": "string",
- "groups": [
- {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "external": {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "prompt_tokens": 0,
- "request_count": 0,
- "total_tokens": 0
}, - "key_count": 0,
- "label": "string",
- "prompt_tokens": 0,
- "request_count": 0,
- "spend_usd": "string",
- "total_tokens": 0,
- "value": { },
- "zeldoc": {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "prompt_tokens": 0,
- "request_count": 0,
- "total_tokens": 0
}
}
], - "key": "string",
- "type": "text"
}
], - "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "external": {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "prompt_tokens": 0,
- "request_count": 0,
- "total_tokens": 0
}, - "models": [
- {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "model": "string",
- "prompt_tokens": 0,
- "request_count": 0,
- "spend_usd": "string",
- "total_tokens": 0,
- "zeldoc_hosted": true
}
], - "prompt_tokens": 0,
- "providers": [
- {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "prompt_tokens": 0,
- "provider": "string",
- "request_count": 0,
- "spend_usd": "string",
- "total_tokens": 0
}
], - "request_count": 0,
- "spend_usd": "string",
- "total_tokens": 0,
- "zeldoc": {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "prompt_tokens": 0,
- "request_count": 0,
- "total_tokens": 0
}
}
}Spend in USD and DKK plus token counts, one entry per month, oldest first.
DKK uses the month's stored exchange rate; for the current month before
its rate is stored, the most recent rate is used and rate_estimated is
true. Without parameters: the trailing 12 months.
| org_id required | string Your organization id. |
| months | integer <int32> >= 0 Trailing calendar months to include, the current one included (default 12, max 60). Mutually exclusive with |
| year | integer <int32> One calendar year (January to December). Mutually exclusive with |
{- "available_years": [
- 0
], - "months": [
- {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "days": [
- {
- "cache_creation_input_tokens": 0,
- "cache_read_input_tokens": 0,
- "completion_tokens": 0,
- "date": "2019-08-24",
- "prompt_tokens": 0,
- "request_count": 0,
- "total_tokens": 0,
- "usd_spend": "string"
}
], - "dkk_spend": "string",
- "month": "2019-08-24",
- "prompt_tokens": 0,
- "rate_estimated": true,
- "request_count": 0,
- "total_tokens": 0,
- "usd_spend": "string"
}
], - "org_id": "string",
- "summary": {
- "requests_change_pct": "string",
- "tokens_change_pct": "string",
- "total_dkk_spend": "string",
- "total_requests": 0,
- "total_tokens": 0,
- "total_usd_spend": "string",
- "usd_spend_change_pct": "string"
}
}What the organization's subscription costs per month, line by line, in the requested currency. Token usage is not included; see the usage endpoints.
| org_id required | string Your organization id. |
| currency | string (Currency) Enum: "DKK" "EUR" "USD" Currency to quote the plan in (DKK, EUR or USD). Defaults to DKK. |
{- "company_size_tier": { },
- "currency": "DKK",
- "lines": [
- {
- "is_per_user": true,
- "line_total_cents": 0,
- "period": { },
- "plan": { },
- "quantity": 0,
- "service": "private_llm",
- "type": "coding",
- "unit_price_cents": 0
}
], - "missing": [
- {
- "plan": { },
- "service": "private_llm",
- "type": "coding"
}
], - "seats": 0,
- "total_monthly_cents": 0
}The invoices issued to the organization, newest first.
| org_id required | string Your organization id. |
[- {
- "currency": "DKK",
- "due_at": "2019-08-24",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "invoice_number": "string",
- "issued_at": "2019-08-24T14:15:22Z",
- "period_start": "2019-08-24",
- "status": "issued",
- "total_cents": 0
}
]| org_id required | string Your organization id. |
| invoice_id required | string <uuid> Invoice id |
{- "buyer": {
- "address_line1": "string",
- "address_line2": "string",
- "attention": "string",
- "city": "string",
- "country": "string",
- "cvr": "string",
- "ean": "string",
- "legal_name": "string",
- "payment_reference": "string",
- "postal_code": "string",
- "vat": "string"
}, - "currency": "DKK",
- "due_at": "2019-08-24",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "invoice_number": "string",
- "issued_at": "2019-08-24T14:15:22Z",
- "language": "da",
- "lines": [
- {
- "description": "string",
- "kind": "subscription",
- "line_total_cents": 0,
- "quantity": 0,
- "sort_order": 0,
- "unit_price_cents": 0
}
], - "org_id": "string",
- "period_end": "2019-08-24",
- "period_start": "2019-08-24",
- "seller": {
- "address": "string",
- "bank": "string",
- "cvr": "string",
- "legal_name": "string",
- "vat": "string"
}, - "status": "issued",
- "subscription_subtotal_cents": 0,
- "subtotal_cents": 0,
- "total_cents": 0,
- "usage_subtotal_cents": 0,
- "usd_dkk_rate": "string",
- "vat_cents": 0,
- "vat_rate_bps": 0
}