Interface ModelOption

Flexible model option accepted by the high-level API functions.

At least one of provider or model must be supplied, or an appropriate API key environment variable must be set for auto-detection.

interface ModelOption {
    provider?: string;
    model?: string;
    apiKey?: string;
    baseUrl?: string;
}

Properties

provider?: string

Provider name. When set without model, the default model for the requested task is looked up in PROVIDER_DEFAULTS.

Example

`"openai"`, `"anthropic"`, `"ollama"`
model?: string

Explicit model identifier. Accepted in two formats:

  • "provider:model" — legacy format (e.g. "openai:gpt-4o"). provider is ignored.
  • "model" — plain name (e.g. "gpt-4o-mini"). Requires provider or env-var auto-detect.
apiKey?: string

API key override (takes precedence over environment variables).

baseUrl?: string

Base URL override (useful for local proxies or Ollama).