> ## Documentation Index
> Fetch the complete documentation index at: https://portkey-docs-add-third-party-integration-issues-fixes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deepgram

> Portkey provides a robust and secure gateway to use and observe Deepgrm's Speech-to-Text API.

Deepgram API is currently supported on Portkey's REST API, with support for Python & Node SDKs coming soon.

## Speech to Text API

* We set the target Deepgram API URL with the `x-portkey-custom-host` header
* We set the target provider as `openai` to let Portkey know that this request should be handled similarly to OpenAI

<Tabs>
  <Tab title="Local File">
    ```sh 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'
    ```
  </Tab>

  <Tab title="Remote File">
    ```sh 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"}'
    ```
  </Tab>
</Tabs>

<Card icon="link" title="Refer to Deepgram API docs for more info." href="https://developers.deepgram.com/reference/listen-file" />
