# Send Audio For Transcription — Gladia

> Sends audio to Gladia for transcription and optional translation. See the documentation

- Key: `gladia-send-audio-for-transcription`
- Type: Action (Write)
- Version: 1.0.3
- App: Gladia (`gladia`) — https://pipedream.com/apps/gladia.md
- This page (HTML): https://pipedream.com/apps/gladia/actions/send-audio-for-transcription
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/gladia/actions/send-audio-for-transcription/send-audio-for-transcription.mjs

## Description

Sends audio to Gladia for transcription and optional translation. [See the documentation](https://docs.gladia.io/reference/pre-recorded)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `audio` | `string` | Yes | Provide an audio file URL or a path to a file in the /tmp directory. |
| `toggleNoiseReduction` | `boolean` | No | Activate the noise reduction to improve transcription quality |
| `transcriptionHint` | `string` | No | Provide a custom vocabulary to the model to improve accuracy of transcribing context specific words, technical terms, names, etc. |
| `toggleDiarization` | `boolean` | No | Activate the diarization of the audio |
| `targetTranslationLanguage` | `string` | No | The target language for the direct translation. This parameter is only used when toggle_direct_translate is set to true. |
| `toggleDirectTranslate` | `boolean` | No | A boolean value indicating whether to perform direct translation. Set to true to use direct translation and false to disable direct translation. |
| `languageBehaviour` | `string` | No | Defines how the transcription model detects the audio language |
| `syncDir` | `dir` | No | SyncDir |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "gladia",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "gladia-send-audio-for-transcription",
  arguments: {
    audio: "Audio File or URL",
    toggleNoiseReduction: true,
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "gladia-send-audio-for-transcription",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    gladia: { authProvisionId: "apn_xxxxxxx" },
    audio: "Audio File or URL",
    toggleNoiseReduction: true,
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "gladia-send-audio-for-transcription",
    "configured_props": {
      "gladia": { "authProvisionId": "apn_xxxxxxx" },
      "audio": "Audio File or URL",
      "toggleNoiseReduction": true
    }
  }'
```

---

- App: https://pipedream.com/apps/gladia.md · All apps: https://pipedream.com/apps
