Use openbb.toml
openbb.toml is a layered TOML configuration for server processes. The openbb-api and openbb-mcp launchers resolve it at startup, before the rest of openbb-core loads, and apply its [system] table and top-level flags to the server's system settings. Extensions can also read their own tables from it: openbb-news reads [news], openbb-api reads [launcher], and openbb-mcp reads [mcp].
from openbb import obb does not apply the file's [system] or [user] tables. The Python Interface takes its settings from system_settings.json, user_settings.json, and environment variables.
Choose where a setting belongs
Credentials, preferences, and command defaults belong in ~/.openbb_platform/user_settings.json or in environment variables. Every surface reads those, while command execution does not read the [user] tables of openbb.toml; see Configure credentials and Configure preferences and defaults.
Use environment variables for secrets in containers and CI, and for the OPENBB_* switches described in Environment variables. Use openbb.toml for how a server runs: CORS origins, the API version prefix, logging, and launcher options. Because the file can live in a project directory or be selected per run, it suits keeping staging.toml and prod.toml side by side.
Where the file is found
Layers are merged from lowest to highest priority. Nested tables merge key by key, while scalars and lists from a later layer replace earlier ones.
- The
[tool.openbb]table of the nearestpyproject.toml, searching upward from the working directory. Only the firstpyproject.tomlfound is checked. ~/.openbb_platform/openbb.toml, or.openbb.tomlin the same directory.- The nearest
openbb.tomlor.openbb.toml, searching upward from the working directory. - An explicit file: the
--config-fileflag ofopenbb-apiandopenbb-mcp, or the path inOPENBB_CONFIG.openbb-apialso checksOPENBB_API_CONFIG, andopenbb-mcpchecksOPENBB_MCP_CONFIGandOPENBB_API_CONFIG, beforeOPENBB_CONFIG.
A discovered file that fails to parse is skipped without an error. An explicit file passed to a launcher is parsed first, and a syntax error stops startup with Malformed TOML at explicit config path. A missing explicit file is ignored.
openbb-api --config-file ./staging.toml
OPENBB_CONFIG=./prod.toml openbb-mcp
Write the file
Keys inside [system] and its sub-tables must match the settings field names exactly. The top-level keys debug_mode, test_mode, headless, logging_suppress, allow_mutable_extensions, and allow_on_command_output are shortcuts for the same fields under [system], accept kebab-case or snake_case, and win when both forms are present.
debug-mode = false
logging-suppress = false
[system.api_settings]
version = "1"
[system.api_settings.cors]
allow_origins = ["https://pro.openbb.co"]
allow_methods = ["GET"]
Setting logging-suppress = false turns on command logging, which is off by default. The REST path prefix is computed from version as /api/v{version}; a prefix key under [system.api_settings] is ignored, so set version instead.
Launchers also export the top-level flags as OPENBB_<NAME> environment variables, such as OPENBB_DEBUG_MODE, unless the variable is already set, so a shell export takes priority over the file. .env files are applied before the TOML layers are read: ~/.openbb_platform/.env and, for the launchers, the file named by OPENBB_ENV_FILE.
The full list of [system] fields and their defaults is in Settings & Configuration. Launcher tables are documented with openbb-api and openbb-mcp, and the [news] table with openbb-news.
Verify
From the directory the server runs in, print the merged result of every layer. Keys that are missing from the output were not found in any file.
python -c "from openbb_core.app.config import load_config; print(load_config())"
With the example above in ./openbb.toml, the output contains 'debug_mode': False at the top level and the system table with api_settings. Pass a path to check an explicit file:
python -c "from openbb_core.app.config import load_config; print(load_config('./prod.toml'))"