---
title: "PUT /code-interpreters/{codeInterpreterIdentifier}/sessions/start"
method: PUT
path: "/code-interpreters/{codeInterpreterIdentifier}/sessions/start"
---

# PUT /code-interpreters/{codeInterpreterIdentifier}/sessions/start

`PUT /code-interpreters/{codeInterpreterIdentifier}/sessions/start`

Creates and initializes a code interpreter session in Amazon Bedrock AgentCore. The session enables agents to execute code as part of their response generation, supporting programming languages such as Python for data analysis, visualization, and computation tasks.

To create a session, you must specify a code interpreter identifier and a name. The session remains active until it times out or you explicitly stop it using the `StopCodeInterpreterSession` operation.

The following operations are related to `StartCodeInterpreterSession`:

*   [InvokeCodeInterpreter](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_InvokeCodeInterpreter.html)
    
*   [GetCodeInterpreterSession](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_GetCodeInterpreterSession.html)
    
*   [StopCodeInterpreterSession](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_StopCodeInterpreterSession.html)

## Path parameters

- `codeInterpreterIdentifier` string, required

## Headers

- `X-Amzn-Trace-Id` string
- `traceparent` string

## Request body

- object
  - `name` string — The name of the code interpreter session. This name helps you identify and manage the session. The name does not need to be unique.
  - `sessionTimeoutSeconds` integer — The duration in seconds (time-to-live) after which the session automatically terminates, regardless of ongoing activity. Defaults to 900 seconds (15 minutes). Recommended minimum: 60 seconds. Maximum allowed: 28,800 seconds (8 hours).
  - `certificates` Certificate[] — A list of certificates to install in the code interpreter session.
    - `location` object, required — The location of the certificate.
      - `secretsManager` object — The Amazon Web Services Secrets Manager location of the certificate.
        - `secretArn` string, required — The ARN of the Amazon Web Services Secrets Manager secret containing the certificate.
  - `clientToken` string — A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request, but does not return an error. This parameter helps prevent the creation of duplicate sessions if there are temporary network issues.

## Response `200`

Success

- StartCodeInterpreterSessionResponse
  - `codeInterpreterIdentifier` string, required — The identifier of the code interpreter.
  - `sessionId` string, required — The unique identifier of the created code interpreter session.
  - `createdAt` string, date-time, required — The time at which the code interpreter session was created.

## Other responses

- `480` — ServiceQuotaExceededException
- `481` — AccessDeniedException
- `482` — ConflictException
- `483` — ValidationException
- `484` — ResourceNotFoundException
- `485` — ThrottlingException
- `486` — InternalServerException

---

[API](https://skmtc.net/aws/apis/bedrock-agentcore.md) · [All operations](https://skmtc.net/aws/apis/bedrock-agentcore/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/bedrock-agentcore/versions/79623b33d495/schema)
