Dyno Phi
ContentsPython SDKShow

phi.quota

Read credit usage and its history.

phi.quota.get

python
phi.quota.get()

Returns Quota.

Quota fields and schemaShow

Fields

NameTypeDefaultDescription
creditsoptionalobject or nullnull
credits_availablerequiredinteger
credits_consumedrequiredinteger
credits_limitrequiredinteger
credits_reservedrequiredinteger
organization_idrequiredstring
period_endrequiredstringformat: date-time
period_startrequiredstringformat: date-time
planoptionalstring or nullnull
plan_sourceoptionalstring or nullnull
purchased_balanceoptionalinteger0
total_availableoptionalinteger or nullnull
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

NameTypeDefault
pageoptionalint1
page_sizeoptionalint50
cursoroptionalstr | NoneNone
reasonoptionallist[str] | NoneNone
LedgerEntry fields and schemaShow

Fields

NameTypeDefaultDescription
amountrequiredinteger
balance_afterrequiredinteger
created_atrequiredstringformat: date-time
idrequiredstring
noteoptionalstring or nullnull
pipeline_typeoptionalstring or nullnull
pooloptionalstring or nullnull
reasonrequiredstring
run_idoptionalstring or nullnull
run_nameoptionalstring or nullnull
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

NameTypeDefault
page_sizeoptionalint50
LedgerEntry fields and schemaShow

Fields

NameTypeDefaultDescription
amountrequiredinteger
balance_afterrequiredinteger
created_atrequiredstringformat: date-time
idrequiredstring
noteoptionalstring or nullnull
pipeline_typeoptionalstring or nullnull
pooloptionalstring or nullnull
reasonrequiredstring
run_idoptionalstring or nullnull
run_nameoptionalstring or nullnull
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

NameTypeDefault
limitoptionalint24
Month fields and schemaShow

Fields

NameType
addedrequiredinteger
monthrequiredstring
runsrequiredinteger
usedrequiredinteger
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.