---
title: "Build Credits, tokens and model cost of an organization's finished AI builder turns in a period (default: the current UTC calendar month), optionally of one session; credits are metered per turn and charged only once billing is enabled"
method: GET
path: "/builder/usage"
tags: ["Builder"]
---

# Build Credits, tokens and model cost of an organization's finished AI builder turns in a period (default: the current UTC calendar month), optionally of one session; credits are metered per turn and charged only once billing is enabled

`GET /builder/usage`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/builder/usage`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Query parameters

- `orgId` string: Organization id; only needed when the account belongs to several
- `from` string: ISO-8601 date or timestamp, inclusive (default: the first day of the current UTC month)
- `to` string: ISO-8601 date or timestamp, exclusive (default: the first day of the next UTC month)
- `sessionId` string: Only this builder session

## Response `200`

Usage

- object
  - `period` object, required: Turns finished at or after start and before end
    - `start` string, required: ISO-8601 timestamp
    - `end` string, required: ISO-8601 timestamp
  - `turns` integer, required
  - `inputTokens` integer, required
  - `outputTokens` integer, required
  - `cachedInputTokens` integer, required
  - `costMicros` integer, required: Model cost in micro-USD (1,000,000 = $1)
  - `millicredits` integer, required
  - `credits` number, required: Build Credits used (millicredits / 1000); metered, charged only once billing is enabled
  - `byModel` object[], required: Model calls per model, most expensive first
    - `model` string, required
    - `attempts` integer, required: Model calls made with this model
    - `inputTokens` integer, required
    - `outputTokens` integer, required
    - `cachedInputTokens` integer, required
    - `costMicros` integer, required: Model cost in micro-USD (1,000,000 = $1)
  - `usdPerCredit` number, required: Model cost in USD one Build Credit currently covers (BUILDER_USD_PER_CREDIT)

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted, or (details.reason "private_beta") the AI builder is in private beta and not open to this team yet (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: A turn is already running in this session, or the session is archived (code conflict, details.reason turn_running / archived)
- `429`: Too many requests (code rate_limited): the team started its hourly number of turns (details.reason "turn_rate") or the builder reached its capacity for the day (details.reason "daily_budget"); see Retry-After
- `501`: The AI builder is not available on this server right now (code not_configured)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
