Skip to main content

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

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)
nextCreditsstringNoPagination 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

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
nextCreditsstringNext-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**):
{
  "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:
{
  "summary": {}
}

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)
{
  "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

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)

{
  "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 codeHTTP statusDescription
BadRequest400Invalid request parameters (e.g., empty member_id, incorrect date format, time range exceeded, invalid groupBy)
Unauthorized401API key missing or invalid
Forbidden403No permission to access this organization
NotFound404Member not found
InternalError500Internal server error
Error response shape: see Error responses in Conventions.