Public API

查询项目用量

Management key required. 查询项目请求数和已结算美元费用,包含已归档项目。

GET
/public/v1/projects/{project_id}/usage

Management key required. Use a Management API Key (mgmt-...) for your Team, created by a Team Owner. Requests use the Team associated with that key.

Includes all members and API key sources in this project, using the same rollups as Console analytics. See ResourceUsage for accounting semantics. Unknown or repeated query parameters are rejected.

Authorization

ManagementKeyBearer
AuthorizationBearer <token>

Management key required. Send Authorization: Bearer mgmt-....

In: header

Path Parameters

project_id*string
Formatuuid

Query Parameters

from*string

Inclusive RFC 3339 start after the Unix epoch, aligned to a UTC hour boundary. Maximum window is 31 days.

Formatdate-time
to*string

Exclusive RFC 3339 end, aligned to a UTC hour boundary and strictly after from.

Formatdate-time

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/public/v1/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage?from=2026-11-01T00%3A00%3A00Z&to=2026-11-02T00%3A00%3A00Z"
{  "object": "project_usage",  "project_id": "019a6eab-7c00-7000-8000-000000000123",  "from": "2026-11-01T00:00:00Z",  "to": "2026-11-02T00:00:00Z",  "requests": 12,  "successes": 10,  "failures": 2,  "amount": {    "value": "1.230000",    "currency": "usd"  },  "request_id": "req_example"}

Last updated on