Billing API.¶
The DeepOriginClient can be used to access the billing API using:
from deeporigin.platform.client import DeepOriginClient
client = DeepOriginClient()
Then, the following methods can be used, for example:
# Get usage information for a billing tag (with default dates)
usage = client.billing.get_usage_by_tag(tag="foo14")
# Get usage information with custom date range
usage = client.billing.get_usage_by_tag(
tag="foo14",
start_date="2020-01-01",
end_date="2030-01-01",
)
src.platform.billing.Billing
¶
Billing API wrapper.
Provides access to billing-related endpoints through the DeepOriginClient.
Functions¶
get_usage_by_tag
¶
get_usage_by_tag(
*,
tag: str,
start_date: str = "2020-01-01",
end_date: str | None = None
) -> dict
Get usage information for a billing tag within a date range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
str
|
The billing tag to get usage for. |
required |
start_date
|
str
|
Start date in YYYY-MM-DD format. |
'2020-01-01'
|
end_date
|
str | None
|
End date in YYYY-MM-DD format. Defaults to today's date. |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary containing usage information. |