/api/orgs/{org_id}/spend/exportExport Spend as CSV
Body is a SpendQuery directly. One complete grouped aggregation (at most 10,000 groups and 16 MiB), returned as text/csv, not JSON. Spend columns are dollars; only paid_usd is charged credits. API keys need provisioning strength and scope: org.
認証: AuthorizationヘッダーにBearer形式のAPIキー
パスパラメータ
org_idstring必須Your organization id (uuid).
GET /api/whoamireturns it.
リクエストボディ
startstring必須Inclusive start, with a UTC offset.
endstring必須Exclusive end, with a UTC offset. Must be after
start.time_zonestringIANA zone for day and month buckets.
scopeanybasisanygroup_byanytag_keystring | nullRequired exactly when
group_byistag.grainanyfiltersarray<object>At most one filter per dimension.
filters
dimensionenum必須Grouping and filter dimension.
keyandmembervalues are uuids.tagis only agroup_by(withtag_key); filter tags throughtags.valuesarray<string>missingbooleanAlso match calls with no value for this dimension.
excludebooleanInvert the predicate. Must be a JSON boolean.
tagsarray<object>At most one predicate per tag key.
tags
keystring必須valuesarray<string>missingbooleanAlso match calls without this tag key.
excludeboolean
sortanydirectionenumoffsetintegerlimitintegeras_ofstring | nullReport cutoff. Server-set on the first read; not in the future and not before
start.snapshot_idstringRegistered snapshot token. Requires its original
as_of. Omitted from responses when unset.
レスポンス
200Complete grouped CSV (not request-level rows): exact dollar columns with 9 decimals, the accepted query, cutoff and measure definitions. Served as an attachment
spend.csv,Cache-Control: private, no-store.400Invalid Spend query (bad filter value, a future
as_of, a personalscope: selffrom a key, or a missing snapshot where one is required).レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
401Missing, unknown or revoked API key.
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
403The key is not a provisioning key (inference keys are refused on every Spend route, reads included), or it is a customer-plan key.
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
404The org is not the key's own organization (always 404, never 403).
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
409The snapshot (
as_of+snapshot_id) expired (24 hours) or was invalidated. Refresh and replace every projection together.レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
422Body failed schema validation, or the export exceeds 10,000 groups or 16 MiB.
503Reporting is unavailable, initializing, or the bounded read timed out. Not empty data; retry or narrow the range.
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
リクエスト
curl -X POST https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/spend/export \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"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
}'レスポンス
"group","label","basis","count","rejected_count","errors","input_tokens","output_tokens","cached_input_tokens","reasoning_tokens","spend_usd","paid_usd","byok_estimated_usd","free_list_value_usd","unknown_usage_count","from","to_exclusive","time_zone","as_of","query","row_kind","group_by","tag_key","projected_through","count_definition","errors_definition","rejected_count_definition","prompt_group_definition","spend_definition"
"gpt-6-luna","gpt-6-luna","requests","11030","20","101","61200000","5102000","38100000","1840000","29.880000000","29.880000000","0.000000000","0.000000000","0","2026-11-01T00:00:00+00:00","2026-11-08T00:00:00+00:00","UTC","2026-11-19T14:02:11.418000+00:00","{...}","aggregate_group","model","","2026-11-08T00:00:00+00:00","Settled customer requests; not a successful-completion count","Non-completed requests: status != completed; rejections are included","Subset with zero attempts and status failed or expired_before_dispatch; cancellations are not rejections","SHA-256 of system/developer content and tool declarations; not full payload, request or session; label shows 12 characters","paid_usd + byok_estimated_usd + free_list_value_usd; only paid_usd is charged credits; excludes pending holds"
https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/spend/export