Skip to main content

Interface: ModelConfig

Defined in: packages/workflow-engine/src/ai/model-helper.ts:7

Properties​

batchDiscountPercent?​

optional batchDiscountPercent?: number

Defined in: packages/workflow-engine/src/ai/model-helper.ts:33

Vendor-documented batch discount for the NATIVE transports (OpenAI Batch, Anthropic Message Batches, Gemini Batch are all 50% off). Applied only when batching through one of those vendors, or when no absolute batch*CostPerMillion price is known. The OpenRouter transport always uses the absolute prices below instead - its multipliers are not uniform. Populated by workflow-engine-sync only for vendors with a documented discount; never guessed.


batchInputCostPerMillion?​

optional batchInputCostPerMillion?: number

Defined in: packages/workflow-engine/src/ai/model-helper.ts:46

Absolute price of the ":batch" variant, per 1M input tokens. Authoritative; prefer over batchDiscountPercent.


batchModelId?​

optional batchModelId?: string

Defined in: packages/workflow-engine/src/ai/model-helper.ts:35

The ":batch" sibling slug in OpenRouter's catalog, when one exists.


batchOutputCostPerMillion?​

optional batchOutputCostPerMillion?: number

Defined in: packages/workflow-engine/src/ai/model-helper.ts:48

Absolute price of the ":batch" variant, per 1M output tokens.


batchProvider?​

optional batchProvider?: "google" | "anthropic" | "openai" | "openrouter"

Defined in: packages/workflow-engine/src/ai/model-helper.ts:44

Batch transport to prefer for this model when a call names none: "openrouter" routes ctx.step.ai.map / ai.batch(key) through the OpenRouter Batch API (the key you already use for realtime calls) instead of the vendor SDK the slug names. Resolution order is the call's batch.provider, then this, then the slug's native vendor (google/anthropic/openai), then OpenRouter.


cachedInputCostPerMillion?​

optional cachedInputCostPerMillion?: number

Defined in: packages/workflow-engine/src/ai/model-helper.ts:20

Price of a cached (prompt-cache read) input token, per 1M. From OpenRouter's pricing.input_cache_read; populated by workflow-engine-sync when the catalogue publishes it. The estimate bills a call's cached input tokens at this rate and the rest at inputCostPerMillion; when absent every input token is billed at the full rate.


contextLength?​

optional contextLength?: number

Defined in: packages/workflow-engine/src/ai/model-helper.ts:79


description?​

optional description?: string

Defined in: packages/workflow-engine/src/ai/model-helper.ts:22


id​

id: string

Defined in: packages/workflow-engine/src/ai/model-helper.ts:8


inputCostPerMillion​

inputCostPerMillion: number

Defined in: packages/workflow-engine/src/ai/model-helper.ts:10


isEmbeddingModel?​

optional isEmbeddingModel?: boolean

Defined in: packages/workflow-engine/src/ai/model-helper.ts:57


isEvaluationModel?​

optional isEvaluationModel?: boolean

Defined in: packages/workflow-engine/src/ai/model-helper.ts:63

True for decision models (OpenRouter output modality decisions, e.g. TypeSafe's Jev). These answer typed questions through ai.evaluate and cannot generate text; workflow-engine-sync sets this from the catalogue.


isTranscriptionModel?​

optional isTranscriptionModel?: boolean

Defined in: packages/workflow-engine/src/ai/model-helper.ts:69

True for speech-to-text models answered through ai.transcribe (OpenAI's whisper-1 / gpt-4o-transcribe, Google's transcription models). Not in OpenRouter's catalogue, so registered by hand with registerModels.


longContextTier?​

optional longContextTier?: object

Defined in: packages/workflow-engine/src/ai/model-helper.ts:50

Long-context pricing tier from OpenRouter pricing.overrides, when the override is keyed on prompt length.

cachedInputCostPerMillion?​

optional cachedInputCostPerMillion?: number

Cached-input rate inside the tier, when the override publishes one.

inputCostPerMillion​

inputCostPerMillion: number

minPromptTokens​

minPromptTokens: number

outputCostPerMillion​

outputCostPerMillion: number


maxCompletionTokens?​

optional maxCompletionTokens?: number | null

Defined in: packages/workflow-engine/src/ai/model-helper.ts:80


name​

name: string

Defined in: packages/workflow-engine/src/ai/model-helper.ts:9


outputCostPerMillion​

outputCostPerMillion: number

Defined in: packages/workflow-engine/src/ai/model-helper.ts:11


provider​

provider: string

Defined in: packages/workflow-engine/src/ai/model-helper.ts:21


supportsAsyncBatch?​

optional supportsAsyncBatch?: boolean

Defined in: packages/workflow-engine/src/ai/model-helper.ts:23


supportsStructuredOutputs?​

optional supportsStructuredOutputs?: boolean

Defined in: packages/workflow-engine/src/ai/model-helper.ts:78


supportsTools?​

optional supportsTools?: boolean

Defined in: packages/workflow-engine/src/ai/model-helper.ts:77


transcriptionCostPerMinute?​

optional transcriptionCostPerMinute?: number

Defined in: packages/workflow-engine/src/ai/model-helper.ts:76

USD per minute of transcribed audio, for providers that bill by the minute and report the audio's duration (OpenAI). Providers that bill by tokens (Google) are priced from inputCostPerMillion / outputCostPerMillion instead, from the usage they report.