ApiKeyInfo
from lium.sdk import ApiKeyInfo
Defined in lium.sdk.models.
An API key row as GET /keys / POST /keys describe it.
The budget fields are USD, one per window, daily_budget_usd (a UTC day), monthly_budget_usd (a
UTC calendar month), max_budget_usd (the key's lifetime); spent_today_usd / spent_month_usd /
spent_total_usd are what the key's pods were billed in each; a budget is None when the key has none. pod_visibility is own
(the key lists only the pods it rented) or account (every pod of the account); None from a server
before per-key budgets. key is the secret when the server sent it (POST /keys always; the list rows on servers
that echo it): kept out of repr and of to_dict(), so it is printed only where create prints it
once. raw is the server's row, for fields this class does not name.
ApiKeyInfo(
id: str,
name: str,
scopes: List[str] = <factory>,
created_at: Optional[str] = None,
last_used: Optional[str] = None,
workspace_id: Optional[str] = None,
daily_budget_usd: Optional[float] = None,
monthly_budget_usd: Optional[float] = None,
max_budget_usd: Optional[float] = None,
spent_today_usd: Optional[float] = None,
spent_month_usd: Optional[float] = None,
spent_total_usd: Optional[float] = None,
pod_visibility: Optional[str] = None,
pods_count: Optional[int] = None,
key: Optional[str] = None,
raw: Dict[str, Any] = <factory>
)
Fields
Methods
| Method | Description |
|---|---|
matches | Whether name_or_id names this key: its id, or its name (case-insensitive). |
to_dict | The server's row without the key material, plus the normalised fields, what --json prints. |
matches
def matches(name_or_id: str) -> bool:
Whether name_or_id names this key: its id, or its name (case-insensitive).
to_dict
def to_dict() -> Dict[str, Any]:
The server's row without the key material, plus the normalised fields, what --json prints.