opencode_set_model
Change the AI model used by an active or idle OpenCode session. Specify a new model to apply it to subsequent prompts, optionally targeting a specific session instead of the default active one.
Instructions
Dynamically switches the AI model on an active or idle session for subsequent prompts.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>"
},
"name": "opencode_set_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | New model to use (e.g. 'google/antigravity-gemini-3.1-pro', 'opencode/deepseek-v4-flash-free', etc.). | |
| session_id | No | Session ID (defaults to active session). |