Documentation Index
Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
Use this file to discover all available pages before exploring further.
About this document
Query Credits usage events and summaries by member or organization. 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
| Parameter | Type | Required | Description |
|---|
organization_id | string | Yes | Organization ID |
member_id | string | Yes | Member ID |
Query parameters
| Parameter | Type | Required | Description |
|---|
startDate | string | No | Start time; supports RFC 3339 format or Unix millisecond timestamp |
endDate | string | No | End time; supports RFC 3339 format or Unix millisecond timestamp |
sources | string | No | Filter by source, comma-separated. Values: IDE, CLI, JetBrains Plugin, Web, QoderWork |
operations | string | No | Filter by operation, comma-separated. Values: Inline Chat, Ask, Agent, Repo Wiki, Quest, Plan Mode, Code Review, Optimize Input, Voice Input, Experts, Image |
modelTiers | string | No | Filter 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 |
maxResults | integer | No | Page size (default 20, max 100) |
nextCredits | string | No | Pagination cursor |
Success response (200 OK)
With usage records and more pages:
{
"usages": [
{
"timestamp": 1719849600000,
"userId": "user_abc123",
"userEmail": "user@example.com",
"source": "IDE",
"operation": "Agent",
"modelTier": "Ultimate",
"credits": 0.35,
"cost": 0.35
},
{
"timestamp": 1719849500000,
"userId": "user_abc123",
"source": "CLI",
"operation": "Completion",
"credits": 0.02,
"cost": 0.02
}
],
"maxResults": 20,
"nextCredits": "eyJwYWdlIjogMn0="
}
Some records may not return userEmail or modelTier; treat them as optional fields during integration.
No usage records / last page:
{
"usages": [],
"maxResults": 20
}
When nextCredits is empty or absent, it indicates the last page.
Response fields
| Field | Type | Description |
|---|
usages | array | List of usage records |
usages[].timestamp | int64 | Start time (Unix millisecond timestamp) |
usages[].userId | string | User ID |
usages[].userEmail | string | User email (may be empty) |
usages[].source | string | Source: IDE, CLI, JetBrains Plugin, Web, QoderWork |
usages[].operation | string | Operation: Inline Chat, Ask, Agent, Repo Wiki, Quest, Plan Mode, Code Review, Optimize Input, Voice Input, Experts, Image |
usages[].modelTier | string | Model 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[].credits | float64 | Credits consumed (two decimal places) |
usages[].cost | float64 | Billing-adjusted cost (two decimal places); usually equals credits or has a fixed conversion ratio |
maxResults | int32 | Page size for this request |
nextCredits | string | Next-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
| Parameter | Type | Required | Description |
|---|
organization_id | string | Yes | Organization ID |
member_id | string | Yes | Member ID |
Query parameters
| Parameter | Type | Required | Description |
|---|
startDate | string | Yes | Start time; supports RFC 3339 format or Unix millisecond timestamp |
endDate | string | Yes | End time; supports RFC 3339 format or Unix millisecond timestamp |
groupBy | string | Yes | Grouping dimension: source (by source) or operation (by operation) |
Success response (200 OK)
Grouped by source (**groupBy=source**):
{
"summary": {
"IDE": 12.50,
"CLI": 3.25
}
}
Grouped by operation (**groupBy=operation**):
{
"summary": {
"Agent": 8.40,
"Completion": 5.10,
"Inline Chat": 2.25
}
}
No usage data:
Response fields
| Field | Type | Description |
|---|
summary | object | Summary result; key is the group name (source or operation), value is total Credits |
summary.{key} | float64 | Total Credits consumed by that group (two decimal places) |
Error responses
Missing required parameter (400)
{
"requestId": "req_abc123",
"code": "BadRequest",
"message": "startDate is required"
}
Time range exceeded (400)
{
"requestId": "req_abc123",
"code": "BadRequest",
"message": "date range must not exceed 7 days"
}
Invalid groupBy (400)
{
"requestId": "req_abc123",
"code": "BadRequest",
"message": "groupBy is required and must be 'source' or 'operation'"
}
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
| Parameter | Type | Required | Description |
|---|
organization_id | string | Yes | Organization ID |
Query parameters
| Parameter | Type | Required | Description |
|---|
startDate | string | No | Start time; supports RFC 3339 format or Unix millisecond timestamp |
endDate | string | No | End time; supports RFC 3339 format or Unix millisecond timestamp |
sources | string | No | Filter by source, comma-separated. Values: IDE, CLI, JetBrains Plugin, Web, QoderWork |
operations | string | No | Filter by operation, comma-separated. Values: Inline Chat, Ask, Agent, Repo Wiki, Quest, Plan Mode, Code Review, Optimize Input, Voice Input, Experts |
modelTiers | string | No | Filter 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 |
maxResults | integer | No | Page size (default 20, max 100) |
nextToken | string | No | Pagination cursor |
Success response (200 OK)
{
"usages": [
{
"timestamp": 1719849600000,
"userId": "user_abc123",
"userEmail": "user@example.com",
"source": "IDE",
"operation": "Agent",
"modelTier": "Ultimate",
"credits": 0.35,
"cost": 0.35
},
{
"timestamp": 1719849500000,
"userId": "user_def456",
"source": "CLI",
"operation": "Ask",
"credits": -0.02,
"cost": -0.02
}
],
"maxResults": 20,
"nextToken": "eyJwYWdlIjogMn0="
}
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”.
Usage examples
List member usage events
curl -X GET "https://api.qoder.com/v1/organizations/org_xxx/members/member_abc123/usage-events?maxResults=20" \
-H "Authorization: Bearer <api_key>"
Filter by date range
curl -X GET "https://api.qoder.com/v1/organizations/org_xxx/members/member_abc123/usage-events?startDate=2025-06-01T00:00:00Z&endDate=2025-06-30T23:59:59Z" \
-H "Authorization: Bearer <api_key>"
List organization usage events
curl -X GET "https://api.qoder.com/v1/organizations/org_xxx/usage-events?maxResults=20" \
-H "Authorization: Bearer <api_key>"
Filter by source and operation
curl -X GET "https://api.qoder.com/v1/organizations/org_xxx/members/member_abc123/usage-events?sources=IDE&operations=Ask,Agent" \
-H "Authorization: Bearer <api_key>"
Summarize usage by source
curl -X GET "https://api.qoder.com/v1/organizations/org_xxx/members/member_abc123/usage-summary?startDate=2026-03-13T00:00:00Z&endDate=2026-03-20T00:00:00Z&groupBy=source" \
-H "Authorization: Bearer <api_key>"
Summarize usage by operation
curl -X GET "https://api.qoder.com/v1/organizations/org_xxx/members/member_abc123/usage-summary?startDate=2026-03-13T00:00:00Z&endDate=2026-03-20T00:00:00Z&groupBy=operation" \
-H "Authorization: Bearer <api_key>"
Error codes
| Error code | HTTP status | Description |
|---|
BadRequest | 400 | Invalid request parameters (e.g., empty member_id, incorrect date format, time range exceeded, invalid groupBy) |
Unauthorized | 401 | API key missing or invalid |
Forbidden | 403 | No permission to access this organization |
NotFound | 404 | Member not found |
InternalError | 500 | Internal server error |
Error response shape: see Error responses in Conventions.