Skip to main content

About this document

Query Credits usage events and summaries by member or organization, and query Shared Add-on Credits, seat·month balance batch details and periodic seat·month consumption for an organization (seat·month batches and consumption only apply to organizations purchased via third-party channels). Complete Get API Key first, then read Conventions.

Requirements

  • Valid API key tied to the organization.

API list

1. List usage events

GET /v1/organizations/{organization_id}/members/{member_id}/usage-events Paginated retrieval of aggregated Credits usage records for a specified member.

Path parameters

ParameterTypeRequiredDescription
organization_idstringYesOrganization ID
member_idstringYesMember ID

Query parameters

ParameterTypeRequiredDescription
startDatestringNoStart time; supports RFC 3339 format or Unix millisecond timestamp
endDatestringNoEnd time; supports RFC 3339 format or Unix millisecond timestamp
sourcesstringNoFilter by source, comma-separated. Values: IDE, CLI, JetBrains Plugin, Web, QoderWork
operationsstringNoFilter by operation, comma-separated. Values: Inline Chat, Ask, Agent, Repo Wiki, Quest, Plan Mode, Code Review, Optimize Input, Voice Input, Experts, Image
modelTiersstringNoFilter by model tier, comma-separated. Values: Auto, Performance, Efficient, Lite, Ultimate, Vision, Qwen-Coder-Qoder-1.0, Kimi-K2.5, GLM-5, MiniMax-M2.5, DeepSeek-V4.0, Qwen3.5-Plus, Standard, Premium, Enterprise
maxResultsintegerNoPage size (default 20, max 100)
nextTokenstringNoPagination cursor

Success response (200 OK)

With usage records and more pages:
Some records may not return userEmail or modelTier; treat them as optional fields during integration.
No usage records / last page:
When nextToken is empty or absent, it indicates the last page.

Response fields

FieldTypeDescription
usagesarrayList of usage records
usages[].timestampint64Start time (Unix millisecond timestamp)
usages[].userIdstringUser ID
usages[].userEmailstringUser email (may be empty)
usages[].sourcestringSource: IDE, CLI, JetBrains Plugin, Web, QoderWork
usages[].operationstringOperation: Inline Chat, Ask, Agent, Repo Wiki, Quest, Plan Mode, Code Review, Optimize Input, Voice Input, Experts, Image
usages[].modelTierstringModel tier (may be empty): Auto, Performance, Efficient, Lite, Ultimate, Vision, Qwen-Coder-Qoder-1.0, Kimi-K2.5, GLM-5, MiniMax-M2.5, DeepSeek-V4.0, Qwen3.5-Plus, Standard, Premium, Enterprise
usages[].creditsfloat64Credits consumed (two decimal places)
usages[].costfloat64Billing-adjusted cost (two decimal places); usually equals credits or has a fixed conversion ratio
maxResultsint32Page size for this request
nextTokenstringNext-page cursor; empty means last page

2. Get usage summary

GET /v1/organizations/{organization_id}/members/{member_id}/usage-summary Summarize a member’s Credits consumption over a given time range by the specified dimension. The time range must not exceed 7 days.

Path parameters

ParameterTypeRequiredDescription
organization_idstringYesOrganization ID
member_idstringYesMember ID

Query parameters

ParameterTypeRequiredDescription
startDatestringYesStart time; supports RFC 3339 format or Unix millisecond timestamp
endDatestringYesEnd time; supports RFC 3339 format or Unix millisecond timestamp
groupBystringYesGrouping dimension: source (by source) or operation (by operation)

Success response (200 OK)

Grouped by source (**groupBy=source**):
Grouped by operation (**groupBy=operation**):
No usage data:

Response fields

FieldTypeDescription
summaryobjectSummary result; key is the group name (source or operation), value is total Credits
summary.{key}float64Total Credits consumed by that group (two decimal places)

Error responses

Missing required parameter (400)
Time range exceeded (400)
Invalid groupBy (400)

3. List organization usage events

GET /v1/organizations/{organization_id}/usage-events Paginated retrieval of aggregated token usage records for all members in the specified organization. The response structure is identical to the member usage events endpoint.

Path parameters

ParameterTypeRequiredDescription
organization_idstringYesOrganization ID

Query parameters

ParameterTypeRequiredDescription
startDatestringNoStart time; supports RFC 3339 format or Unix millisecond timestamp
endDatestringNoEnd time; supports RFC 3339 format or Unix millisecond timestamp
sourcesstringNoFilter by source, comma-separated. Values: IDE, CLI, JetBrains Plugin, Web, QoderWork
operationsstringNoFilter by operation, comma-separated. Values: Inline Chat, Ask, Agent, Repo Wiki, Quest, Plan Mode, Code Review, Optimize Input, Voice Input, Experts
modelTiersstringNoFilter by model tier, comma-separated. Values: Auto, Performance, Efficient, Lite, Ultimate, Vision, Qwen-Coder-Qoder-1.0, Kimi-K2.5, GLM-5, MiniMax-M2.5, DeepSeek-V4.0, Qwen3.5-Plus, Standard, Premium, Enterprise
maxResultsintegerNoPage size (default 20, max 100)
nextTokenstringNoPagination cursor

Success response (200 OK)

Some records may not return userEmail or modelTier; treat them as optional fields during integration. The endpoint does not filter out negative Credits records by default; refunds and reversals may also appear.

Response fields

Response fields are identical to “1. List usage events”.

4. List organization Shared Add-on Credits packages

GET /v1/organizations/{organization_id}/resource-packages Returns all Shared Add-on Credits details for an organization with pagination. The response contains only per-batch information and does not include summaries (aggregate limitValue / usedValue / remainingValue on the client side if needed).

Path parameters

ParameterTypeRequiredDescription
organization_idstringYesOrganization ID

Query parameters

ParameterTypeRequiredDescription
statusstringNoFilter by status. Values: active, exhausted, expired, suspended. Returns all non-deleted packages when omitted
orderBystringNoSort field. Values: expiresAt (default), activatedAt, remainingValue
orderstringNoSort direction. Values: asc (default), desc
maxResultsintegerNoPage size (default 20, max 100)
nextTokenstringNoPagination cursor from the previous response’s nextToken field

Success response (200 OK)

With Shared Add-on Credits records and more pages:
Some packages may not return activatedAt (e.g., batches not yet activated); treat it as an optional field during integration.
No Shared Add-on Credits / last page:
When nextToken is empty or absent, it indicates the last page.

Response fields

FieldTypeDescription
resourcePackagesarrayList of Shared Add-on Credits
resourcePackages[].idstringUnique credits package ID
resourcePackages[].namestringCredits package name
resourcePackages[].sourcestringCredits source: purchased, bonus (gifted), trial, carryOver (carried over), refund, dev (development/testing), sales (sales-configured)
resourcePackages[].statusstringCredits status: active (in effect), exhausted (quota used up), expired, suspended
resourcePackages[].activatedAtstringActivation time (RFC 3339 / ISO 8601, UTC; may be empty)
resourcePackages[].expiresAtstringExpiration time (RFC 3339 / ISO 8601, UTC)
resourcePackages[].limitValuefloat64Initial total quota
resourcePackages[].usedValuefloat64Consumed quota
resourcePackages[].remainingValuefloat64Remaining quota (= limitValue - usedValue)
resourcePackages[].unitstringQuota unit, typically credits
maxResultsint32Page size for this request
nextTokenstringNext-page cursor; absent when on the last page

Error responses

Invalid status parameter (400)
Invalid orderBy parameter (400)
Organization not found or no access (404)

Status reference

Shared Add-on Credits status machine:
StatusDescriptionEntry condition
activeIn effect, consumableDefault status after activation
exhaustedUsed upRemaining quota reaches zero (an exhausted package does not automatically transition to expired when it expires; it stays exhausted)
expiredExpiredAn hourly scheduled task transitions due active packages to expired
suspendedSuspendedManually suspended by admin; not consumable
Because expired is set by an hourly async job, there may be up to a 1-hour window between the actual expiration time and the status change. During this window, status is still active but expiresAt < now. For precise “truly available” checks, combine status and expiresAt on the client side:

5. List organization seat·month balance batches

This API only applies to organizations purchased via third-party channels (e.g., marketplace redemption codes).
GET /v1/organizations/{organization_id}/seat-month-batches Paginated retrieval of seat·month balance batch details for an organization. The response contains only per-batch information and does not return an aggregate total. Seat·month balance differs from the remainingSeats field in member statistics. remainingSeats only applies to organizations purchased via non-third-party channels and indicates remaining available seats within purchased seats; seat·month balance indicates how many consumable seat·month batches the organization has left. An organization may top up seat·month balance multiple times, and each batch has its own remaining quantity and expiration time.

Path parameters

ParameterTypeRequiredDescription
organization_idstringYesOrganization ID

Query parameters

ParameterTypeRequiredDescription
statusstringNoFilter by status. Values: active, exhausted, expired, refunded. Omit to return all batches
pageSizeintegerNoPage size (default 100, max 500)
pageTokenstringNoPagination cursor. Pass the nextToken from the previous response

Success response (200 OK)

With batches and more pages:
Some batches may not return redemptionCodeId, sourceChannel, thirdPartyInstanceId, or productCode; treat them as optional fields during integration.
No batches / last page:
When nextToken is absent, it indicates the last page. When paginating, pass the nextToken from the response as pageToken in the next request.

Response fields

FieldTypeDescription
seatMonthBatchesarrayList of seat·month balance batches
seatMonthBatches[].idstringBatch ID
seatMonthBatches[].redemptionCodeIdstringAssociated redemption code record ID (not the plaintext code); may be empty
seatMonthBatches[].statusstringBatch status: active, exhausted, expired, refunded
seatMonthBatches[].sourceChannelstringSource channel (e.g., redemption code, annual return, marketplace); may be empty
seatMonthBatches[].thirdPartyInstanceIdstringThird-party instance ID; may be empty
seatMonthBatches[].productCodestringThird-party product code; may be empty
seatMonthBatches[].reportRequiredbooleanWhether marketplace usage reporting is required
seatMonthBatches[].totalSeatMonthsfloat64Original total seat·months for this batch
seatMonthBatches[].usedSeatMonthsfloat64Consumed seat·months for this batch
seatMonthBatches[].remainingSeatMonthsfloat64Remaining seat·months for this batch
seatMonthBatches[].effectiveAtstringEffective time (RFC 3339 / ISO 8601, UTC)
seatMonthBatches[].expiresAtstringExpiration time (RFC 3339 / ISO 8601, UTC)
seatMonthBatches[].createdAtstringCreation time (RFC 3339 / ISO 8601, UTC)
seatMonthBatches[].updatedAtstringLast update time (RFC 3339 / ISO 8601, UTC)
pageSizeint32Page size for this request
nextTokenstringNext-page cursor; absent on the last page

How to calculate current available seat·month balance

The API does not return a total balance directly. Filter batches with the following conditions, then sum remainingSeatMonths:
For example, if 3 batches are returned:
BatchStatusRemaining seat·monthsEffective timeExpiration timeCounted toward available balance
Aactive90.0Already effectiveNot expiredYes
Bexhausted0.0Already effectiveNot expiredNo
Cactive20.0Not yet effectiveNot expiredNo
Current available seat·month total balance is 90.0.

Error responses

Invalid status parameter (400)
Invalid pageToken parameter (400)

Status reference

StatusDescriptionEntry condition
activeIn effectDefault status after batch creation; not yet exhausted, expired, or refunded
exhaustedUsed upBatch remaining quantity reaches zero
expiredExpiredEntered after system expiration reclaim
refundedRefunded/voidedEntered via refund or voiding process
Because the expired status is refreshed asynchronously by a background task, there may be a delay between the actual expiration time and the status transition. For precise “currently available” checks, evaluate status, effectiveAt, expiresAt, and remainingSeatMonths together.

6. Query periodic seat·month consumption

This API only applies to organizations purchased via third-party channels (e.g., marketplace redemption codes). It returns the actual net consumption for marketplace reconciliation/reporting, not all internal seat·month transactions.
GET /v1/organizations/{organization_id}/seat-month-usages Paginated retrieval of member seat·month consumption for a specified period range at the organization level. The response is aggregated by member and billing period; it does not return seat·month batch details.

Calculation formula

FieldDescription
consumedSeatMonthsSeat·months originally consumed by the member in that period
refundedSeatMonthsSeat·months refunded and attributable to the original seat and period
netSeatMonthsActual net consumption for the member in that period
Historical boundary: The API launch time is 2026-06-24T16:00:00Z. Data before this time may lack completeness due to missing period information; please rely on periods after launch for accurate calculations.

Path parameters

ParameterTypeRequiredDescription
organization_idstringYesOrganization ID

Query parameters

ParameterTypeRequiredDescription
periodStartstringYesPeriod range start time, RFC 3339 format, e.g. 2026-06-01T00:00:00Z
periodEndstringYesPeriod range end time, RFC 3339 format, must be later than periodStart
memberIdstringNoFilter by organization member ID
userIdstringNoFilter by user ID
pageSizeintegerNoPage size (default 100, max 500)
pageTokenstringNoPagination cursor. Pass the nextToken from the previous response
Results only include complete billing periods where periodStart >= request periodStart and periodEnd <= request periodEnd. Use actual billing period boundaries for queries.

Success response (200 OK)

With consumption records and more pages:
After a full refund, netSeatMonths may be 0. For example, if a member was assigned a seat but never used Credits, and was later removed, the seat·months are returned to the organization and net consumption for that period is 0.
No consumption records / last page:
When nextToken is absent, it indicates the last page. Pass the nextToken from the response as pageToken in the next request.

Response fields

FieldTypeDescription
seatMonthUsagesarrayMember seat·month consumption list
seatMonthUsages[].memberIdstringOrganization member ID
seatMonthUsages[].userIdstringUser ID
seatMonthUsages[].periodStartstringBilling period start time, RFC 3339 / ISO 8601 format
seatMonthUsages[].periodEndstringBilling period end time, RFC 3339 / ISO 8601 format
seatMonthUsages[].consumedSeatMonthsfloat64Original seat·months consumed by member in this period
seatMonthUsages[].refundedSeatMonthsfloat64Seat·months refunded for member in this period
seatMonthUsages[].netSeatMonthsfloat64Actual net seat·month consumption for member in this period
pageSizeint32Page size for this request
nextTokenstringNext-page cursor; absent on the last page

Error responses

Missing periodStart parameter (400)
Missing periodEnd parameter (400)
Invalid time format (400)
Invalid time range (400)

Caliber notes

Marketplace reporting caliber This API returns net consumption for marketplace reconciliation/reporting, not all internal seat·month transactions. Internal seat·month records that do not require reporting (e.g., test or gifted quotas) will not appear in the response. Refund deduction caliber If a member is removed during the current period and has not used any Credits in that period, the system returns the corresponding seat·months to the organization balance. Refunds meeting the following conditions are deducted from the member’s consumption for that period:
ConditionDescription
Same organizationRefund record belongs to the same organization
Same seat assignmentRefund record can be linked to the original seat assignment ID
Same billing periodRefund record carries the original period start and end times
Refund typeRefund transaction is REFUND / INCREASE
Sorting & pagination Results are sorted by periodStart descending (newer periods first), then memberId ascending, then userId ascending. Use nextToken from the response for pagination; absence of nextToken means no more pages.

Usage examples

List member usage events

Filter by date range

List organization usage events

Filter by source and operation

Summarize usage by source

Summarize usage by operation

List organization Shared Add-on Credits

Paginate Shared Add-on Credits

nextToken may contain URL-reserved characters; URL-encode it when passing as a query parameter (e.g., =%3D).

List organization seat·month balance batches

List only active seat·month balance batches

Paginate seat·month batches

pageToken is from the nextToken of the previous page response.

Query periodic seat·month consumption

Query seat·month consumption by member

Paginate seat·month consumption

pageToken is from the nextToken of the previous page response.

Error codes

Error codeHTTP statusDescription
BadRequest400Invalid request parameters (e.g., empty member_id, incorrect date format, time range exceeded, invalid groupBy, invalid status, invalid pageToken, periodStart/periodEnd missing or invalid)
Unauthorized401API key missing or invalid
Forbidden403No permission to access this organization
NotFound404Resource not found
InternalError500Internal server error
Error response shape: see Error responses in Conventions.