Skip to main content

Interface: AITextResult

Defined in: packages/workflow-engine/src/ai/types.ts:129

Properties​

cost​

cost: number

Defined in: packages/workflow-engine/src/ai/types.ts:133


costSource?​

optional costSource?: "reported" | "estimated"

Defined in: packages/workflow-engine/src/ai/types.ts:137

Whether cost came from the provider or from the static price table.


inputTokens​

inputTokens: number

Defined in: packages/workflow-engine/src/ai/types.ts:131


output?​

optional output?: any

Defined in: packages/workflow-engine/src/ai/types.ts:139

Structured output when output is used


outputTokens​

outputTokens: number

Defined in: packages/workflow-engine/src/ai/types.ts:132


reasoning?​

optional reasoning?: string

Defined in: packages/workflow-engine/src/ai/types.ts:146

Reasoning/thinking text emitted by the model, when available. Reasoning models (e.g. via providerOptions.anthropic.thinking or OpenRouter's reasoning) emit on a separate channel; this surfaces it. It is NOT part of text (the answer). Undefined when the model produced no reasoning.


reportedCostUsd?​

optional reportedCostUsd?: number

Defined in: packages/workflow-engine/src/ai/types.ts:135

Actual USD cost as reported by the provider, when available. Undefined on providers that do not report it.


text​

text: string

Defined in: packages/workflow-engine/src/ai/types.ts:130