~/.opsh/config.json under the provider key. Only the provider named in provider.selected is used at runtime — the others retain their settings so you can switch between them without re-entering credentials.
Setting your provider interactively
The easiest way to configure a provider is through the interactive editor:- Run
opsh --initin your terminal to open the setup wizard. - Type
!configinside the Opsh REPL, then choose Provider from the menu.
~/.opsh/config.json immediately.
The provider.selected field
The provider.selected field controls which provider Opsh uses. Set it to one of:
| Value | Provider |
|---|---|
"openrouter" | OpenRouter |
"openai" | OpenAI API |
"anthropic" | Anthropic API |
"gemini" | Gemini (Google AI API) |
"ollama" | Ollama (local) |
Provider config snippets
Each provider has its own sub-object insideprovider. The tabs below show the full structure and default values for each one.
- OpenRouter
- OpenAI
- Anthropic
- Gemini
- Ollama
config.json
| Field | Description |
|---|---|
model | Model ID to use. Default: openrouter/auto. |
baseUrl | OpenRouter API endpoint. Default: https://openrouter.ai/api/v1. |
apiKey | Your OpenRouter API key. |
temperature | Sampling temperature (0–1). Default: 0.1. |
Default base URLs
| Provider | Default base URL |
|---|---|
| OpenRouter | https://openrouter.ai/api/v1 |
| OpenAI | https://api.openai.com/v1 |
| Anthropic | https://api.anthropic.com/v1 |
| Gemini | https://generativelanguage.googleapis.com/v1beta |
| Ollama | http://localhost:11434/api |
baseUrl to point to a compatible proxy or self-hosted endpoint.
API keys are stored as plain text in
~/.opsh/config.json. Restrict access to this file so other users on the system cannot read it:
