OpenCode Provider Configurator
Generate OpenCode provider JSON with verified DeepSeek/OpenAI model IDs, base URLs, environment references and default routing. Import, validate against the official schema and export locally.
Build and validate provider JSON
Choose the documented V1 provider/options format or V2 providers/settings format. Select DeepSeek or OpenAI, a verified model ID, base URL, credential environment variable name and default-model routing. Generate and validate, then copy or download opencode.json. No API key value or connection is required.
Optional UTF-8 strict-JSON import: up to 128 KiB per file or 131,072 pasted characters, 32 nesting levels and 20,000 values. Duplicate properties and schema-invalid imports are rejected. Other top-level fields, providers and model settings are retained, with an explicit list of changed fields. Format migration and comment preservation are not offered.
Original V1 example
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"deepseek": {
"name": "DeepSeek",
"env": [
"DEEPSEEK_API_KEY"
],
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://api.deepseek.com",
"apiKey": "{env:DEEPSEEK_API_KEY}"
},
"models": {
"deepseek-flash": {
"name": "deepseek-flash",
"id": "deepseek-flash"
}
}
}
},
"model": "deepseek/deepseek-flash"
}
Verified model IDs
- DeepSeek: deepseek-flash, deepseek-v4-pro — provider documentation
- OpenAI: gpt-6-astra, gpt-6-sol — provider documentation
Documentation and canonical JSON Schema reviewed 2026-10-18. Validation uses the pinned complete draft 2020-12 schema and its models.dev reference in an on-demand Worker. The schema includes deprecated V1 fields alongside V2 fields. Local CLI version observed: 1.18.30; no live provider connection was tested.
V1 uses options.apiKey with {env:VARIABLE_NAME}; V2 uses env credential names and settings.baseURL. Default routing uses provider/model; provider-only mode keeps the imported default. Review existing auth overrides, provider allow/deny lists and model settings. Schema validity does not establish account availability, a working endpoint, model limits or compatibility. No user text is stored or submitted, and no installation or service connection executes.
Back up your existing configuration and save the reviewed output as project opencode.json or merge it into ~/.config/opencode/opencode.json. Set the named credential in your own environment, run opencode in the project directory, and inspect /models. V1 providers · V2 providers · Official schema · Environment references.