Start or stop an agent session
agent_sessionStart or stop the executor for one hosted agent session in a project, for a platform whose sessions each bring their own environment. That is OpenAI's Agents API, so the project needs an openai environment connected. Call start right after your app creates the session, with the environment id and remote URL the session returned: the server wakes and the session's tool calls run in the project's folder. The executor stops when you call stop, or after max_minutes. Anthropic sessions need no call: they are picked up on their own.
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": {
"project_id": "<project_id>",
"action": "<action>"
},
"name": "agent_session"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | start or stop the session's executor. | |
| project_id | Yes | The project's id, as returned by create_project or list_projects. | |
| remote_url | No | start only: the remote URL the session returned for its executor to connect to. | |
| max_minutes | No | start only: stop the executor after this many minutes. Default 60, at most 360. | |
| environment_id | No | The session's environment id. Required for start; on stop, leave it out to stop every session in the project. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | What was asked. | |
| status | Yes | The executor is being started or stopped on the server. | |
| project_id | Yes | The project the session runs in. | |
| max_minutes | No | On start, when the executor stops on its own. null on stop. | |
| environment_id | No | The session's environment id. null when every session in the project is being stopped. |