/api/orgs/{org_id}/spend/latest最新の完了済みレポートを読み取る
固定されていないクエリについて、処理を開始せずに完了済みの結果を読み取ります。{build, report}を返し、comparison指定時は準備済みの分析エンベロープを返します。準備済みのものがない場合はnullです(リクエストエラーは「結果なし」を意味しません)。APIキーにはプロビジョニング権限とscope: orgが必要です。
認証: AuthorizationヘッダーにBearer形式のAPIキー
パスパラメーター
org_idstring必須お客様の組織ID(uuid)。
GET /api/whoamiで取得できます。
リクエストボディ
queryany必須固定なし:
as_ofもsnapshot_idもありません。query
startstring必須開始(含む)、UTCオフセット付き。
endstring必須終了(含まない)、UTCオフセット付き。
startより後である必要があります。time_zonestring日単位と月単位のバケットに使うIANAタイムゾーン。
scopeanybasisanygroup_byanytag_keystring | nullgroup_byがtagの場合にのみ必須です。grainanyfiltersarray<object>ディメンションごとにフィルターは最大1つです。
filters
dimensionenum必須グループ化とフィルターのディメンション。
keyとmemberの値はuuidです。tagはgroup_by専用(tag_keyと併用)で、タグでフィルターするにはtagsを使用します。valuesarray<string>missingbooleanこのディメンションに値がない呼び出しも一致させます。
excludeboolean条件を反転します。JSONのブール値である必要があります。
tagsarray<object>タグキーごとに条件は最大1つです。
tags
keystring必須valuesarray<string>missingbooleanこのタグキーがない呼び出しも一致させます。
excludeboolean
sortanydirectionenumoffsetintegerlimitintegeras_ofstring | nullレポートの締め時刻。最初の読み取り時にサーバーが設定します。未来の時刻や
startより前にはなりません。snapshot_idstring登録済みのスナップショットトークン。元の
as_ofが必要です。未設定の場合はレスポンスから省略されます。
comparisonenum前期間との比較を含む、準備済みの分析エンベロープを返します。
レスポンス
200最新の完了済み結果、またはnull。
400無効な支出クエリです(不正なフィルター値、未来の
as_of、キーからの個人用scope: self、または必要なスナップショットの欠落)。レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
401APIキーがない、不明、または失効しています。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
403キーがプロビジョニングキーではない(推論キーは読み取りを含むすべての支出エンドポイントで拒否されます)か、顧客プランキーです。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
404組織がキー自身の組織ではありません(常に404で、403にはなりません)。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
409スナップショット(
as_of+snapshot_id)の有効期限が切れた(24時間)か、無効化されました。更新して、すべての射影をまとめて置き換えてください。レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
422ボディがスキーマ検証に失敗した(
{detail:[...]})、またはレポートが処理上限を超えました(report_too_large、series_too_large、export_too_large)。503レポート機能が利用できない、初期化中、または上限付きの読み取りがタイムアウトしました。データが空という意味ではありません。再試行するか範囲を狭めてください。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
リクエスト
curl -X POST 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/spend/latest' \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"query": {
"start": "2026-11-01T00:00:00Z",
"end": "2026-11-08T00:00:00Z",
"time_zone": "UTC",
"scope": "org",
"basis": "requests",
"group_by": "model",
"grain": "day",
"filters": [],
"tags": [],
"sort": "spend",
"direction": "desc",
"offset": 0,
"limit": 50
}
}'レスポンス
{
"build": {
"id": "8d2f1c6a-3e4b-4a7d-b9e0-5c1f2a7d8e30",
"status": "completed",
"query": {
"start": "2026-11-01T00:00:00Z",
"end": "2026-11-08T00:00:00Z",
"time_zone": "UTC",
"scope": "org",
"basis": "requests",
"group_by": "model",
"grain": "day",
"filters": [],
"tags": [],
"sort": "spend",
"direction": "desc",
"offset": 0,
"limit": 50,
"tag_key": null,
"as_of": "2026-11-19T14:02:11.418Z",
"snapshot_id": "c1e7a4d2-5b3f-4e8a-9d61-2f0b7c3a9e45"
},
"created_at": "2026-11-19T14:02:11.420Z",
"updated_at": "2026-11-19T14:02:12.031Z",
"expires_at": "2026-11-20T14:02:11.420Z",
"progress": {
"processed_facts": 18420,
"processed_sources": 1,
"phase": "publish"
},
"error_code": null
},
"report": {
"query": {
"start": "2026-11-01T00:00:00Z",
"end": "2026-11-08T00:00:00Z",
"time_zone": "UTC",
"scope": "org",
"basis": "requests",
"group_by": "model",
"grain": "day",
"filters": [],
"tags": [],
"sort": "spend",
"direction": "desc",
"offset": 0,
"limit": 50,
"tag_key": null,
"as_of": "2026-11-19T14:02:11.418Z",
"snapshot_id": "c1e7a4d2-5b3f-4e8a-9d61-2f0b7c3a9e45"
},
"totals": {
"count": 18420,
"rejected_count": 37,
"errors": 212,
"input_tokens": 96214000,
"output_tokens": 8120400,
"cached_input_tokens": 51200000,
"reasoning_tokens": 1840000,
"paid_nano_usd": "41382500000",
"byok_nano_usd": "6120000000",
"free_nano_usd": "850000000",
"unknown_usage_count": 0
},
"buckets": [
{
"start": "2026-11-01T00:00:00Z",
"figures": {
"count": 2610,
"rejected_count": 5,
"errors": 30,
"input_tokens": 13700000,
"output_tokens": 1160000,
"cached_input_tokens": 7300000,
"reasoning_tokens": 262000,
"paid_nano_usd": "5921000000",
"byok_nano_usd": "870000000",
"free_nano_usd": "120000000",
"unknown_usage_count": 0
}
}
],
"groups": [
{
"value": "gpt-6-luna",
"label": "gpt-6-luna",
"figures": {
"count": 11030,
"rejected_count": 20,
"errors": 101,
"input_tokens": 61200000,
"output_tokens": 5102000,
"cached_input_tokens": 38100000,
"reasoning_tokens": 1840000,
"paid_nano_usd": "29880000000",
"byok_nano_usd": "0",
"free_nano_usd": "0",
"unknown_usage_count": 0
}
},
{
"value": "claude-fable-5.1",
"label": "claude-fable-5.1",
"figures": {
"count": 7390,
"rejected_count": 17,
"errors": 111,
"input_tokens": 35014000,
"output_tokens": 3018400,
"cached_input_tokens": 13100000,
"reasoning_tokens": 0,
"paid_nano_usd": "11502500000",
"byok_nano_usd": "6120000000",
"free_nano_usd": "850000000",
"unknown_usage_count": 0
}
}
],
"filter_labels": [],
"group_count": 2,
"next_offset": null,
"coverage": {
"as_of": "2026-11-19T14:02:11.418Z",
"projected_through": "2026-11-08T00:00:00Z",
"complete": true,
"pending_requests": 0,
"includes_pre_admission_rejections": false
}
}
}https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/spend/latest