Assistant

Preview — pending review

This reference is generated from the platform API contract and is still under review. Operations, fields, and descriptions can change before publication.

The project's console AI assistant token usage and availability

GET
/scopes/{scopeId}/assistant/usage

Tokens this PROJECT spent on the console assistant in the current calendar month (UTC), their cost at the published list price (an estimate: the invoice line is rated by billing), whether the assistant can be used right now and, if not, why. Carries only the assistant's own figures for this project. Validation: READ on compute -> 403 (compute:read for tokens); unreachable scope -> 404. Feature flag: 404 while the assistant service is disabled. Async & state: Synchronous read; no state change. Errors: 401; 403; 404; 500. Idempotency/Concurrency: Safe; no idempotency key.

Authorization

bearerToken
headerAuthorizationBearer <token>

An API token (pc_live_…) or a service-account key (sak_live_…), created in Identity & Access Management and sent as Authorization: Bearer <token>. Requests are rate limited per credential and per tenant: every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and a refused request gets 429 RATE_LIMITED with Retry-After.

Path Parameters

scopeId*string

Opaque ownership+authorization scope resolving to tenant + subscription + project.

Response Body

Usage of the current period and availability.

application/json
  1. response

The project's assistant token usage this calendar month (UTC) and availability.

periodStart*string
Formatdate-time
periodEnd*string
Formatdate-time
inputTokens*integer
Range0 <= value
outputTokens*integer
Range0 <= value
amount*|

Cost at the published list price; null while no price is published.

available*boolean
unavailableReason*|null
dailyTokenCap*integer

Tokens the subscription may spend per UTC day.

curl -X GET "https://example.com/scopes/string/assistant/usage"
{  "periodStart": "2019-08-24T14:15:22Z",  "periodEnd": "2019-08-24T14:15:22Z",  "inputTokens": 0,  "outputTokens": 0,  "amount": {    "amount": 0,    "currency": "USD"  },  "available": true,  "unavailableReason": "ASSISTANT_UNAVAILABLE",  "dailyTokenCap": 0}