Skip to content

OpenCode

OpenCode uses one configuration file:

txt
~/.config/opencode/opencode.json

You can also use opencode.jsonc. Create the file manually if it does not exist.

Choose the provider example that matches the group assigned to your CE API key. The base URL and API key under API Keys -> Use Key take precedence over the placeholders below.

OpenAI

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "openai": {
      "options": {
        "baseURL": "https://codex-everywhere.com/v1",
        "apiKey": "<your-ce-api-key>"
      },
      "models": {
        "gpt-6-astra": {
          "name": "GPT 6 Astra",
          "limit": {
            "context": 1000000,
            "output": 128000
          },
          "options": {
            "store": false
          },
          "variants": {
            "low": {},
            "medium": {},
            "high": {},
            "xhigh": {},
            "max": {}
          }
        },
        "gpt-5.6-sol": {
          "name": "GPT-5.6 Sol",
          "limit": {
            "context": 1000000,
            "output": 128000
          },
          "options": {
            "store": false
          },
          "variants": {
            "low": {},
            "medium": {},
            "high": {},
            "xhigh": {},
            "max": {}
          }
        },
        "gpt-5.6-terra": {
          "name": "GPT-5.6 Terra",
          "limit": {
            "context": 1000000,
            "output": 128000
          },
          "options": {
            "store": false
          },
          "variants": {
            "low": {},
            "medium": {},
            "high": {},
            "xhigh": {},
            "max": {}
          }
        },
        "gpt-5.6-luna": {
          "name": "GPT-5.6 Luna",
          "limit": {
            "context": 1000000,
            "output": 128000
          },
          "options": {
            "store": false
          },
          "variants": {
            "low": {},
            "medium": {},
            "high": {},
            "xhigh": {},
            "max": {}
          }
        }
      }
    }
  }
}

Anthropic

claude-fable-5-1 is available through Claude Max Pool only. Choose a model supported by the group assigned to your API key.

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "https://codex-everywhere.com/v1",
        "apiKey": "<your-ce-api-key>"
      },
      "npm": "@ai-sdk/anthropic",
      "models": {
        "claude-fable-5-1": {
          "name": "Claude Fable 5.1"
        },
        "claude-opus-5": {
          "name": "Claude Opus 5"
        },
        "claude-sonnet-5": {
          "name": "Claude Sonnet 5"
        },
        "claude-opus-4-8": {
          "name": "Claude Opus 4.8"
        },
        "claude-opus-4-7": {
          "name": "Claude Opus 4.7"
        },
        "claude-opus-4-6": {
          "name": "Claude Opus 4.6"
        },
        "claude-sonnet-4-6": {
          "name": "Claude Sonnet 4.6"
        },
        "claude-haiku-4-5": {
          "name": "Claude Haiku 4.5"
        }
      }
    }
  }
}

Gemini

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "gemini": {
      "options": {
        "baseURL": "https://codex-everywhere.com/v1beta",
        "apiKey": "<your-ce-api-key>"
      },
      "npm": "@ai-sdk/google",
      "models": {
        "gemini-3.8-flash": {
          "name": "Gemini 3.8 Flash",
          "limit": {
            "context": 1048576,
            "output": 65536
          },
          "modalities": {
            "input": ["text", "image", "pdf"],
            "output": ["text"]
          }
        },
        "gemini-3.1-pro": {
          "name": "Gemini 3.1 Pro",
          "limit": {
            "context": 1048576,
            "output": 65536
          },
          "modalities": {
            "input": ["text", "image", "pdf"],
            "output": ["text"]
          },
          "options": {
            "thinking": {
              "budgetTokens": 24576,
              "type": "enabled"
            }
          }
        }
      }
    }
  }
}

Grok

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "grok": {
      "options": {
        "baseURL": "https://codex-everywhere.com/v1",
        "apiKey": "<your-ce-api-key>"
      },
      "npm": "@ai-sdk/openai",
      "name": "Grok",
      "models": {
        "grok-4.6": {
          "name": "Grok 4.6",
          "limit": {
            "context": 1000000,
            "output": 128000
          }
        }
      }
    }
  }
}

DeepSeek

Use an API key assigned to a DeepSeek group.

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "deepseek": {
      "options": {
        "baseURL": "https://codex-everywhere.com/v1",
        "apiKey": "<your-ce-api-key>"
      },
      "npm": "@ai-sdk/openai-compatible",
      "name": "DeepSeek",
      "models": {
        "deepseek-flash": {
          "name": "DeepSeek Flash"
        }
      }
    }
  }
}