> ## Documentation Index
> Fetch the complete documentation index at: https://portkey-docs-chore-v2-11-2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deepgram

> Use Deepgram's Speech-to-Text API through Portkey for audio transcription.

Deepgram provides industry-leading speech-to-text capabilities. Portkey allows you to use Deepgram's API with full observability and reliability features.

<Note>
  Deepgram currently uses a custom host setup. SDK support is available through the custom host pattern.
</Note>

## Quick Start

Get started with Deepgram in under 2 minutes:

### Speech to Text - Local File

Transcribe audio from a local file:

```bash cURL theme={null}
curl https://api.portkey.ai/v1/listen \
  -H "Authorization: Token $DEEPGRAM_API_KEY" \
  -H "Content-Type: audio/mp3" \
  -H "x-portkey-custom-host: https://api.deepgram.com/v1" \
  -H "x-portkey-provider: openai" \
  -H "x-portkey-api-key: $PORTKEY_API_KEY" \
  --data-binary '@audio.mp3'
```

### Speech to Text - Remote File

Transcribe audio from a URL:

```bash cURL theme={null}
curl https://api.portkey.ai/v1/listen \
  -H "Authorization: Token $DEEPGRAM_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "x-portkey-custom-host: https://api.deepgram.com/v1" \
  -H "x-portkey-provider: openai" \
  -H "x-portkey-api-key: $PORTKEY_API_KEY" \
  -d '{"url": "https://dpgr.am/spacewalk.wav"}'
```

## Add Provider in Model Catalog

Before making requests, add Deepgram to your Model Catalog:

1. Go to [**Model Catalog → Add Provider**](https://app.portkey.ai/model-catalog/providers)
2. Select **Deepgram**
3. Enter your [Deepgram API key](https://console.deepgram.com/)
4. Set the custom host to `https://api.deepgram.com/v1`
5. Name your provider (e.g., `deepgram`)

<Card title="Complete Setup Guide" icon="book" href="/product/model-catalog">
  See all setup options and detailed configuration instructions
</Card>

***

## Using with Portkey SDK

You can also use Deepgram with the Portkey SDK using custom host configuration:

<CodeGroup>
  ```python Python theme={null}
  from portkey_ai import Portkey

  portkey = Portkey(
      api_key="PORTKEY_API_KEY",
      provider="openai",
      custom_host="https://api.deepgram.com/v1",
      Authorization="Token DEEPGRAM_API_KEY"
  )

  # Use with audio transcription
  # Note: Specific implementation depends on your use case
  ```

  ```javascript Node.js theme={null}
  import Portkey from 'portkey-ai';

  const portkey = new Portkey({
      apiKey: 'PORTKEY_API_KEY',
      provider: 'openai',
      customHost: 'https://api.deepgram.com/v1',
      Authorization: 'Token DEEPGRAM_API_KEY'
  });

  // Use with audio transcription
  // Note: Specific implementation depends on your use case
  ```
</CodeGroup>

***

## Deepgram Features

Deepgram offers advanced speech recognition capabilities:

* **Real-time Streaming**: Transcribe audio in real-time
* **Multiple Languages**: Support for 30+ languages
* **Custom Models**: Train custom models for domain-specific terminology
* **Diarization**: Identify different speakers in audio
* **Punctuation & Formatting**: Automatic punctuation and formatting

<Card icon="link" title="Deepgram API Documentation" href="https://developers.deepgram.com/reference/listen-file">
  Explore the complete Deepgram API documentation
</Card>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Gateway Configs" icon="sliders" href="/product/ai-gateway">
    Add retries and timeouts for audio processing
  </Card>

  <Card title="Observability" icon="chart-line" href="/product/observability">
    Monitor and trace your Deepgram requests
  </Card>

  <Card title="Custom Host Setup" icon="server" href="/product/ai-gateway/universal-api#integrating-local-or-private-models">
    Learn more about custom host configuration
  </Card>

  <Card title="Metadata" icon="tag" href="/product/observability/metadata">
    Add custom metadata to track audio sources
  </Card>
</CardGroup>

For complete SDK documentation:

<Card title="SDK Reference" icon="code" href="/api-reference/sdk/list">
  Complete Portkey SDK documentation
</Card>
