> This page is for Developer Documentation.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.benchling.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.benchling.com/_mcp/server.

# Benchling SDK Documentation

> **Info**
>
> ### Current Version: 1.24.1 (Latest)
>
> You are viewing the documentation for the latest version of the Benchling SDK.

The official Python SDK for [Benchling](https://benchling.com), providing programmatic access to the Benchling platform for life science R\&D.

## Getting Started

### Installation

```bash
pip install benchling-sdk
```

### Authentication

Choose one of these authentication methods:

**API Key Authentication:**

```python
from benchling_sdk.benchling import Benchling
from benchling_sdk.auth.api_key_auth import ApiKeyAuth

benchling = Benchling(
    url="https://your-tenant.benchling.com",
    auth_method=ApiKeyAuth("your_api_key_here")
)
```

**OAuth2 Authentication:**

```python
from benchling_sdk.benchling import Benchling
from benchling_sdk.auth.client_credentials_oauth2 import ClientCredentialsOAuth2

benchling = Benchling(
    url="https://your-tenant.benchling.com",
    auth_method=ClientCredentialsOAuth2(
        client_id="your_client_id",
        client_secret="your_client_secret"
    )
)
```

## Examples

For more, see [Common SDK Interactions and Examples](/docs/common-sdk-interactions-and-examples) and the additional code [Recipes](/recipes).

### Create a DNA Sequence

```python
from benchling_sdk.models import DnaSequenceCreate

# Create a new DNA sequence
sequence = DnaSequenceCreate(
    name="My DNA Sequence",
    bases="ATGCGATCGATCGATC",
    folder_id="lib_abc123"  # Your folder ID
)

created_sequence = benchling.dna_sequences.create(sequence)
print(f"Created sequence: {created_sequence.name} (ID: {created_sequence.id})")
```

### Get a Sequence by ID

```python
# Retrieve an existing sequence
sequence = benchling.dna_sequences.get_by_id("seq_abc123")
print(f"Sequence: {sequence.name}")
print(f"Bases: {sequence.bases}")
```

## Previous Versions

> **Tip**
>
> ### Need an Older Version?
>
> Previous SDK releases are listed in the sidebar.

Package contents:

* [benchling-sdk](/docs/webhooks/1.24.1/modules)
  * [benchling\_sdk package](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.html)
    * [Subpackages](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.html#subpackages)
      * [benchling\_sdk.apps package](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.apps.html)
      * [benchling\_sdk.auth package](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.auth.html)
      * [benchling\_sdk.docs package](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.docs.html)
      * [benchling\_sdk.helpers package](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.helpers.html)
      * [benchling\_sdk.models package](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.models.html)
      * [benchling\_sdk.services package](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.services.html)
    * [Submodules](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.html#submodules)
      * [benchling\_sdk.benchling module](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.benchling.html)
      * [benchling\_sdk.errors module](https://benchling.com/sdk-docs/1.24.1/benchling_sdk.errors.html)