Skip to content
providerkit
GitHub

ModelExecution

type ModelExecution = object &
| {
attemptId: string;
id: string;
status: "running";
usage: TokenUsage;
}
| {
attemptId: string;
id: string;
status: "completed";
tools: ToolExecution[];
turn: Turn;
usage: TokenUsage;
};

Defined in: agents/src/types.ts:990

billing: "unknown" | "reported";
optional costUsd?: number;

What host.priceModelCall returned for this attempt’s usage when it arrived. Absent without a price function or before any usage.

optional finish?: SalvageReason;

Set on the finish turn, saved before it is sent: what would have ended the run.

interrupted: InterruptedModelAttempt[];