opencode
opencode reaches Inferray through its OpenAI-compatible provider adapter. You declare the provider once in config, list the models you want, and they show up in the /models picker.
Add the provider
Put this in opencode.json — either ~/.config/opencode/opencode.json for every project, or a project-local opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"inferray": {
"npm": "@ai-sdk/openai-compatible",
"name": "Inferray",
"options": {
"baseURL": "https://api.inferray.com/v1",
"apiKey": "{env:INFERRAY_API_KEY}"
},
"models": {
"claude-opus-4-8": {
"name": "Claude Opus 4.8",
"limit": { "context": 1000000, "output": 64000 }
},
"gpt-5.5": {
"name": "GPT-5.5",
"limit": { "context": 1100000, "output": 128000 }
}
}
}
}
}
{env:INFERRAY_API_KEY} reads the key from the environment, so the config file stays safe to commit:
export INFERRAY_API_KEY="inferray_..."
@ai-sdk/openai-compatible sends Chat Completions requests, which is the right default. @ai-sdk/openai targets the Responses API instead — Inferray serves that too, so either works; pick the compatible adapter unless you specifically want Responses.
List the models you want
Every entry under models becomes an option in the picker. The key is the model id exactly as Inferray serves it; the name is only a display label. Add as many as you like from the catalogue, and check each one's context window and max output on its model page so the limit values match.
Because the models are declared here, opencode never asks the API what exists, so this list is exactly what you see in the picker.
Use it
Run opencode, then /models, and pick an Inferray entry. To make one the default, set it in your config:
{
"model": "inferray/claude-opus-4-8"
}
The id is provider/model, using the provider key you chose above.