{"command":{"effect":"write","timeoutSeconds":120,"inputSchema":{"type":"object","description":"Submits message, cancellation, tool-result, or computer-use approval-response events to a managed agent session. Cancellation can recover a still-open turn whose backend execution has ended by marking it cancelled and abandoning unpublished outputs. Saved results, published files, and existing terminal outcomes are preserved. HTTP 202 confirms acceptance, not durable completion. See [session events](https://developers.openai.com/api/docs/guides/agents-api/sessions/events).","properties":{"path":{"type":"object","properties":{"session_id":{"type":"string","minLength":0,"maxLength":1048576,"description":"The ID of the session."}},"required":["session_id"],"additionalProperties":false},"headers":{"type":"object","properties":{"Idempotency-Key":{"type":"string","minLength":1,"maxLength":256,"description":"An optional client-generated key that makes retries of submitted messages idempotent."}},"required":[],"additionalProperties":false},"body":{"$ref":"#/definitions/CreateSessionEventsParams"}},"required":["path"],"additionalProperties":false,"definitions":{"CreateSessionEventsParams":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/definitions/SessionInputParam"},"minItems":0,"maxItems":16384,"description":"The input events to submit to the session."}},"required":["events"],"additionalProperties":false,"description":"Input events submitted to an existing session."},"SessionInputParam":{"oneOf":[{"$ref":"#/definitions/SessionInputParamAgentSessionInputComputerUseApprovalRequestResult"},{"$ref":"#/definitions/SessionInputParamAgentSessionInputMessage"},{"$ref":"#/definitions/SessionInputParamAgentSessionInputCancel"},{"$ref":"#/definitions/SessionInputParamAgentSessionInputToolResult"}],"description":"Input submitted to an existing session."},"SessionInputParamAgentSessionInputComputerUseApprovalRequestResult":{"type":"object","properties":{"type":{"type":"string","enum":["agent.session.input.computer_use_approval_request_result"],"default":"agent.session.input.computer_use_approval_request_result","description":"The type of the object. Always `agent.session.input.computer_use_approval_request_result`."},"request_id":{"type":"string","minLength":0,"maxLength":1048576,"description":"The registered request ID from the required action."},"response":{"$ref":"#/definitions/ComputerUseApprovalResponseParam"}},"required":["type","request_id","response"],"additionalProperties":false,"description":"Responds to a pending Computer Use approval request."},"SessionInputParamAgentSessionInputMessage":{"type":"object","properties":{"type":{"type":"string","enum":["agent.session.input.message"],"default":"agent.session.input.message","description":"The type of the object. Always `agent.session.input.message`."},"input":{"type":"array","items":{"$ref":"#/definitions/InputMessageParam"},"minItems":0,"maxItems":16384,"description":"The user messages to add to the session."}},"required":["type","input"],"additionalProperties":false,"description":"Adds one or more user messages and starts a turn."},"SessionInputParamAgentSessionInputCancel":{"type":"object","properties":{"type":{"type":"string","enum":["agent.session.input.cancel"],"default":"agent.session.input.cancel","description":"The type of the object. Always `agent.session.input.cancel`."}},"required":["type"],"additionalProperties":false,"description":"Cancels the session's active turn."},"SessionInputParamAgentSessionInputToolResult":{"type":"object","properties":{"type":{"type":"string","enum":["agent.session.input.tool_result"],"default":"agent.session.input.tool_result","description":"The type of the object. Always `agent.session.input.tool_result`."},"turn_id":{"type":"string","minLength":0,"maxLength":1048576,"description":"The ID of the turn that requested the function call."},"call_id":{"type":"string","minLength":0,"maxLength":1048576,"description":"The ID of the function call."},"success":{"type":"boolean","description":"Whether the function call succeeded."},"output":{"anyOf":[{"$ref":"#/definitions/FunctionCallOutputParam"},{"type":"null"}],"description":"The function result when the call succeeded."},"error":{"type":["string","null"],"minLength":0,"maxLength":1048576,"description":"The error message when the call failed."}},"required":["type","turn_id","call_id","success"],"additionalProperties":false,"description":"Submits the result of a function call."},"ComputerUseApprovalResponseParam":{"oneOf":[{"$ref":"#/definitions/ComputerUseApprovalResponseParamBrowserAuthentication"},{"$ref":"#/definitions/ComputerUseApprovalResponseParamBrowserOriginAccessParam"}]},"InputMessageParam":{"type":"object","properties":{"type":{"type":"string","enum":["message"],"default":"message","description":"The type of the input item. Always `message`."},"role":{"type":"string","enum":["user"],"default":"user","description":"The role of the message author. Always `user`."},"content":{"type":"array","items":{"$ref":"#/definitions/InputContentParam"},"minItems":0,"maxItems":16384,"description":"The content of the message."}},"required":["role","content"],"additionalProperties":false,"description":"A user message submitted to a session."},"FunctionCallOutputParam":{"oneOf":[{"type":"string","minLength":0,"maxLength":1048576},{"type":"array","items":{"$ref":"#/definitions/InputContentParam"},"minItems":0,"maxItems":16384}],"description":"A function result represented as text or supported model-input content."},"ComputerUseApprovalResponseParamBrowserAuthentication":{"oneOf":[{"$ref":"#/definitions/ComputerUseApprovalResponseParamBrowserAuthenticationSubmitParam"},{"$ref":"#/definitions/ComputerUseApprovalResponseParamBrowserAuthenticationCancelParam"}],"properties":{"type":{"type":"string","enum":["browser_authentication"]}},"required":["type"]},"ComputerUseApprovalResponseParamBrowserOriginAccessParam":{"type":"object","properties":{"type":{"type":"string","enum":["browser_origin_access"],"default":"browser_origin_access"},"decision":{"$ref":"#/definitions/BrowserOriginAccessDecisionParam"}},"required":["type","decision"],"additionalProperties":false},"InputContentParam":{"oneOf":[{"$ref":"#/definitions/InputContentParamInputText"},{"$ref":"#/definitions/InputContentParamInputImage"}],"description":"Content included in an input message."},"ComputerUseApprovalResponseParamBrowserAuthenticationSubmitParam":{"type":"object","properties":{"type":{"type":"string","enum":["browser_authentication"],"default":"browser_authentication"},"action":{"type":"string","enum":["submit"],"default":"submit"},"fields":{"type":"array","items":{"$ref":"#/definitions/BrowserAuthenticationFieldValueParam"},"minItems":0,"maxItems":6,"description":"Values for up to six active fields in the required action. The submitted field-value mapping and selected option must fit within 120 KiB of JSON."},"selected_option":{"type":["string","null"],"minLength":0,"maxLength":1048576,"description":"The chosen method. Required when the required action contains options."}},"required":["type","action","fields"],"additionalProperties":false},"ComputerUseApprovalResponseParamBrowserAuthenticationCancelParam":{"type":"object","properties":{"type":{"type":"string","enum":["browser_authentication"],"default":"browser_authentication"},"action":{"type":"string","enum":["cancel"],"default":"cancel"}},"required":["type","action"],"additionalProperties":false},"BrowserOriginAccessDecisionParam":{"type":"string","enum":["approve","deny","cancel"],"description":"The user's decision for a browser origin access request."},"InputContentParamInputText":{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"default":"input_text","description":"The type of the object. Always `input_text`."},"text":{"type":"string","minLength":0,"maxLength":1048576,"description":"The text sent to the model."}},"required":["type","text"],"additionalProperties":false,"description":"Text input to the model."},"InputContentParamInputImage":{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"default":"input_image","description":"The type of the object. Always `input_image`."},"image_url":{"type":"string","minLength":0,"maxLength":1048576,"description":"The URL of the image sent to the model."}},"required":["type","image_url"],"additionalProperties":false,"description":"Image input to the model."},"BrowserAuthenticationFieldValueParam":{"type":"object","properties":{"field_id":{"type":"string","minLength":0,"maxLength":1048576,"description":"The field ID from the required action."},"value":{"type":"string","minLength":0,"maxLength":16384,"description":"The value to enter into the registered control."}},"required":["field_id","value"],"additionalProperties":false,"description":"One user-entered value, including non-password fields such as an email address."}}},"name":"Create agent session input events","id":"openai.createagentsessionevents","example":{"path":{"session_id":"example"}},"maxRequests":1,"summary":false}}