Skip to content

API Ryoma: quotas ​

Converted-cost quotas and threshold breaches

This page is generated from openapi.yaml by npm run gen, so do not edit it by hand. Authentication is described on the overview page.

GET/v1/me/quotas

Quotas that apply to me and usage in the current cycle

Responses ​

CodeDescriptionType
200One quota per cycle (my own, or the default)application/json · object
401Missing or invalid tokenapplication/problem+json · object

Example response ​

json
{
  "items": [
    {
      "id": "string",
      "scope": "user",
      "subject": "string",
      "cycle": "week",
      "limitUsd": 0,
      "thresholds": [],
      "from": "2026-11-01T00:00:00Z",
      "to": "2026-11-01T00:00:00Z",
      "usedUsd": 0,
      "percent": 0
    }
  ]
}

Call with curl ​

bash
curl "https://ryoma.phillipcli.cloud/v1/me/quotas" \
  -H "Authorization: Bearer $TARA_TOKEN"
GET/v1/quotasAdmin

Quotas (org owner and admin: all quotas of the organization; other roles: project-scope quotas)

Responses ​

CodeDescriptionType
200List of quotasapplication/json · object
401Missing or invalid tokenapplication/problem+json · object
403Forbiddenapplication/problem+json · object

Example response ​

json
{
  "items": [
    {
      "id": "string",
      "scope": "user",
      "subject": "string",
      "cycle": "week",
      "limitUsd": 0,
      "thresholds": []
    }
  ]
}

Call with curl ​

bash
curl "https://ryoma.phillipcli.cloud/v1/quotas" \
  -H "Authorization: Bearer $TARA_TOKEN"
PUT/v1/quotasAdmin

Create or replace the quota with the same scope, subject and cycle (org owner and admin)

Body (application/json) ​

FieldTypeRequiredDescription
scopeuser | projectyes
subjectstringyesTara login, '*' (default for everyone without their own quota) or project key
cycleweek | monthyes
limitUsdnumber (double)yesConverted-cost quota (USD)
thresholdsinteger[]Alert thresholds (%), default [80, 100]

Responses ​

CodeDescriptionType
200Quota savedapplication/json · object
400Invalid parametersapplication/problem+json · object
401Missing or invalid tokenapplication/problem+json · object
403Forbiddenapplication/problem+json · object

Example response ​

json
{
  "id": "string",
  "scope": "user",
  "subject": "string",
  "cycle": "week",
  "limitUsd": 0,
  "thresholds": [
    0
  ]
}

Call with curl ​

bash
curl -X PUT "https://ryoma.phillipcli.cloud/v1/quotas" \
  -H "Authorization: Bearer $TARA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"scope":"user","subject":"string","cycle":"week","limitUsd":0}'
DELETE/v1/quotas/{id}Admin

Delete a quota (org owner and admin); breach history is kept

Parameters ​

NameInTypeRequiredDescription
idpathstringyes

Responses ​

CodeDescriptionType
204Deleted
401Missing or invalid tokenapplication/problem+json · object
403Forbiddenapplication/problem+json · object
404Not found. Also returned for a project that exists but is private and the caller cannot see (never 403, so a private project cannot be discovered)application/problem+json · object

Call with curl ​

bash
curl -X DELETE "https://ryoma.phillipcli.cloud/v1/quotas/<id>" \
  -H "Authorization: Bearer $TARA_TOKEN"
GET/v1/quota-breachesAdmin

Threshold breaches in a time range (org owner and admin; other roles only see project quotas)

Parameters ​

NameInTypeRequiredDescription
fromquerystring (date-time)yes
toquerystring (date-time)yes

Responses ​

CodeDescriptionType
200Newest firstapplication/json · object
400Invalid parametersapplication/problem+json · object
401Missing or invalid tokenapplication/problem+json · object
403Forbiddenapplication/problem+json · object

Example response ​

json
{
  "items": [
    {
      "quotaId": "string",
      "scope": "user",
      "subject": "string",
      "cycle": "week",
      "periodStart": "2026-11-01T00:00:00Z",
      "threshold": 0,
      "usedUsd": 0,
      "limitUsd": 0,
      "at": "2026-11-01T00:00:00Z"
    }
  ]
}

Call with curl ​

bash
curl "https://ryoma.phillipcli.cloud/v1/quota-breaches?from=2026-11-01T00:00:00Z&to=2026-11-01T00:00:00Z" \
  -H "Authorization: Bearer $TARA_TOKEN"