Credits
Check your organization's compute balance, ledger and usage by operation, and estimate what an operation costs before you run it. Amounts are in US dollars.
On this page
One wallet per organization pays for every paid operation. Uploads, exports, search and manual annotation are free.
Amounts are integers in micro-USD (1 USD = 1,000,000 µUSD); each *_micro_usd field
has a *_usd property in dollars.
Paid plans include a monthly allowance; the Free plan starts with a one-time credit instead:
| Plan | Included compute |
|---|---|
| Free | $25, one time |
| Core | $29 a month |
| Pro | $50 a month |
| Team | $100 a month |
| Enterprise | By contract |
A monthly allowance renews each month and doesn’t carry over. The Free plan’s one-time credit and prepaid compute stay on the balance until they’re used. Past them, an organization with a saved card can turn on pay-as-you-go in the app, up to its monthly Budget. With pay-as-you-go off, spending stops when the included compute runs out.
balance
The current wallet and its last 20 ledger entries.
Source: Credits.balance
balance = client.credits.balance()
print(f"Left to spend: ${balance.remaining_usd:.2f}")
print(f"Monthly allowance: ${balance.allowance_usd:.2f}")
print(f"Spent this period: ${balance.spend_usd:.2f}")
print(f"Overage: ${balance.overage_usd:.2f} (budget cap ${balance.budget_usd:.2f})")
print("Allowance resets:", balance.credits_reset_at)
pictograph credits balance
curl -s "https://api.pictograph.io/api/v1/developer/credits/balance" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns CreditBalance
CreditBalance · 11 fields
class CreditBalance(BaseModel):
"""An organization's compute wallet, in micro-USD (µUSD)."""
# The plan's monthly allowance.
included_allowance_micro_usd: int = 0
# Allowance and prepaid credit left to spend this period.
included_remaining_micro_usd: int = 0
# Monthly spend cap, allowance included; equals the allowance with pay-as-you-go
# off.
budget_micro_usd: int = 0
# Spent this period.
period_spend_micro_usd: int = 0
# Spent beyond the allowance this period.
period_overage_micro_usd: int = 0
# Left under the spend cap this period.
budget_remaining_micro_usd: int = 0
# Start of the current billing period.
period_start: datetime | None = None
# When the monthly allowance resets next.
credits_reset_at: datetime | None = None
# DEPRECATED: whole-dollar remaining credit. Use included_remaining_micro_usd.
credits_remaining: int = 0
# DEPRECATED: whole-dollar monthly allowance. Use included_allowance_micro_usd.
credits_monthly_allowance: int = 0
# The last 20 ledger entries, newest first.
recent_history: list[CreditLedgerEntry] = []
# Monthly included allowance in USD (`included_allowance_micro_usd / 1e6`).
@property
def allowance_usd(self) -> float: ...
# Remaining overage budget in USD (`budget_remaining_micro_usd / 1e6`).
@property
def budget_remaining_usd(self) -> float: ...
# Overage budget cap in USD (`budget_micro_usd / 1e6`).
@property
def budget_usd(self) -> float: ...
# Overage incurred this period in USD (`period_overage_micro_usd / 1e6`).
@property
def overage_usd(self) -> float: ...
# Remaining included allowance in USD (`included_remaining_micro_usd / 1e6`).
@property
def remaining_usd(self) -> float: ...
# Total spend this period in USD (`period_spend_micro_usd / 1e6`).
@property
def spend_usd(self) -> float: ...
budget_micro_usd equals the allowance while pay-as-you-go is off.
history
One page of the ledger, newest first.
Source: Credits.history
| Arg | Type | Default | Notes |
|---|---|---|---|
limit |
int |
50 |
Page size (max 100) |
offset |
int |
0 |
Items to skip |
for entry in client.credits.history(limit=50, offset=0):
direction = "debit" if entry.amount < 0 else "credit"
print(entry.created_at, direction, abs(entry.amount), "µUSD", entry.operation)
pictograph credits history --limit 50 --offset 0
curl -s "https://api.pictograph.io/api/v1/developer/credits/history?limit=50&offset=0" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns list[CreditLedgerEntry]
CreditLedgerEntry · 7 fields
class CreditLedgerEntry(BaseModel):
"""A single entry in the organization's credit ledger."""
id: str
# Operation slug, such as 'training_a10g' or 'sam3_auto_annotation'.
operation: str
# Micro-USD: negative for a charge, positive for a top-up, reset or refund.
amount: int
# What could be spent right after this entry, in micro-USD.
balance_after: int | None = None
description: str | None = None
metadata: dict[str, Any] | None = None
created_at: datetime
amount is negative for a charge and positive for a top-up, a monthly reset or a refund.
balance_after is what could be spent right after the entry.
iter
The whole ledger, fetched page by page.
Source: Credits.iter
| Arg | Type | Default | Notes |
|---|---|---|---|
page_size |
int |
100 |
Items fetched per request |
max_total |
int | None |
None |
Stop after this many items |
for entry in client.credits.iter(page_size=100):
print(entry.balance_after, entry.operation)
pictograph credits history --all --max-total 5000
# REST pages manually: raise offset until fewer than `limit` rows come back.
curl -s "https://api.pictograph.io/api/v1/developer/credits/history?limit=100&offset=0" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns OffsetPager[CreditLedgerEntry]
CreditLedgerEntry · 7 fields
class CreditLedgerEntry(BaseModel):
"""A single entry in the organization's credit ledger."""
id: str
# Operation slug, such as 'training_a10g' or 'sam3_auto_annotation'.
operation: str
# Micro-USD: negative for a charge, positive for a top-up, reset or refund.
amount: int
# What could be spent right after this entry, in micro-USD.
balance_after: int | None = None
description: str | None = None
metadata: dict[str, Any] | None = None
created_at: datetime
usage_by_operation
What each kind of operation cost over a window.
Source: Credits.usage_by_operation
| Arg | Type | Default | Notes |
|---|---|---|---|
range |
UsageRange |
"month" |
day, week, month or all |
usage = client.credits.usage_by_operation(range="month")
for op in usage.operations:
print(f"{op.operation}: ${op.total_usd:.2f} over {op.event_count} events")
pictograph credits usage --range month
curl -s "https://api.pictograph.io/api/v1/developer/credits/usage-by-operation?range=month" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns UsageByOperation
UsageByOperation · 5 fields
class UsageByOperation(BaseModel):
"""Per-operation compute-spend breakdown over a rolling window."""
# Window: 'day' | 'week' | 'month' | 'all'.
range: str
# ISO timestamp the window starts at.
since: str | None = None
operations: list[OperationUsage] = []
# Total spend across the window (µUSD).
total_micro_usd: int = 0
# Charges across the window.
total_events: int = 0
# Total spend across the window in USD (`total_micro_usd / 1e6`).
@property
def total_usd(self) -> float: ...
estimate
The live price of a paid operation, and whether your balance covers it.
Source: Credits.estimate
| Arg | Type | Default | Notes |
|---|---|---|---|
operation |
str |
required | Operation slug, e.g. training_a10g |
quantity |
int |
1 |
Units to price |
estimate = client.credits.estimate(
operation="training_a10g",
quantity=30,
)
print(f"${estimate.per_unit_usd:.4f} per {estimate.unit}")
print(f"Total ${estimate.total_usd:.2f}, sufficient: {estimate.sufficient}")
pictograph credits estimate training_a10g --quantity 30
curl -s "https://api.pictograph.io/api/v1/developer/credits/estimate?operation=training_a10g&quantity=30" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns CreditEstimate
CreditEstimate · 11 fields
class CreditEstimate(BaseModel):
"""What a planned operation would cost, in micro-USD (µUSD), and whether the balance covers it."""
operation: str
# The unit priced, such as 'minute', 'image' or 'run'.
unit: str
quantity: int
# Price per unit.
micro_usd_per_unit: int = 0
# `micro_usd_per_unit * quantity`.
total_micro_usd: int = 0
# What the organization could spend when this was estimated.
remaining_micro_usd: int = 0
# Whether the balance covers `total_micro_usd`.
sufficient: bool = False
# DEPRECATED: whole-dollar per-unit cost. Use micro_usd_per_unit.
credits_per_unit: int = 0
# DEPRECATED: whole-dollar total cost. Use total_micro_usd.
total_credits: int = 0
# DEPRECATED: whole-dollar floor on total. No longer used (always 0).
minimum: int = 0
# DEPRECATED: whole-dollar remaining balance. Use remaining_micro_usd.
credits_remaining: int = 0
# Per-unit cost in USD (`micro_usd_per_unit / 1e6`).
@property
def per_unit_usd(self) -> float: ...
# Spendable compute credit in USD (`remaining_micro_usd / 1e6`).
@property
def remaining_usd(self) -> float: ...
# Total estimated cost in USD (`total_micro_usd / 1e6`).
@property
def total_usd(self) -> float: ...
Common operations: training_a10g, training_a100, training_h100, sam3_auto_annotation,
inference_t4, image_generate_gemini_3_1_flash, image_edit_gemini_3_1_flash; each image
model has its own pair. sufficient can change before your call runs (another caller can
spend first); the operation itself raises PaymentRequiredError if the balance is short.
Plan requirements
AI image generation and editing, and dataset cold storage, need the Core plan or higher;
on Free they are refused (403, tier_restricted) before anything is charged. Everything
else (SAM3, auto-annotation, training, deployments, workflows) runs on every plan, Free
included, and credits are its only limit.
Gating a paid step
Check the estimate, then commit:
estimate = client.credits.estimate(
operation="training_a10g",
quantity=30,
)
if not estimate.sufficient:
raise SystemExit(f"Need ${estimate.total_usd:.2f}, have ${estimate.remaining_usd:.2f}")
run = client.training.create(
dataset="road-signs",
export="road-signs-v1",
pipeline_type="yolox",
name="road-signs-detector",
)
Auto-annotation has an exact quote instead: auto_annotate.quote.
PaymentRequiredError
Raised when an operation costs more than what is left: the included compute plus any remaining Budget. A higher plan or Budget clears it (Error handling).
from pictograph.exceptions import PaymentRequiredError
try:
client.training.create(
dataset="road-signs",
export="road-signs-v1",
pipeline_type="yolox",
name="road-signs-detector",
)
except PaymentRequiredError as exc:
# credit_cost / credits_remaining are integer µUSD (exc.unit == "micro_usd")
print(f"Need ${exc.credit_cost / 1e6:.2f}, have ${exc.credits_remaining / 1e6:.2f}")
print("Top up at:", exc.upgrade_url)
Refunds
A training run is charged only when it succeeds, so a failed or cancelled run costs nothing.
Batch auto-annotation and quantization take a deposit when they start and refund what they
didn’t use when they end, automatically (batch_auto_annotation_refund,
model_quantize_refund ledger entries).
Common errors
| Status | Exception | Cause |
|---|---|---|
| 402 | PaymentRequiredError |
Raised by the operation being estimated, never by estimate itself |
| 422 | ValidationError |
operation is not a known credit operation slug |