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

# Deepgram SDKs for Amazon SageMaker

Thank you for participating in the Deepgram on Amazon SageMaker SDK closed beta! This page will help you get started with our specialized SDKs designed specifically for Amazon SageMaker AI deployments.

## Overview

Deepgram provides native SDKs for Amazon SageMaker that simplify the process of integrating Deepgram's speech-to-text capabilities into your SageMaker-hosted applications. These SDKs handle the complexities of SageMaker's bidirectional streaming API, allowing you to focus on building your application.

## Prerequisites

Before using these SDKs, ensure you have:

* Completed the [Deepgram on Amazon SageMaker deployment](/docs/deploy-amazon-sagemaker)
* A running SageMaker Endpoint with Deepgram models
* AWS credentials configured with appropriate SageMaker permissions

## Choose Your SDK

Select the SDK that matches your development environment:

### JavaScript/TypeScript SDK

Perfect for Node.js applications and TypeScript projects.

* [JavaScript/TypeScript SDK](https://github.com/deepgram/deepgram-sagemaker-js-sdk)

**Quick Start:**

```bash
npm install https://github.com/deepgram/deepgram-sagemaker-js-sdk
```

### Python SDK

Ideal for data science workflows, machine learning pipelines, and Python applications.

* [Python SDK](https://github.com/deepgram/deepgram-sagemaker-python-sdk)

**Quick Start:**

```bash
pip install git+https://github.com/deepgram/deepgram-sagemaker-python-sdk
```

### Java SDK

For Java applications and JVM-based services. Uses a pluggable transport that slots into the standard Deepgram Java SDK.

* [Java SDK + SageMaker Transport](https://github.com/deepgram/deepgram-java-sdk-transport-sagemaker)

**Quick Start:**

Add both dependencies to your `build.gradle`:

```groovy
dependencies {
    implementation 'com.deepgram:deepgram-java-sdk:0.7.0'
    implementation 'com.deepgram:deepgram-sagemaker:0.1.0'
}
```

Or `pom.xml`:

```xml
<dependencies>
  <dependency>
    <groupId>com.deepgram</groupId>
    <artifactId>deepgram-java-sdk</artifactId>
    <version>0.2.1</version>
  </dependency>
  <dependency>
    <groupId>com.deepgram</groupId>
    <artifactId>deepgram-sagemaker</artifactId>
    <version>0.1.0</version>
  </dependency>
</dependencies>
```

## Key Features

All Deepgram SageMaker SDKs provide:

* **Simplified Authentication**: Automatic AWS credential handling
* **Bidirectional Streaming**: Native support for SageMaker's streaming API
* **Type Safety**: Strongly-typed interfaces for reliable development
* **Error Handling**: Built-in retry logic and error management
* **Audio Processing**: Helpers for common audio format conversions
* **Transcript Formatting**: Easy access to transcription results

## Basic Usage Example

**`TypeScript`**

```typescript TypeScript
import { createClient, createSagemakerWebSocketTransport, LiveTranscriptionEvents } from "@deepgram/sagemaker-sdk";

// Configuration - update these with your SageMaker endpoint details
const ENDPOINT_NAME = "your-endpoint-name"
const AWS_ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID;
const AWS_SECRET_ACCESS_KEY = process.env.AWS_SECRET_ACCESS_KEY;
const AWS_REGION = process.env.AWS_REGION;

async function transcribeAudio() {
  if (!AWS_ACCESS_KEY_ID || !AWS_SECRET_ACCESS_KEY || !AWS_REGION) {
    throw new Error("AWS credentials are not set");
  }
  const sagemakerWebSocketTransport = createSagemakerWebSocketTransport({
    endpointName: ENDPOINT_NAME,
    region: AWS_REGION,
    credentials: {
      accessKeyId: AWS_ACCESS_KEY_ID,
      secretAccessKey: AWS_SECRET_ACCESS_KEY,
      region: AWS_REGION
    }
  });

  const client = createClient("fake key because sagemaker doesn't use it", {
    global: {
      websocket: {
        client: sagemakerWebSocketTransport,
        options: {
          url: "wss://api.deepgram.com" // any placeholder works; we override internally
        }
      }
    }
  });

  console.log("Creating live transcription connection...");
  
  // Create live transcription connection
  const connection = client.listen.live({
    model: "nova-3",
    language: "multi",
  });

  connection.on(LiveTranscriptionEvents.Open, (data: any) => {
    console.log("Connection opened:", data);
    streamAudio();
  });
  
  connection.on(LiveTranscriptionEvents.Transcript, (data: any) => {
    // console.log("Transcript:", JSON.stringify(data, null, 2));
    console.log(data.channel.alternatives[0].transcript);
  });
  
  connection.on(LiveTranscriptionEvents.Metadata, (data: any) => {
    console.log("Metadata:", data);
  });
  
  connection.on(LiveTranscriptionEvents.Error, (error: any) => {
    console.error("Connection error:", error);
  });
  
  connection.on(LiveTranscriptionEvents.Close, (data: any) => {
    console.log("Connection closed:", data);
  });
```

**`Java`**

```java Java
import com.deepgram.DeepgramClient;
import com.deepgram.resources.listen.v1.websocket.V1ConnectOptions;
import com.deepgram.resources.listen.v1.websocket.V1WebSocketClient;
import com.deepgram.sagemaker.SageMakerConfig;
import com.deepgram.sagemaker.SageMakerTransportFactory;
import com.deepgram.types.ListenV1Model;
import java.util.concurrent.TimeUnit;

// Create the SageMaker transport factory
SageMakerConfig config = SageMakerConfig.builder()
    .endpointName("your-endpoint-name")
    .region("us-west-2")
    .build();
SageMakerTransportFactory factory = new SageMakerTransportFactory(config);

// Build the client with the SageMaker transport
DeepgramClient client = DeepgramClient.builder()
    .apiKey("unused")  // SageMaker uses AWS credentials, not Deepgram API keys
    .transportFactory(factory)
    .build();

// From here, the SDK works exactly like a standard Deepgram connection
V1WebSocketClient wsClient = client.listen().v1().v1WebSocket();

wsClient.onResults(result -> {
    if (result.getChannel() != null
            && result.getChannel().getAlternatives() != null
            && !result.getChannel().getAlternatives().isEmpty()) {
        String transcript = result.getChannel().getAlternatives().get(0).getTranscript();
        if (transcript != null && !transcript.isEmpty()) {
            System.out.println(transcript);
        }
    }
});

wsClient.onError(error -> System.err.println("Error: " + error.getMessage()));
wsClient.onDisconnected(reason -> System.out.println("Closed: " + reason.getCode()));

wsClient.connect(V1ConnectOptions.builder()
    .model(ListenV1Model.NOVA3)
    .build()
).get(10, TimeUnit.SECONDS);

// Stream audio data here:
// wsClient.sendMedia(okio.ByteString.of(audioChunk));
```

## Next Steps

1. **Choose your SDK** from the options above
2. **Visit the SDK repository** for detailed installation and usage instructions
3. **Review the API documentation** included in each SDK
4. **Join the community** for support and to share feedback

## Need Help?

As a closed beta participant, you have access to:

* **Direct Support**: Contact your Deepgram representative for assistance
* **Documentation**: Each SDK includes comprehensive guides and API references
* **Sample Applications**: Check each SDK repository for working examples
* **Community**: Connect with other beta testers

## Related Resources

* [Deploy Deepgram on Amazon SageMaker](/docs/deploy-amazon-sagemaker)
* [Using SDKs with Self-Hosted](/docs/using-sdks-with-self-hosted)
* [SDK Feature Matrix](/sdks/sdk-features)
* [Deepgram API Reference](/reference/deepgram-api-overview)

---

**Note**: This is a closed beta feature. The SDK repositories and documentation are evolving based on participant feedback. Please report any issues or suggestions to your Deepgram contact.