Reporting Access Key
Reporting Access Key is a dashboard-managed key for read-only usage reconciliation. It lets an internal reporting service, finance workflow, or BI pipeline query API key metadata, token usage, task history, and cost data without exposing normal model API keys.
1. When to use it
Use a Reporting Access Key when you need to:
- Reconcile invoice totals with task-level usage records
- Export usage data to internal BI, FinOps, or monitoring systems
- Track token consumption and cost by API key, model, task type, status, or day
- Investigate individual task records without sharing operational dashboard access
It is not a model invocation key. It only authorizes the /api/open/v1/* reporting endpoints documented below.
2. Create and manage the key
Open the dashboard and go to:
/dashboard/apikeysIn the Reporting Access Key card:
- Click Generate to create the key.
- Copy the key and store it in a secure secret manager.
- Use Copy when you need to retrieve the full value again.
- Use Revoke to disable the current key.
Security behavior:
- The page shows only a masked key by default.
- The full key is fetched only when you click Copy.
- The full key should not be stored in localStorage, analytics, screenshots, tickets, or client logs.
- Each user currently has at most one active Reporting Access Key.
- Revoked keys stop working immediately and are not hard-deleted.
3. Authentication
Send the Reporting Access Key in the Authorization header:
Authorization: Bearer <REPORTING_ACCESS_KEY>
Accept: application/jsonAll responses use the platform envelope:
{
"code": 200,
"msg": "",
"data": {}
}4. Endpoints
| Endpoint | Purpose | Max date range |
|---|---|---|
GET /api/open/v1/apikeys | List visible API keys and their last usage time | Not applicable |
GET /api/open/v1/usage/summary | Aggregate requests, tokens, credits, and USD amount | 31 days |
GET /api/open/v1/usage/daily | Daily usage breakdown, optionally grouped by API key and model | 31 days |
GET /api/open/v1/usage/tasks | Paginated task-level usage records | 7 days |
GET /api/open/v1/usage/tasks/{task_id} | Single task detail | Not applicable |
Base URL:
https://reachapi.ai/api/open/v1For local development, use your local application host:
http://localhost:3000/api/open/v15. List API keys
curl -sS "https://reachapi.ai/api/open/v1/apikeys?page=1&page_size=20&status=active" \
-H "Authorization: Bearer <REPORTING_ACCESS_KEY>"Query parameters:
| Field | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number. Default: 1 |
page_size | integer | No | Page size. Default: 50, maximum: 200 |
status | string | No | Filter API keys by status, for example active |
Example response:
{
"code": 200,
"msg": "",
"data": {
"total": 3,
"page": 1,
"page_size": 20,
"items": [
{
"apikey_id": "ak_123",
"apikey_name": "Production gateway",
"status": "active",
"created_at": "2026-06-27T08:00:00.000Z",
"last_used_at": "2026-06-27T09:15:00.000Z",
"hourly_limit_usd": "5.00000000",
"daily_limit_usd": "20.00000000",
"total_limit_usd": "100.00000000",
"quota_timezone": "Asia/Shanghai"
}
]
}
}Each item includes:
| Field | Description |
|---|---|
apikey_id | API key ID |
apikey_name | API key name |
status | API key status (active / deleted) |
created_at | Creation timestamp |
last_used_at | Last usage timestamp (null if never used) |
hourly_limit_usd | Hourly spend limit in USD, null if not configured |
daily_limit_usd | Daily spend limit in USD, null if not configured |
total_limit_usd | Lifetime spend limit in USD, null if not configured |
quota_timezone | Timezone used for quota windows (default Asia/Shanghai) |
6. Usage summary
curl -sS "https://reachapi.ai/api/open/v1/usage/summary?start_date=2026-06-01&end_date=2026-06-07&timezone=Asia/Shanghai" \
-H "Authorization: Bearer <REPORTING_ACCESS_KEY>"Query parameters:
| Field | Type | Required | Description |
|---|---|---|---|
start_date | string | Yes | Date in YYYY-MM-DD format |
end_date | string | Yes | Date in YYYY-MM-DD format. Maximum 31-day range |
timezone | string | No | IANA timezone. Default: UTC |
apikey_id | string | No | Filter by one visible API key |
model | string | No | Filter by model ID |
task_type | string | No | Filter by task type |
status | string | No | Filter by task status |
finance_status | string | No | Filter by billing status |
provider_job_id | string | No | Filter by upstream provider job ID |
The response includes request counts, success/error counts, token buckets, actual_credits, and total_amount in USD string format.
7. Daily breakdown
curl -sS "https://reachapi.ai/api/open/v1/usage/daily?start_date=2026-06-01&end_date=2026-06-07&group_by=apikey,model" \
-H "Authorization: Bearer <REPORTING_ACCESS_KEY>"group_by supports:
| Value | Description |
|---|---|
none | One row per day |
apikey | Group by day and API key |
model | Group by day and model |
apikey,model | Group by day, API key, and model |
8. Task list
curl -sS "https://reachapi.ai/api/open/v1/usage/tasks?start_date=2026-06-01&end_date=2026-06-07&page=1&page_size=50" \
-H "Authorization: Bearer <REPORTING_ACCESS_KEY>"The task list supports the same filters as usage/summary. The date range is limited to 7 days to keep reconciliation queries predictable.
Each item includes:
| Field | Description |
|---|---|
task_id | Internal task ID |
created_at, completed_at | Task timestamps |
model, task_type | Model and workload type |
apikey_id, apikey_name | API key attribution |
provider_job_id | Upstream provider job ID when available |
status, finance_status | Execution and billing state |
| token fields | Input, output, cache, reasoning, image, audio, and video token usage |
total_amount, actual_credits | USD amount string and internal credit amount |
9. Task detail
curl -sS "https://reachapi.ai/api/open/v1/usage/tasks/task_123" \
-H "Authorization: Bearer <REPORTING_ACCESS_KEY>"The detail endpoint returns one task with amount, token, and error information. It is useful when reconciling a single customer ticket, provider job, or billing row.
10. Errors
| HTTP status | msg example | Scenario |
|---|---|---|
401 | Unauthorized | Missing, malformed, invalid, or revoked Reporting Access Key |
400 | Invalid pagination | page or page_size is not a positive integer |
400 | Invalid start_date / Invalid end_date | Date format is not YYYY-MM-DD |
400 | Date range is too large | Date range exceeds the endpoint limit |
400 | Invalid group_by | Unsupported daily grouping value |
403 | Forbidden | The requested apikey_id is not visible to this Reporting Access Key |
404 | Task not found | Task does not exist or is not visible |
11. Access log behavior
Customer calls made with a Reporting Access Key are written to a dedicated access-key usage log on the server.
The log is designed for operational review and does not store secrets. It records only redacted request metadata such as event name, request ID, key prefix, user ID, method, path, safe query parameters, status code, duration, IP, user agent, and error code.
It does not record full access keys, Authorization headers, cookies, passwords, key hashes, ciphertext, or database connection strings.