v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1465766489.0 KB

Executes a command in a runtime session container and streams the output back to the caller. This operation allows you to run shell commands within the agent runtime environment and receive real-time streaming responses including standard output and standard error.

To invoke a command, you must specify the agent runtime ARN and a runtime session ID. The command execution supports streaming responses, allowing you to receive output as it becomes available through contentStart, contentDelta, and contentStop events.

To use this operation, you must have the bedrock-agentcore:InvokeAgentRuntimeCommand permission.

post/runtimes/{agentRuntimeArn}/commands

Path parameters

agentRuntimeArnstring required

The Amazon Resource Name (ARN) of the agent runtime on which to execute the command. This identifies the specific agent runtime environment where the command will run.

Query parameters

qualifierstring

The qualifier to use for the agent runtime. This is an endpoint name that points to a specific version. If not specified, Amazon Bedrock AgentCore uses the default endpoint of the agent runtime.

accountIdstring

The identifier of the Amazon Web Services account for the agent runtime resource. This parameter is required when you specify an agent ID instead of the full ARN for <code>agentRuntimeArn</code>.

Headers

Content-Typestring

The MIME type of the input data in the request payload. This tells the agent runtime how to interpret the payload data. Common values include application/json for JSON data.

Acceptstring

The desired MIME type for the response from the agent runtime command. This tells the agent runtime what format to use for the response data. Common values include application/json for JSON data.

X-Amzn-Bedrock-AgentCore-Runtime-Session-Idstring

The unique identifier of the runtime session in which to execute the command. This session ID is used to maintain state and context across multiple command invocations.

X-Amzn-Trace-Idstring

The trace identifier for request tracking.

traceparentstring

The parent trace information for distributed tracing.

tracestatestring

The trace state information for distributed tracing.

baggagestring

Additional context information for distributed tracing.

Request body

Response

Success

statusCodeinteger

The HTTP status code of the response. A status code of 200 indicates a successful operation. Other status codes indicate various error conditions.