Skip to content

Configuration ​

Oibre connects to OpenAI-compatible chat completions endpoints. A provider is a named endpoint with a base URL, optional credentials and headers, and model IDs. For installation and your first session, see Getting started.

Add and manage providers ​

The first-launch wizard can set up an endpoint. To add another interactively, run oc config add, or use /provider add in the interactive UI. You can also use CLI flags:

sh
# Fetch model IDs from https://api.openai.com/v1/models.
oc config add openai --url https://api.openai.com/v1 --key '$OPENAI_API_KEY'

# Supply model IDs and an additional HTTP header explicitly.
oc config add openrouter --url https://openrouter.ai/api/v1 --key '$OPENROUTER_API_KEY' \
  --models anthropic/claude-sonnet-4,openai/gpt-4.1 --header X-Title=oibre

# A keyless local endpoint; ensure the server and model are available first.
oc config add ollama --url http://localhost:11434/v1 --models qwen3:8b

Set each referenced environment variable before running the command and when starting oc. Single quotes prevent the shell from expanding the reference into a literal key. --header Name=value can be repeated; headers are sent with provider requests. When --models is omitted, oc fetches IDs from <baseUrl>/models; if that returns no models or is unavailable, specify a comma-separated list with --models.

oc config add <name> replaces an existing provider of that name. Provider names cannot contain /. The base URL is the API root: requests go to <baseUrl>/chat/completions. A trailing slash or a pasted /chat/completions suffix is normalized away.

sh
oc config                       # list providers and the default model
oc config path                  # print the active config path
oc models                       # list configured model references
oc config default openai/gpt-4.1 # set the default
oc config delete ollama         # remove an endpoint

In the interactive UI, /provider manages endpoints, and /models <provider> shows or changes a provider's model list. /models <provider> fetch re-syncs it with the endpoint's /models.

Choose a model ​

Use provider/model, for example openrouter/anthropic/claude-sonnet-4. A bare model ID works if exactly one provider lists it, including IDs containing slashes such as anthropic/claude-sonnet-4; when multiple providers list the same ID, specify the provider. A recognized provider prefix can also select a model not listed in that provider's configuration.

sh
oc config default openai/gpt-4.1
oc -m ollama/qwen3:8b

oc config default sets the saved default; -m selects a model for an invocation. Inside a session, /model opens a picker and /model provider/model switches the current session's model. Without an explicit selection or saved default, oc uses the first configured model.

Configuration file and secrets ​

By default, configuration is stored in ~/.oibre/config.json. Set OIBRE_HOME to use another directory; the file will be config.json inside that directory. This also changes the Oibre home used for other Oibre data, so use the same setting when you want to return to that data.

sh
export OIBRE_HOME="$HOME/.oibre-work"
oc config path
oc config add ollama --url http://localhost:11434/v1 --models qwen3:8b

In PowerShell, the equivalent is $env:OIBRE_HOME = "$HOME\.oibre-work". Run oc config path to confirm which configuration is active. For example, the file can contain:

json
{
  "defaultModel": "openai/gpt-4.1",
  "providers": {
    "openai": {
      "baseUrl": "https://api.openai.com/v1",
      "apiKey": "$OPENAI_API_KEY",
      "models": ["gpt-4.1", "gpt-4.1-mini"]
    },
    "ollama": {
      "baseUrl": "http://localhost:11434/v1",
      "models": ["qwen3:8b"]
    }
  }
}

apiKey may be a literal key or $NAME, which reads the NAME environment variable when the provider is used. A missing referenced variable produces an error; omit apiKey for a keyless server. Use the exact $NAME form for provider keys. Optional headers is an object of extra HTTP headers.

Oibre writes the configuration with 0600 permissions and creates its directory with 0700 permissions on systems that support Unix modes. Literal keys and header values are still stored in the file; protect it and any backups, and do not commit it or put secrets in shared scripts or shell history. Environment references avoid storing the key itself in this file, but the running process still receives the secret. Only configure endpoints you trust: prompts and relevant project content are sent to the selected provider.