phi.quota.get
python
phi.quota.get()Returns Quota.
Quota fields and schemaShowHide
Fields
| Name | Type | Default | Description |
|---|---|---|---|
| creditsoptional | object or null | null | |
| credits_availablerequired | integer | ||
| credits_consumedrequired | integer | ||
| credits_limitrequired | integer | ||
| credits_reservedrequired | integer | ||
| organization_idrequired | string | ||
| period_endrequired | string | format: date-time | |
| period_startrequired | string | format: date-time | |
| planoptional | string or null | null | |
| plan_sourceoptional | string or null | null | |
| purchased_balanceoptional | integer | 0 | |
| total_availableoptional | integer or null | null |
JSON schema
{
"type": "object",
"required": [
"organization_id",
"credits_limit",
"credits_reserved",
"credits_consumed",
"credits_available",
"period_start",
"period_end"
],
"properties": {
"credits": {
"default": null,
"anyOf": [
{
"$ref": "#/$defs/Credits"
},
{
"type": "null"
}
]
},
"credits_available": {
"type": "integer"
},
"credits_consumed": {
"type": "integer"
},
"credits_limit": {
"type": "integer"
},
"credits_reserved": {
"type": "integer"
},
"organization_id": {
"type": "string"
},
"period_end": {
"type": "string",
"format": "date-time"
},
"period_start": {
"type": "string",
"format": "date-time"
},
"plan": {
"default": null,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"plan_source": {
"default": null,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"purchased_balance": {
"type": "integer",
"default": 0
},
"total_available": {
"default": null,
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
}
},
"$defs": {
"AutoReloadSummary": {
"type": "object",
"required": [
"enabled",
"threshold_credits",
"amount_cents"
],
"properties": {
"amount_cents": {
"type": "integer"
},
"enabled": {
"type": "boolean"
},
"threshold_credits": {
"type": "integer"
}
}
},
"Credits": {
"type": "object",
"required": [
"allowance",
"allowance_available",
"purchased",
"total_available",
"auto_reload"
],
"properties": {
"allowance": {
"type": "integer"
},
"allowance_available": {
"type": "integer"
},
"auto_reload": {
"$ref": "#/$defs/AutoReloadSummary"
},
"purchased": {
"type": "integer"
},
"reset_at": {
"default": null,
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
]
},
"total_available": {
"type": "integer"
}
}
}
}
}phi.quota.history
python
phi.quota.history()Returns CursorList[LedgerEntry].
Parameters
| Name | Type | Default |
|---|---|---|
| pageoptional | int | 1 |
| page_sizeoptional | int | 50 |
| cursoroptional | str | None | None |
| reasonoptional | list[str] | None | None |
LedgerEntry fields and schemaShowHide
Fields
| Name | Type | Default | Description |
|---|---|---|---|
| amountrequired | integer | ||
| balance_afterrequired | integer | ||
| created_atrequired | string | format: date-time | |
| idrequired | string | ||
| noteoptional | string or null | null | |
| pipeline_typeoptional | string or null | null | |
| pooloptional | string or null | null | |
| reasonrequired | string | ||
| run_idoptional | string or null | null | |
| run_nameoptional | string or null | null |
JSON schema
{
"type": "object",
"required": [
"id",
"amount",
"balance_after",
"reason",
"created_at"
],
"properties": {
"amount": {
"type": "integer"
},
"balance_after": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string"
},
"note": {
"default": null,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"pipeline_type": {
"default": null,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"pool": {
"default": null,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"reason": {
"type": "string"
},
"run_id": {
"default": null,
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
]
},
"run_name": {
"default": null,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
}phi.quota.iter
python
phi.quota.iter()Returns Iterator[LedgerEntry].
Parameters
| Name | Type | Default |
|---|---|---|
| page_sizeoptional | int | 50 |
LedgerEntry fields and schemaShowHide
Fields
| Name | Type | Default | Description |
|---|---|---|---|
| amountrequired | integer | ||
| balance_afterrequired | integer | ||
| created_atrequired | string | format: date-time | |
| idrequired | string | ||
| noteoptional | string or null | null | |
| pipeline_typeoptional | string or null | null | |
| pooloptional | string or null | null | |
| reasonrequired | string | ||
| run_idoptional | string or null | null | |
| run_nameoptional | string or null | null |
JSON schema
{
"type": "object",
"required": [
"id",
"amount",
"balance_after",
"reason",
"created_at"
],
"properties": {
"amount": {
"type": "integer"
},
"balance_after": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string"
},
"note": {
"default": null,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"pipeline_type": {
"default": null,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"pool": {
"default": null,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"reason": {
"type": "string"
},
"run_id": {
"default": null,
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
]
},
"run_name": {
"default": null,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
}phi.quota.months
The ledger by calendar month: what finished runs used, what was added, how many runs finished.
python
phi.quota.months()Returns list[Month].
Parameters
| Name | Type | Default |
|---|---|---|
| limitoptional | int | 24 |
Month fields and schemaShowHide
Fields
| Name | Type |
|---|---|
| addedrequired | integer |
| monthrequired | string |
| runsrequired | integer |
| usedrequired | integer |
JSON schema
{
"type": "object",
"description": "One calendar month of the ledger: what finished runs used, what was added, how many runs finished.",
"required": [
"month",
"used",
"added",
"runs"
],
"properties": {
"added": {
"type": "integer"
},
"month": {
"type": "string"
},
"runs": {
"type": "integer"
},
"used": {
"type": "integer"
}
}
}From the installed client, phi 0.4.2, 2026-11-23.