Skip to main content
opencode is a terminal coding agent. Lyceum plugs in as a custom provider.

Configure

Write this to ~/.config/opencode/opencode.json for every project, or opencode.json in a project root for one. Export your key, then start opencode:
opencode reads LYCEUM_API_KEY from the environment at launch. It does not load .env files, so put the export in ~/.zshrc or ~/.bashrc if you want it to persist.

Verify

opencode models lists what it resolved. Lyceum entries appear as lyceum/<model-id>:
Run a one-shot prompt without entering the TUI: opencode’s search tool is off for custom providers, so a Lyceum model reads pages with webfetch when you give it a URL. To let it search, add web_search_options to the options of each model. Lyceum runs the searches and the model answers with its sources:
opencode.json
Set it on the model, not on the provider. The model cites results as [1] and [2], and opencode doesn’t show the source links, so ask for the URLs in your prompt. Give any search tool you add yourself a name other than web_search. See Web search for options and pricing.

Notes

  • Context limits. Add "limit": { "context": 200000, "output": 131072 } to a model entry so opencode’s context compaction is accurate. Take each model’s context window from the models page. 131,072 is the most output Lyceum accepts per request, see request limits.
  • Default model. Without a top-level "model", opencode uses the last model you picked.