Skip to content
OpenCode
Esc
navigateopen⌘Jpreview

Switch session model

Switch the model used by subsequent provider turns.

POST/api/session/{sessionID}/model
Path parameters
sessionIDobjectrequired
Request body
requiredapplication/json
modelModel.Refrequired
Show properties
idstringrequired
providerIDstringrequired
variantstring
Responses
204<No Content>
400InvalidRequestError
_tagstringrequired
Allowed:InvalidRequestError
messagestringrequired
kindstring | any
Show properties
Any of:
string
string
any
any
fieldstring | any
Show properties
Any of:
string
string
any
any
401UnauthorizedError
_tagstringrequired
Allowed:UnauthorizedError
messagestringrequired
404SessionNotFoundError
Any of:
SessionNotFoundError
_tagstringrequired
Allowed:SessionNotFoundError
sessionIDstringrequired
messagestringrequired
SessionNotFoundError
_tagstringrequired
Allowed:SessionNotFoundError
sessionIDstringrequired
messagestringrequired
Request
curl -X POST "/api/session/%5Bobject%20Object%5D/model" \
  -H "Content-Type: application/json" \
  -d '{
  "model": {
    "id": "string",
    "providerID": "string",
    "variant": "string"
  }
}'
Response
<No Content>