Skip to main content

Zeldoc Platform API (1.0.0)

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

Authentication

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"

User-Agent

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.

Money and tokens

  • 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.

Visibility

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.

Usage

Token usage and spend, per key and per month.

Usage per API key.

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.

Authorizations:
BearerAuth
path Parameters
org_id
required
string

Your organization id.

query Parameters
month
string

A single calendar month, YYYY-MM.

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, YYYY-MM-DD. Requires end_date.

end_date
string <date>

Last day to include, YYYY-MM-DD. Requires start_date.

Responses

Response samples

Content type
application/json
{
  • "end_date": "2019-08-24",
  • "key_fields": [
    ],
  • "keys": [
    ],
  • "org_id": "string",
  • "start_date": "2019-08-24",
  • "totals": {
    }
}

Usage per calendar month.

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.

Authorizations:
BearerAuth
path Parameters
org_id
required
string

Your organization id.

query Parameters
months
integer <int32> >= 0

Trailing calendar months to include, the current one included (default 12, max 60). Mutually exclusive with year.

year
integer <int32>

One calendar year (January to December). Mutually exclusive with months.

Responses

Response samples

Content type
application/json
{
  • "available_years": [
    ],
  • "months": [
    ],
  • "org_id": "string",
  • "summary": {
    }
}

Subscription

What the organization's plan costs.

Monthly plan cost.

What the organization's subscription costs per month, line by line, in the requested currency. Token usage is not included; see the usage endpoints.

Authorizations:
BearerAuth
path Parameters
org_id
required
string

Your organization id.

query Parameters
currency
string (Currency)
Enum: "DKK" "EUR" "USD"

Currency to quote the plan in (DKK, EUR or USD). Defaults to DKK.

Responses

Response samples

Content type
application/json
{
  • "company_size_tier": { },
  • "currency": "DKK",
  • "lines": [
    ],
  • "missing": [
    ],
  • "seats": 0,
  • "total_monthly_cents": 0
}

Invoices

Invoices issued to the organization.

List invoices.

The invoices issued to the organization, newest first.

Authorizations:
BearerAuth
path Parameters
org_id
required
string

Your organization id.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get one invoice.

Authorizations:
BearerAuth
path Parameters
org_id
required
string

Your organization id.

invoice_id
required
string <uuid>

Invoice id

Responses

Response samples

Content type
application/json
{
  • "buyer": {
    },
  • "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": [
    ],
  • "org_id": "string",
  • "period_end": "2019-08-24",
  • "period_start": "2019-08-24",
  • "seller": {
    },
  • "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
}

Download an invoice as PDF.

Authorizations:
BearerAuth
path Parameters
org_id
required
string

Your organization id.

invoice_id
required
string <uuid>

Invoice id

Responses