API reference

Usage API

Read team spend, spend per model and every usage row through the Sume API: GET /v1/usage/summary and GET /v1/usage/generations, with examples and error codes.

Two endpoints give you the numbers of the Usage dashboard and its CSV export as JSON:

text
GET /v1/usage/summary        spend added up by model, day, month, member or surface
GET /v1/usage/generations    every usage row, with the CSV's columns

The live OpenAPI gives the accurate schemas.

Who can read the team's spend

The answer follows the person who made the API key:

Key ownerReadsscope in the response
Team Owner, Admin or Billing memberEvery member's usage.workspace
Any other team memberOnly that member's own usage.own
A personal workspaceThat workspace's usage.workspace

A key that reads only its owner's usage gets 403 insufficient_role when it asks for scope=workspace or names another person in member. For reports, make a read-only key from an Owner, Admin or Billing account in Dashboard → API keys.

Spend per model

bash
curl "https://api.sume.com/v1/usage/summary?from=2026-11-01&to=2026-11-30&group_by=model" \
  -H "Authorization: Bearer $SUME_API_KEY"
json
{
  "object": "usage_summary",
  "scope": "workspace",
  "currency": "usd",
  "range": {
    "from": "2026-11-01",
    "to": "2026-11-30",
    "timezone": "UTC",
    "date_field": "created_at",
    "since": "2026-11-01T00:00:00.000Z",
    "before": "2026-12-01T00:00:00.000Z"
  },
  "group_by": ["model"],
  "groups": [
    {
      "model": "seedance-2.5",
      "requests": 412,
      "charged_requests": 398,
      "refunded_requests": 11,
      "held_requests": 3,
      "charged_usd": "861.420000",
      "refunded_usd": "21.750000",
      "held_usd": "6.300000",
      "list_usd": "861.420000",
      "input_tokens": 0,
      "output_tokens": 0,
      "duration_seconds": 2985,
      "share_of_charged": "0.7204"
    },
    {
      "model": "openai/gpt-image-2.5",
      "requests": 1930,
      "charged_requests": 1921,
      "refunded_requests": 9,
      "held_requests": 0,
      "charged_usd": "334.254000",
      "refunded_usd": "1.566000",
      "held_usd": "0.000000",
      "list_usd": "334.254000",
      "input_tokens": 0,
      "output_tokens": 0,
      "duration_seconds": 0,
      "share_of_charged": "0.2796"
    }
  ],
  "totals": {
    "requests": 2342,
    "charged_requests": 2319,
    "refunded_requests": 20,
    "held_requests": 3,
    "charged_usd": "1195.674000",
    "refunded_usd": "23.316000",
    "held_usd": "6.300000",
    "list_usd": "1195.674000",
    "input_tokens": 0,
    "output_tokens": 0,
    "duration_seconds": 2985,
    "share_of_charged": "1.0000"
  }
}

totals.charged_usd is the team's spend for the range. group_by takes one or two of these, separated by a comma:

group_byEach group isFields it adds
modelOne model.model
dayOne day in timezone.day (YYYY-MM-DD)
monthOne month in timezone.month (YYYY-MM)
memberOne person.member_user_id, member_name, member_email
surfaceWhere the request was made.surface

day and month cannot be used together. Groups come in time order when you group by day or month. After that, the group with the largest charged_usd is first.

bash
# Spend per person
curl "https://api.sume.com/v1/usage/summary?from=2026-11-01&to=2026-11-30&group_by=member" \
  -H "Authorization: Bearer $SUME_API_KEY"

# Each model's spend per day, in Seoul time
curl "https://api.sume.com/v1/usage/summary?from=2026-11-01&to=2026-11-30&group_by=model,day&timezone=Asia/Seoul" \
  -H "Authorization: Bearer $SUME_API_KEY"

Every usage row

bash
curl "https://api.sume.com/v1/usage/generations?from=2026-11-01&to=2026-11-30&limit=100" \
  -H "Authorization: Bearer $SUME_API_KEY"
json
{
  "object": "list",
  "scope": "workspace",
  "currency": "usd",
  "range": {
    "from": "2026-11-01",
    "to": "2026-11-30",
    "timezone": "UTC",
    "date_field": "created_at",
    "since": "2026-11-01T00:00:00.000Z",
    "before": "2026-12-01T00:00:00.000Z"
  },
  "data": [
    {
      "created_at": "2026-11-24T08:12:44.512Z",
      "captured_at": "2026-11-24T08:13:31.007Z",
      "refunded_at": null,
      "usage_id": "usage_0f3c9a51d2b74e6f",
      "job_id": "job_0123456789abcdef",
      "run_id": null,
      "status": "captured",
      "job_status": "completed",
      "surface": "api",
      "member_user_id": "user_2abcDEF",
      "member_name": "Ada Park",
      "member_email": "ada@example.com",
      "former_member": false,
      "api_key_id": "key_7d1e",
      "api_key_prefix": "sume_live_ab12",
      "connection_id": null,
      "model": "seedance-2.5",
      "operation_type": "video_generation",
      "resolution": "720p",
      "quality": null,
      "duration_seconds": 5,
      "references": "image",
      "reference_images": 1,
      "reference_videos": 0,
      "reference_audios": 0,
      "input_tokens": null,
      "output_tokens": null,
      "cache_read_tokens": null,
      "cache_write_tokens": null,
      "price_basis": "standard",
      "funding_mode": "prepaid",
      "list_usd": "1.380000",
      "discount_usd": null,
      "charged_usd": "1.380000",
      "refunded_usd": "0.000000",
      "held_usd": "0.000000"
    }
  ],
  "has_more": true,
  "next_cursor": "MjAyNi0xMS0yNCAwODoxMjo0NC41MTIwMDArMDB8dXNhZ2VfMGYzYzlhNTFkMmI3NGU2Zg"
}

Rows come newest first. Send next_cursor back as cursor to read the next page, until has_more is false. With a model or surface filter, a page can hold fewer rows than limit while has_more is true.

bash
cursor=""
while :; do
  page=$(curl -s "https://api.sume.com/v1/usage/generations?from=2026-11-01&to=2026-11-30&limit=1000${cursor:+&cursor=$cursor}" \
    -H "Authorization: Bearer $SUME_API_KEY")
  echo "$page" | jq -c '.data[]' >> usage.jsonl
  cursor=$(echo "$page" | jq -r '.next_cursor // empty')
  [ -z "$cursor" ] && break
done

A row has the same 36 columns as the CSV, in the same order:

FieldMeaning
created_atWhen the request was made.
captured_atWhen the charge settled, or null while the amount is held.
refunded_atWhen the charge was returned, or null.
usage_idThe id of the usage row.
job_id, run_idThe generation job, and the Format, Action or Agent run that made it.
statusreserved (held while the job runs), captured (charged) or refunded (returned).
job_statusThe status of the job.
surfaceWhere the request was made: studio, director, agents, connection (a connected app), api (an API key) or other.
member_user_id, member_name, member_emailThe person whose request it was. The name and the email are null outside a team.
former_membertrue when the person left the team.
api_key_id, api_key_prefixThe API key that made the request, if a key made it.
connection_idThe connected app that made the request, if an app made it.
modelThe public id of the model.
operation_typeThe kind of work, such as video_generation.
resolution, quality, duration_secondsThe settings of the output.
references, reference_images, reference_videos, reference_audiosThe reference media that the request sent.
input_tokens, output_tokens, cache_read_tokens, cache_write_tokensToken counts of a language-model call.
price_basisHow the price was set, such as the list price or an agreed price.
funding_modeWhich balance paid.
list_usdThe list price of Sume.
discount_usdThe amount that an agreement or an event took off.
charged_usdThe amount that left the balance. It is zero unless the row is captured.
refunded_usdThe amount that was returned. It is zero unless the row is refunded.
held_usdThe amount that is held while the job runs. It is zero unless the row is reserved.

Parameters

ParameterUsed byMeaning
from, tobothThe first day and the last day, YYYY-MM-DD. Both are required, and to is included. The range can be 3,660 days at most.
timezonebothThe IANA time zone that the days are read in, such as Asia/Seoul. The default is UTC.
date_fieldbothcreated_at (default) counts a row on the day of the request. captured_at counts a row on the day that its charge settled. Billing uses captured_at.
modelbothOnly this model, by its public id as the rows show it.
memberbothOnly this person, by user id.
surfacebothOnly this surface.
scopebothworkspace or own. Without it, you get the widest scope that the key can read.
group_bysummaryOne or two of model, day, month, member, surface. It is required.
limitgenerationsRows in one page, from 1 to 1,000. The default is 100.
cursorgenerationsThe next_cursor of the page before.

Money and timing

  • Each _usd field is a string in US dollars with six decimals, such as "1.380000". The values are the same as in the CSV.
  • The prices are your prices. list_usd is the list price, and charged_usd is the amount that left the balance.
  • The data is live. A row is reserved while its job runs. Then it becomes captured or refunded. Thus the numbers of today can change. Use date_field=captured_at for numbers that agree with billing.

Limits

  • A summary reads 300,000 usage rows at most. A larger range gets 400 usage_range_too_large. Ask for fewer days.
  • Usage reports have their own rate budget, apart from other reads and from submits. GET /v1/usage/generations gets the request rate of your plan (120 each minute on Free). GET /v1/usage/summary gets a tenth of that rate (12 each minute on Free). A 429 for this budget has error.details.scope: "report".

Errors

Statuserror.codeCause
400invalid_requestA parameter is absent or not valid. The message names the parameter.
400usage_range_too_largeThe range has more rows than a summary reads.
401unauthorizedThe key is absent or not valid.
403insufficient_roleThe owner of the key can read only their own usage.
429rate_limitedThe report budget is used up. Wait for retry-after seconds.
503usage_unavailableUsage reports are not available at this time. Try again later.

GET /v1/usage gives the newest ledger rows and the spend of one thread, run or job, and it obeys the same rule for teams. A key from Dashboard → API keys does not call GET /v1/usage. It calls the two routes on this page.