Skip to content

mochi ai config set provider ​

Set up an AI provider and make it the active one

Synopsis ​

Sets up an AI provider and makes it the active one. A provider that needs a key asks for it at a masked prompt unless you pass --api-key-file or --secret-key; the key is stored in a vault.

shell
mochi ai config set provider <mochi-gateway|openai|anthropic|gemini|ollama|custom> [flags]

Examples ​

shell
mochi ai config set provider anthropic
mochi ai config set provider ollama --model llama3.1
mochi ai config set provider mochi-gateway

Options ​

FlagTypeDescription
--api-keystringAPI key to store (prefer the prompt or --api-key-file)
--api-key-filestringRead the API key from this file
--base-urlstringBase URL for the provider's API
-h, --helphelp for provider
--modelstringModel to use
-o, --outputstringOutput format: text or json (default "text")
--secret-keystringUse a secret already in the vault as the API key
--vaultstringVault that holds the API key (defaults to the current vault)

Options inherited from parent commands ​

FlagTypeDescription
-L, --log-levelstringLog verbosity level (debug, info, fatal) (default "info")
--syncSync flow cache and workspaces

See also ​