Dyno Phi
ContentsHTTP APIShow

Quota

Read credit usage and its history.

GET /v1/quota

Get quota

bash
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/quota

200 response (application/json)

200 response fields and schemaShow

Fields

NameType
organization_idrequiredstring
credits_limitrequiredinteger
credits_reservedrequiredinteger
credits_consumedrequiredinteger
credits_availablerequiredinteger
purchased_balancerequiredinteger
total_availablerequiredinteger
planrequiredstring
plan_sourcerequiredstring
period_startrequiredstring
period_endrequiredstring
creditsrequiredobject
JSON schema
{
  "$ref": "#/$defs/QuotaResponse",
  "$defs": {
    "AutoReloadSummary": {
      "type": "object",
      "required": [
        "enabled",
        "threshold_credits",
        "amount_cents"
      ],
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "threshold_credits": {
          "type": "integer"
        },
        "amount_cents": {
          "type": "integer"
        }
      }
    },
    "CreditsBlock": {
      "type": "object",
      "required": [
        "allowance",
        "allowance_available",
        "purchased",
        "total_available",
        "reset_at",
        "auto_reload"
      ],
      "properties": {
        "allowance": {
          "type": "integer"
        },
        "allowance_available": {
          "type": "integer"
        },
        "purchased": {
          "type": "integer"
        },
        "total_available": {
          "type": "integer"
        },
        "reset_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "auto_reload": {
          "$ref": "#/$defs/AutoReloadSummary"
        }
      }
    },
    "QuotaResponse": {
      "type": "object",
      "required": [
        "organization_id",
        "credits_limit",
        "credits_reserved",
        "credits_consumed",
        "credits_available",
        "purchased_balance",
        "total_available",
        "plan",
        "plan_source",
        "period_start",
        "period_end",
        "credits"
      ],
      "properties": {
        "organization_id": {
          "type": "string"
        },
        "credits_limit": {
          "type": "integer"
        },
        "credits_reserved": {
          "type": "integer"
        },
        "credits_consumed": {
          "type": "integer"
        },
        "credits_available": {
          "type": "integer"
        },
        "purchased_balance": {
          "type": "integer"
        },
        "total_available": {
          "type": "integer"
        },
        "plan": {
          "type": "string"
        },
        "plan_source": {
          "type": "string"
        },
        "period_start": {
          "type": "string"
        },
        "period_end": {
          "type": "string"
        },
        "credits": {
          "$ref": "#/$defs/CreditsBlock"
        }
      }
    }
  }
}

Illustrative response shape. Values are placeholders, not a recorded result.

json
{
  "organization_id": "<value>",
  "credits_limit": 0,
  "credits_reserved": 0,
  "credits_consumed": 0,
  "credits_available": 0,
  "purchased_balance": 0,
  "total_available": 0,
  "plan": "<value>",
  "plan_source": "<value>",
  "period_start": "<value>",
  "period_end": "<value>",
  "credits": {
    "allowance": 0,
    "allowance_available": 0,
    "purchased": 0,
    "total_available": 0,
    "reset_at": "<value>",
    "auto_reload": {
      "enabled": false,
      "threshold_credits": 0,
      "amount_cents": 0
    }
  }
}

Returns 200 or 422.

GET /v1/quota/history

Get quota history

bash
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/quota/history

Parameters

NameTypeDefaultDescription
pagequery, optionalinteger1minimum: 1
page_sizequery, optionalinteger50minimum: 1; maximum: 200
cursorquery, optionalstring or nullOpaque keyset cursor from a prior X-Next-Cursor header
reasonquery, optional(string)[] or nullKeep entries with these reasons only (repeatable)

200 response (application/json)

200 response fields and schemaShow
JSON schema
{
  "type": "array",
  "items": {
    "$ref": "#/$defs/LedgerEntryResponse"
  },
  "$defs": {
    "PaidWithResponse": {
      "type": "object",
      "properties": {
        "brand": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "last4": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "LedgerEntryResponse": {
      "type": "object",
      "required": [
        "id",
        "run_id",
        "amount",
        "balance_after",
        "reason",
        "pool",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "run_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "amount": {
          "type": "integer"
        },
        "balance_after": {
          "type": "integer"
        },
        "reason": {
          "type": "string"
        },
        "pool": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "run_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "pipeline_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "receipt_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "paid_with": {
          "anyOf": [
            {
              "$ref": "#/$defs/PaidWithResponse"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  }
}

Illustrative response shape. Values are placeholders, not a recorded result.

json
[
  {
    "id": "<value>",
    "run_id": "<value>",
    "amount": 0,
    "balance_after": 0,
    "reason": "<value>",
    "pool": "<value>",
    "created_at": "<value>",
    "run_name": "<value>",
    "pipeline_type": "<value>",
    "note": "<value>",
    "receipt_url": "<value>",
    "paid_with": {
      "brand": "<value>",
      "last4": "<value>"
    }
  }
]

Returns 200 or 422.

GET /v1/quota/months

Get quota months

The ledger by calendar month, newest first: what finished runs used (``RUN_COMPLETED``), what was added by purchases and grants, and how many runs finished. Reservations and their returns net out of the month and are not counted.

bash
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/quota/months

Parameters

NameTypeDefaultDescription
limitquery, optionalinteger24minimum: 1; maximum: 120

200 response (application/json)

200 response fields and schemaShow
JSON schema
{
  "type": "array",
  "items": {
    "$ref": "#/$defs/MonthResponse"
  },
  "$defs": {
    "MonthResponse": {
      "type": "object",
      "description": "One calendar month (UTC) of the ledger: what finished runs used and what was added.",
      "required": [
        "month",
        "used",
        "added",
        "runs"
      ],
      "properties": {
        "month": {
          "type": "string"
        },
        "used": {
          "type": "integer"
        },
        "added": {
          "type": "integer"
        },
        "runs": {
          "type": "integer"
        }
      }
    }
  }
}

Illustrative response shape. Values are placeholders, not a recorded result.

json
[
  {
    "month": "<value>",
    "used": 0,
    "added": 0,
    "runs": 0
  }
]

Returns 200 or 422.

From phi-api 0.2.2, 2026-11-23.