Skip to content

AI Providers ​

Set the active provider with:

sh
mochi ai config set provider <provider> [flags]
ProviderWhere requests goNeeds
mochi-gateway (alias managed)Mochi's managed gateway, metered against your licenseA license
openaiOpenAIYour API key
anthropicAnthropicYour API key
geminiGoogle GeminiYour API key
ollamaA local Ollama server. Nothing leaves your machine.Ollama running locally
customAny compatible endpoint you point it at--base-url

Options ​

FlagEffect
--api-keyStore this API key in the provider's vault
--api-key-fileStore the API key read from this file. Unlike --api-key, the key never appears in the process list or your shell history
--secret-keyUse a secret already in the vault instead of storing a new one
--vaultVault to store or read the key from (defaults to the current vault)
--modelModel name to request
--base-urlBase URL for the provider's API
--outputtext or json

Keys live in a vault, never in plain config.

Checking and viewing ​

sh
mochi ai config view   # what's configured
mochi ai config test   # a real round trip to the provider

Models ​

With mochi-gateway, Mochi picks the model for each request, so there's nothing to set.

Every other provider needs --model the first time you set it up, using the model name that provider expects (for Ollama, a model you've pulled). Run the same command with a new --model to switch. mochi ai config view shows the model in use.