Inventory¶
Methods¶
add_anthropic¶
Register a native Anthropic Messages API provider.
Parameters
args:{name: string, base_url: string?, api_key: string, billing: string?}name— The name used to select this provider on the command line.base_url— Base URL of the Anthropic API. Defaults tohttps://api.anthropic.com; override it for a proxy or gateway.api_key— API key, sent as thex-api-keyheader. Source it fromos.getenv(...)in Lua rather than hard-coding.billing— How the user is billed:"subscription"or"metered"(the default).
add_claude_code¶
Register the Claude Code (subscription) provider.
Parameters
args:{name: string, billing: string?}name— The name used to select this provider on the command line.billing— How the user is billed:"subscription"or"metered"(the default). Claude Code can run under either, and it changes howlist-modelspresents cost, so it is configured rather than assumed.
add_favourite_models¶
Mark models as favourites, floating them to the top of the /model
picker. Each entry is a provider/model reference (the provider is
required). Accumulates across calls (and across handlers) like the
add_* methods.
Parameters
models:{[integer]: string}
add_ollama¶
Register a native Ollama provider.
Parameters
args:{name: string, base_url: string, api_key: string?, billing: string?, model_options: {[string]: {num_ctx: number?}}?}name— The name used to select this provider on the command line.base_url— Base URL of the Ollama server, e.g."http://localhost:11434".api_key— Optional API key / bearer token. A bare local Ollama needs none; when set it is sent asAuthorization: Bearer <key>on every request. Source it fromos.getenv(...)in Lua rather than hard-coding.billing— How the user is billed:"subscription"(the default here, since a local Ollama has no per-token cost) or"metered". Affects only the display ofModelInfo.billing; no code path prices an Ollama turn.model_options— Per-model option overrides, keyed by the model tag verbatim (e.g."llama3.1:8b", with no:latestsynthesis). The highest-precedence source fornum_ctx.
add_openai¶
Register an OpenAI-compatible provider.
Parameters
args:{name: string, base_url: string, api_key: string, billing: string?}name— The name used to select this provider on the command line.base_url— Base URL of the OpenAI-compatible endpoint.api_key— API key for the endpoint. Pass an empty string for servers that need none.billing— How the user is billed:"subscription"or"metered"(the default).
set_default_model¶
Choose the default model id, used when --model is omitted.
Parameters
name:string
set_default_provider¶
Choose the default provider by name, used when --provider is omitted.
Parameters
name:string