|
|
@@ -10325,6 +10325,189 @@
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
+ "/api/session/{sessionID}/agent": {
|
|
|
+ "post": {
|
|
|
+ "tags": ["sessions"],
|
|
|
+ "operationId": "v2.session.switchAgent",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "name": "sessionID",
|
|
|
+ "in": "path",
|
|
|
+ "schema": {
|
|
|
+ "type": "string",
|
|
|
+ "pattern": "^ses"
|
|
|
+ },
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "security": [],
|
|
|
+ "responses": {
|
|
|
+ "204": {
|
|
|
+ "description": "<No Content>"
|
|
|
+ },
|
|
|
+ "400": {
|
|
|
+ "description": "InvalidRequestError",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/components/schemas/InvalidRequestError"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "401": {
|
|
|
+ "description": "UnauthorizedError",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/components/schemas/UnauthorizedError"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "404": {
|
|
|
+ "description": "SessionNotFoundError",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "anyOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/components/schemas/SessionNotFoundError"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "$ref": "#/components/schemas/SessionNotFoundError"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "description": "Switch the agent used by subsequent session activity.",
|
|
|
+ "summary": "Switch session agent",
|
|
|
+ "requestBody": {
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "agent": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["agent"],
|
|
|
+ "additionalProperties": false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ "x-codeSamples": [
|
|
|
+ {
|
|
|
+ "lang": "js",
|
|
|
+ "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.switchAgent({\n ...\n})"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/session/{sessionID}/model": {
|
|
|
+ "post": {
|
|
|
+ "tags": ["sessions"],
|
|
|
+ "operationId": "v2.session.switchModel",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "name": "sessionID",
|
|
|
+ "in": "path",
|
|
|
+ "schema": {
|
|
|
+ "type": "string",
|
|
|
+ "pattern": "^ses"
|
|
|
+ },
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "security": [],
|
|
|
+ "responses": {
|
|
|
+ "204": {
|
|
|
+ "description": "<No Content>"
|
|
|
+ },
|
|
|
+ "400": {
|
|
|
+ "description": "InvalidRequestError",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/components/schemas/InvalidRequestError"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "401": {
|
|
|
+ "description": "UnauthorizedError",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/components/schemas/UnauthorizedError"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "404": {
|
|
|
+ "description": "SessionNotFoundError",
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "anyOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/components/schemas/SessionNotFoundError"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "$ref": "#/components/schemas/SessionNotFoundError"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "description": "Switch the model used by subsequent session activity.",
|
|
|
+ "summary": "Switch session model",
|
|
|
+ "requestBody": {
|
|
|
+ "content": {
|
|
|
+ "application/json": {
|
|
|
+ "schema": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "model": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "id": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "providerID": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "variant": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["id", "providerID"],
|
|
|
+ "additionalProperties": false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": ["model"],
|
|
|
+ "additionalProperties": false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ "x-codeSamples": [
|
|
|
+ {
|
|
|
+ "lang": "js",
|
|
|
+ "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.switchModel({\n ...\n})"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
"/api/session/{sessionID}/prompt": {
|
|
|
"post": {
|
|
|
"tags": ["sessions"],
|