Querying the file with jq
I believe this query finds all providers:
$ jq -r 'keys[]' ~/.cache/opencode/models.json | grep open
openai
opencode
opencode-go
openrouter
This seems to find all models of a given provider (here: openrouter):
$ jq -r '.openrouter.models | keys[]' ~/.cache/opencode/models.json
aion-labs/aion-2.0
aion-labs/aion-3.0
aion-labs/aion-3.0-mini
aion-labs/aion-rp-llama-3.1-8b
allenai/olmo-3-32b-think
‥
Show details of a given model of a provider:
$ jq '.openrouter.models."stealth/ox-alpha"' ~/.cache/opencode/models.json
Which providers offer stealth/ox-alpha?
$ jq -r 'paths | select(.[-1] == "stealth/ox-alpha") | .[0]' ~/.cache/opencode/models.json
nano-gpt
openrouter
kilo