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.
このドキュメントについて
Credits の利用イベントとサマリーをメンバーまたは組織単位で取得します。事前に API キーの取得 を完了し、共通仕様 を参照してください。
前提条件
API 一覧
1. 使用量イベント一覧
GET /v1/organizations/{organization_id}/members/{member_id}/usage-events
指定メンバーの集計済み Credits 使用量レコードをページネーションで取得します。
パスパラメータ
| パラメータ | 型 | 必須 | 説明 |
|---|
organization_id | string | はい | 組織 ID |
member_id | string | はい | メンバー ID |
クエリパラメータ
| パラメータ | 型 | 必須 | 説明 |
|---|
startDate | string | いいえ | 開始時間;RFC 3339 形式または Unix ミリ秒タイムスタンプ |
endDate | string | いいえ | 終了時間;RFC 3339 形式または Unix ミリ秒タイムスタンプ |
sources | string | いいえ | ソースでフィルタ、カンマ区切り。値:IDE、CLI、JetBrains Plugin、Web、QoderWork |
operations | string | いいえ | 操作でフィルタ、カンマ区切り。値:Inline Chat、Ask、Agent、Repo Wiki、Quest、Plan Mode、Code Review、Optimize Input、Voice Input、Experts、Image |
modelTiers | string | いいえ | モデルティアでフィルタ、カンマ区切り。値: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 | いいえ | ページサイズ(デフォルト 20、最大 100) |
nextCredits | string | いいえ | ページネーションカーソル |
成功レスポンス(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_abc123",
"source": "CLI",
"operation": "Completion",
"credits": 0.02,
"cost": 0.02
}
],
"maxResults": 20,
"nextCredits": "eyJwYWdlIjogMn0="
}
一部のレコードでは userEmail や modelTier が返されない場合があります。インテグレーション時はオプションフィールドとして処理してください。
使用量レコードなし / 最終ページ:
{
"usages": [],
"maxResults": 20
}
nextCredits が空または存在しない場合は最終ページです。
レスポンスフィールド
| フィールド | 型 | 説明 |
|---|
usages | array | 使用量レコードリスト |
usages[].timestamp | int64 | 開始時間(Unix ミリ秒タイムスタンプ) |
usages[].userId | string | ユーザー ID |
usages[].userEmail | string | ユーザーメール(空の場合あり) |
usages[].source | string | ソース:IDE、CLI、JetBrains Plugin、Web、QoderWork |
usages[].operation | string | 操作:Inline Chat、Ask、Agent、Repo Wiki、Quest、Plan Mode、Code Review、Optimize Input、Voice Input、Experts、Image |
usages[].modelTier | string | モデルティア(空の場合あり):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(小数点以下2桁) |
usages[].cost | float64 | 課金換算後のコスト(小数点以下2桁);通常 credits と同額または固定換算比率 |
maxResults | int32 | このリクエストのページサイズ |
nextCredits | string | 次ページカーソル;空は最終ページ |
2. 使用量サマリー取得
GET /v1/organizations/{organization_id}/members/{member_id}/usage-summary
指定された期間内のメンバーの Credits 消費を指定ディメンションで集計します。期間は 7 日以内でなければなりません。
パスパラメータ
| パラメータ | 型 | 必須 | 説明 |
|---|
organization_id | string | はい | 組織 ID |
member_id | string | はい | メンバー ID |
クエリパラメータ
| パラメータ | 型 | 必須 | 説明 |
|---|
startDate | string | はい | 開始時間;RFC 3339 形式または Unix ミリ秒タイムスタンプ |
endDate | string | はい | 終了時間;RFC 3339 形式または Unix ミリ秒タイムスタンプ |
groupBy | string | はい | グループ化ディメンション:source(ソース別)または operation(操作別) |
成功レスポンス(200 OK)
ソース別集計(**groupBy=source**):
{
"summary": {
"IDE": 12.50,
"CLI": 3.25
}
}
操作別集計(**groupBy=operation**):
{
"summary": {
"Agent": 8.40,
"Completion": 5.10,
"Inline Chat": 2.25
}
}
使用量データなし:
レスポンスフィールド
| フィールド | 型 | 説明 |
|---|
summary | object | 集計結果;キーはグループ名(ソースまたは操作)、値は合計 Credits |
summary.{key} | float64 | そのグループの合計 Credits 消費(小数点以下2桁) |
エラーレスポンス
必須パラメータ欠落(400)
{
"requestId": "req_abc123",
"code": "BadRequest",
"message": "startDate is required"
}
期間超過(400)
{
"requestId": "req_abc123",
"code": "BadRequest",
"message": "date range must not exceed 7 days"
}
無効な groupBy(400)
{
"requestId": "req_abc123",
"code": "BadRequest",
"message": "groupBy is required and must be 'source' or 'operation'"
}
3. 組織使用量イベント一覧
GET /v1/organizations/{organization_id}/usage-events
指定組織の全メンバーの集計済みトークン使用量レコードをページネーションで取得します。レスポンス構造はメンバー使用量イベント API と同一です。
パスパラメータ
| パラメータ | 型 | 必須 | 説明 |
|---|
organization_id | string | はい | 組織 ID |
クエリパラメータ
| パラメータ | 型 | 必須 | 説明 |
|---|
startDate | string | いいえ | 開始時間;RFC 3339 形式または Unix ミリ秒タイムスタンプ |
endDate | string | いいえ | 終了時間;RFC 3339 形式または Unix ミリ秒タイムスタンプ |
sources | string | いいえ | ソースでフィルタ、カンマ区切り。値:IDE、CLI、JetBrains Plugin、Web、QoderWork |
operations | string | いいえ | 操作でフィルタ、カンマ区切り。値:Inline Chat、Ask、Agent、Repo Wiki、Quest、Plan Mode、Code Review、Optimize Input、Voice Input、Experts |
modelTiers | string | いいえ | モデルティアでフィルタ、カンマ区切り。値: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 | いいえ | ページサイズ(デフォルト 20、最大 100) |
nextToken | string | いいえ | ページネーションカーソル |
成功レスポンス(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="
}
一部のレコードでは userEmail や modelTier が返されない場合があります。デフォルトではメンバー使用量イベント API と同じ動作をし、正の Credits レコードのみをフィルタしません。返金や修正などの負の値のレコードも返される場合があります。
レスポンスフィールド
レスポンスフィールドの定義は「1. 使用量イベント一覧」と同一です。
使用例
メンバー使用量イベント一覧
curl -X GET "https://api.qoder.com/v1/organizations/org_xxx/members/member_abc123/usage-events?maxResults=20" \
-H "Authorization: Bearer <api_key>"
日付範囲でフィルタ
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>"
組織使用量イベント一覧
curl -X GET "https://api.qoder.com/v1/organizations/org_xxx/usage-events?maxResults=20" \
-H "Authorization: Bearer <api_key>"
ソースと操作でフィルタ
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>"
ソース別使用量サマリー
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>"
操作別使用量サマリー
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>"
エラーコード
| エラーコード | HTTP ステータス | 説明 |
|---|
BadRequest | 400 | リクエストパラメータが無効(例:member_id が空、日付形式が不正、期間超過、groupBy が無効) |
Unauthorized | 401 | API キーが欠落または無効 |
Forbidden | 403 | この組織へのアクセス権限なし |
NotFound | 404 | メンバーが見つからない |
InternalError | 500 | サーバー内部エラー |
エラーレスポンスの形式は 共通仕様 の エラーレスポンス を参照してください。