Class RunUsage.Builder
- java.lang.Object
-
- ai.extend.types.RunUsage.Builder
-
- All Implemented Interfaces:
RunUsage._FinalStage,RunUsage.CreditsStage
- Enclosing class:
- RunUsage
public static final class RunUsage.Builder extends java.lang.Object implements RunUsage.CreditsStage, RunUsage._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RunUsage._FinalStagebreakdown(java.util.List<RunUsageBreakdownEntry> breakdown)The chargeable resources that make uptotalCredits, including this run itself when it has its own line item.RunUsage._FinalStagebreakdown(java.util.Optional<java.util.List<RunUsageBreakdownEntry>> breakdown)The chargeable resources that make uptotalCredits, including this run itself when it has its own line item.RunUsagebuild()RunUsage._FinalStagecredits(double credits)The credits consumed by this run.RunUsage.Builderfrom(RunUsage other)RunUsage._FinalStagetotalCredits(java.lang.Double totalCredits)The total credits accounted for under this run, including any other runs it was responsible for creating.RunUsage._FinalStagetotalCredits(java.util.Optional<java.lang.Double> totalCredits)The total credits accounted for under this run, including any other runs it was responsible for creating.
-
-
-
Method Detail
-
from
public RunUsage.Builder from(RunUsage other)
- Specified by:
fromin interfaceRunUsage.CreditsStage
-
credits
public RunUsage._FinalStage credits(double credits)
The credits consumed by this run. For most run types this is the line item for the run's own work; for
workflow_runthis is the aggregate across all child runs.The credits consumed by this run. For most run types this is the line item for the run's own work; for
workflow_runthis is the aggregate across all child runs.- Specified by:
creditsin interfaceRunUsage.CreditsStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
breakdown
public RunUsage._FinalStage breakdown(java.util.List<RunUsageBreakdownEntry> breakdown)
The chargeable resources that make up
totalCredits, including this run itself when it has its own line item. Forworkflow_run, lists every contributing child run sorted by creation time (the workflow itself isn't chargeable and has no line item).Availability: Present on runs persisted on or after May 14, 2026. Runs persisted before that date will omit this field.
- Specified by:
breakdownin interfaceRunUsage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
breakdown
public RunUsage._FinalStage breakdown(java.util.Optional<java.util.List<RunUsageBreakdownEntry>> breakdown)
The chargeable resources that make up
totalCredits, including this run itself when it has its own line item. Forworkflow_run, lists every contributing child run sorted by creation time (the workflow itself isn't chargeable and has no line item).Availability: Present on runs persisted on or after May 14, 2026. Runs persisted before that date will omit this field.
- Specified by:
breakdownin interfaceRunUsage._FinalStage
-
totalCredits
public RunUsage._FinalStage totalCredits(java.lang.Double totalCredits)
The total credits accounted for under this run, including any other runs it was responsible for creating. For example, an extract run on a fresh upload triggers a parse run, so
totalCreditsincludes both line items. For runs that didn't trigger any other work — likeparse_run,edit_runandworkflow_run—totalCreditsequalscredits.Availability: Present on runs persisted on or after May 14, 2026. Runs persisted before that date will omit this field.
- Specified by:
totalCreditsin interfaceRunUsage._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
totalCredits
public RunUsage._FinalStage totalCredits(java.util.Optional<java.lang.Double> totalCredits)
The total credits accounted for under this run, including any other runs it was responsible for creating. For example, an extract run on a fresh upload triggers a parse run, so
totalCreditsincludes both line items. For runs that didn't trigger any other work — likeparse_run,edit_runandworkflow_run—totalCreditsequalscredits.Availability: Present on runs persisted on or after May 14, 2026. Runs persisted before that date will omit this field.
- Specified by:
totalCreditsin interfaceRunUsage._FinalStage
-
build
public RunUsage build()
- Specified by:
buildin interfaceRunUsage._FinalStage
-
-