/api/v1/usage/exportsQueue a bulk usage export for one key
Queues a gzip JSONL file of every settled request made with one key in a half-open UTC range of at most 30 days, within the past 30 days. Answers 202 with Location and Retry-After: 5; poll the job until completed. Idempotency-Key replays the same job; reusing it for a different body is 409. One export may be active per organization at a time (429).
Authentication: Bearer API key in the Authorization header
Headers
Idempotency-Keystring1 to 128 characters. Repeating a create with the same key returns the same job.
Request body
api_key_idstringrequiredThe key whose requests to export.
start_atstringrequiredInclusive start, with timezone.
end_atstringrequiredExclusive end, with timezone; at most 30 days after start_at.
formatenum
Responses
202The export job, queued (or the existing job for a repeated Idempotency-Key).
Response
idstringstatusenumapi_key_idstringstart_atstringend_atstringcreated_atstringformatenumcompressionenumschema_versionenumsnapshot_atstring | nullrow_countinteger | nullbyte_sizeinteger | nullCompressed file size, bytes.
sha256string | nullHex SHA-256 of the file.
expires_atstring | nullerror_codestring | null
401Missing, unknown or revoked API key.
Response
errorstringrequiredHuman-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 key is not one of your organization's keys.
Response
errorstringrequiredHuman-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 Idempotency-Key was used for a different export.
Response
errorstringrequiredHuman-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).
422Range reversed, empty, longer than 30 days, outside the past 30 days, or an unknown field.
Response
errorstringrequiredHuman-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).
429Another export is already active for this organization; wait for it to finish.
Response
errorstringrequiredHuman-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).
503Usage exports are unavailable on this deployment.
Response
errorstringrequiredHuman-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).
Request
curl -X POST https://api.experientiallabs.ai/api/v1/usage/exports \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"api_key_id": "0b9d4f6e-2a1c-4e8b-9f37-5c6d2e1a8b40",
"start_at": "2026-10-20T00:00:00Z",
"end_at": "2026-11-19T00:00:00Z",
"format": "jsonl"
}'Response
{
"id": "6e2b9c14-7d3a-4f01-8b5e-2c9a1d7f4e63",
"status": "queued",
"api_key_id": "0b9d4f6e-2a1c-4e8b-9f37-5c6d2e1a8b40",
"start_at": "2026-10-20T00:00:00Z",
"end_at": "2026-11-19T00:00:00Z",
"created_at": "2026-11-19T16:02:44.118Z",
"format": "jsonl",
"compression": "gzip",
"schema_version": 1,
"snapshot_at": null,
"row_count": null,
"byte_size": null,
"sha256": null,
"expires_at": null,
"error_code": null
}https://api.experientiallabs.ai/api/v1/usage/exports