Skip to content
Provider Configuration

Provider Configuration

A provider setup registers an integration with Valdr. Give it a display name, choose its type, and enable it. Model lists and connection defaults are optional. Manage provider setups in Settings > Providers, or export/import them as JSON.

A provider makes an integration available. Presets save the model and settings you want to use for each session. For OpenCode, the provider can have an empty model list; select the model in each preset.

JSON schema

Each provider setup is a JSON object with this shape:

{
  "providerId": "codex",
  "providerType": "codex",
  "displayName": "Codex",
  "isEnabled": true,
  "apiKeyEnvVar": "CODEX_API_KEY",
  "baseUrl": null,
  "defaultModel": "gpt-5.4",
  "defaultTemperature": null,
  "defaultMaxTokens": null,
  "models": [
    { "id": "gpt-5.4", "label": "GPT-5.4" },
    { "id": "gpt-5.4-mini", "label": "GPT-5.4 Mini" }
  ]
}

Field reference

FieldTypeRequiredPurpose
providerIdstringYesUnique identifier for this setup record. Built-in providers use stable IDs; custom providers get a generated ULID.
providerTypestringYesIntegration type. Must be a registered provider type (see below).
displayNamestringYesHuman-readable name shown in UI dropdowns and tables.
isEnabledbooleanYesWhether this provider is available. Set false to disable without deleting.
apiKeyEnvVarstring | nullNoEnvironment variable containing the API key (e.g., "CODEX_API_KEY"). OpenCode uses its own authentication or explicit credential references instead. Set null if no key is needed.
baseUrlstring | nullNoDefault/suggested endpoint URL. Required for Ollama ("http://localhost:11434"). null uses the provider’s default.
defaultModelstring | nullNoSuggested default model. Informs UI model selection and export metadata.
defaultTemperaturenumber | nullNoSuggested default temperature (0–2). Informs UI and exports.
defaultMaxTokensnumber | nullNoSuggested default max output tokens (positive integer). Informs UI and exports.
modelsarrayNoOptional model choices for UI selection. Each entry: { "id": "model-id", "label": "Display Name" }. OpenCode can use []; choose its model in the preset config.

Registered provider types

These are the valid providerType values:

TypeProviderUse it for
claudeClaudeClaude sessions using your configured models and permissions
codexCodexCodex sessions using your configured models and permissions
opencodeOpenCodeModels available through OpenCode
ollamaOllamaModels served by your local Ollama installation

Claude, Codex, and OpenCode support continuing an existing session.

Upgrading to 0.3.4: The direct gemini, openai, and anthropic providers have been removed. Create an OpenCode provider and replacement presets, then update affected agent and workflow selections. Existing presets are not automatically converted.

Provider settings and session settings

Provider setups organize the names and model choices shown in Settings. To select the model, endpoint, temperature, or token limits for a session, set those values in the preset’s config; catalog defaults alone do not set them for every session.

If the provider needs an API key, apiKeyEnvVar identifies the environment variable to use unless the preset supplies its own credential reference. OpenCode uses its saved authentication or explicit credential references instead.

Per-provider config keys

Use shared Valdr keys for model selection, environment overrides, and supported MCP connections. Put additional provider-specific settings in a flat config.native object. Shared settings take precedence over corresponding native settings. See the preset reference for config.env and config.native, including version requirements.

Claude

KeyTypeNotes
modelstringPer-session model override
permissionModedefault | acceptEdits | bypassPermissions | dontAsk | planControls tool approvals; bypassPermissions allows unattended execution and requires trust in the agent
allowedToolsstring[]Tools approved without prompting; omit to use configured defaults
disallowedToolsstring[]Tools the session must not use
maxTurnsnumberMaximum agent turns per prompt
envobject of stringsPer-session child environment overrides
nativeJSON objectAdditional Claude Agent SDK options, such as settingSources, tools, and maxBudgetUsd
model_preferences.reasoning_effortstringNested or dotted key: low, medium, high, xhigh, or max; omit to inherit the provider default
mcpServersobjectAdditional MCP servers to make available to the session

Claude does not use keepAliveMs. Use maxTurns to bound the number of agent turns per prompt.

When neither the preset nor environment sets these options, permissionMode is default and allowedTools adds no approvals. Valdr access is configured automatically.

Environment variables: CLAUDE_MODEL, CLAUDE_PERMISSION_MODE, CLAUDE_MAX_TURNS, CLAUDE_ALLOWED_TOOLS, CLAUDE_DISALLOWED_TOOLS.

Codex

KeyTypeNotes
modelstringModel identifier
temperaturenumberSampling temperature (0–2, default 0.2)
maxOutputTokensnumberOutput length cap (16–32768, default 8192)
topPnumberNucleus sampling
stopSequencesstring[]Termination markers
reasoning_effort / model_preferences.reasoning_effortstringlow, medium, high, xhigh, max, or ultra; legacy minimal is also accepted
envobject of stringsPer-session child environment overrides
nativeJSON objectAdditional Codex configuration; existing top-level passthrough also remains supported
mcpServersobjectAdditional MCP servers; Valdr access is enabled by default
keepAliveMsnumberSession keep-alive timeout
sessionIdleCloseMsnumberExplicit idle-close delay

Authentication: Sign in with codex login, or set CODEX_API_KEY (OPENAI_API_KEY also works as a fallback).

Environment variables: CODEX_API_KEY, CODEX_BASE_URL, CODEX_MODEL, CODEX_TEMPERATURE, CODEX_MAX_OUTPUT_TOKENS.

OpenCode

  1. Add an enabled provider with type OpenCode in Settings > Providers.
  2. Leave API key env var, Base URL, Default model, and Default max tokens empty. Models can stay []; other defaults can stay as they are.
  3. Create presets in Settings > Agent Presets and select the model in Config JSON, for example:
{
  "model": "openai/gpt-6-sol",
  "agent": "build"
}

Use a model available to your OpenCode account. OpenCode handles its own sign-in and settings. A preset can also use config: {} to keep OpenCode’s defaults, with env: [] when no environment references are needed.

MCP servers are optional. Omit mcpServers unless you want to add or override an MCP connection for that preset. See the complete preset example.

OpenCode requires a stable 1.18.x executable on the machine running Valdr, on PATH or selected with the preset’s executable setting.

Optional preset settings

These settings can be omitted unless you need to change OpenCode’s defaults:

KeyTypeNotes
modelstringModel to use, in provider/model form
agentstringOpenCode agent to use, such as build
variantstringA variant supported by the selected model
executablestringPath to the OpenCode executable when it is not on PATH
envobject of stringsPer-session environment overrides, including native inheritance flags and HOME/XDG paths
nativeJSON objectOpenCode configuration, including agent definitions, instructions, permissions, and providers
permissionstring or objectNative OpenCode permission rules; interactive ask requests fail in headless sessions
mcpServersobjectOptional MCP connections; see MCP server attachment
startupTimeoutMs / timeoutMsnumberPositive millisecond limits; defaults 30000 / 600000

agent selects an agent by name; native.agent defines the agent map. Native settings merge with OpenCode’s existing configuration. For a read-only code reviewer preset with explicit tool scope and inheritance controls, see read-only code review example.

If you need a credential override, use an environment reference such as {"envRef":"MY_MODEL_KEY"} or $env:MY_MODEL_KEY. A top-level apiKey override also requires an explicit model.

OpenCode supports executor, reviewer, and auditor sessions. Queued follow-ups continue the same conversation; active-turn steering is unavailable. Start a new session after changing a preset so it uses the new configuration.

Ollama

KeyTypeNotes
modelstringRequired — model identifier
temperaturenumberSampling temperature
maxOutputTokensnumberOutput length limit
baseUrlstringBase URL override for the Ollama API
envobject of stringsOLLAMA_HOST endpoint fallback when baseUrl is absent; does not reconfigure the running server
nativeJSON objectOllama model options, such as options.num_ctx, options.seed, and think
keepAliveMsnumberHow long to keep the model loaded while idle, in milliseconds

Ollama does not support permissionMode, allowedTools, or additional mcpServers.

Examples

Claude Code

{
  "providerId": "claude",
  "providerType": "claude",
  "displayName": "Claude Code",
  "isEnabled": true,
  "apiKeyEnvVar": null,
  "baseUrl": null,
  "defaultModel": "sonnet",
  "defaultTemperature": null,
  "defaultMaxTokens": null,
  "models": [
    { "id": "default", "label": "Default" },
    { "id": "sonnet", "label": "Sonnet" },
    { "id": "sonnet[1m]", "label": "Sonnet 1M" },
    { "id": "opus", "label": "Opus" },
    { "id": "haiku", "label": "Haiku" },
    { "id": "opusplan", "label": "Opus Plan" }
  ]
}

Codex

{
  "providerId": "codex",
  "providerType": "codex",
  "displayName": "Codex",
  "isEnabled": true,
  "apiKeyEnvVar": "CODEX_API_KEY",
  "baseUrl": null,
  "defaultModel": "gpt-5.4",
  "defaultTemperature": null,
  "defaultMaxTokens": null,
  "models": [
    { "id": "gpt-5.4", "label": "GPT-5.4" },
    { "id": "gpt-5.4-mini", "label": "GPT-5.4 Mini" },
    { "id": "gpt-5.3-codex", "label": "GPT-5.3 Codex" },
    { "id": "gpt-5.3-codex-spark", "label": "GPT-5.3 Codex Spark" }
  ]
}

OpenCode — empty provider setup

{
  "providerId": "opencode",
  "providerType": "opencode",
  "displayName": "OpenCode",
  "isEnabled": true,
  "apiKeyEnvVar": null,
  "baseUrl": null,
  "defaultModel": null,
  "models": []
}

Choose models in presets; no model list or connection defaults are needed here.

Ollama (local)

{
  "providerId": "ollama",
  "providerType": "ollama",
  "displayName": "Ollama Local",
  "isEnabled": true,
  "apiKeyEnvVar": null,
  "baseUrl": "http://localhost:11434",
  "defaultModel": "qwen3-coder-next",
  "defaultTemperature": null,
  "defaultMaxTokens": null,
  "models": [
    { "id": "qwen3-coder-next", "label": "Qwen3-Coder-Next" },
    { "id": "qwen3", "label": "Qwen3" },
    { "id": "deepseek-r1", "label": "DeepSeek R1" }
  ]
}

Import and export

Use Export and Import in Settings > Providers. The export produces a JSON array of provider setup objects. Import on another machine to replicate the provider catalog instantly.

Next steps

Providers define what Valdr can talk to. Presets define how — the specific model, permissions, and runtime config for each agent launch.