# Transcribe Audio — Palatine Speech

> Starts an asynchronous transcription job for an audio or video file. Optionally wait for completion by enabling the 'Wait for Completion' option. See the documentation

- Key: `palatine_speech-transcribe-audio`
- Type: Action (Write)
- Version: 0.0.3
- App: Palatine Speech (`palatine_speech`) — https://pipedream.com/apps/palatine-speech.md
- This page (HTML): https://pipedream.com/apps/palatine-speech/actions/transcribe-audio
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/palatine_speech/actions/transcribe-audio/transcribe-audio.mjs

## Description

Starts an asynchronous transcription job for an audio or video file. Optionally wait for completion by enabling the 'Wait for Completion' option. [See the documentation](https://docs.speech.palatine.ru/api-reference/transcribe/transcribe-polling-api/transcribe)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `filePath` | `string` | Yes | Provide either a file URL or a path to a file in the /tmp directory (for example, /tmp/myFile.mp3) |
| `model` | `string` | No | The speech recognition model to use |
| `fastInference` | `boolean` | No | Enable accelerated inference for faster processing |
| `waitForCompletion` | `boolean` | No | If enabled, the action will poll the task status until the transcription is complete before returning the result |
| `pollingInterval` | `integer` | No | Time to wait between status checks when waiting for completion. Only used if Wait for Completion is enabled. Defaults to 3 seconds if not specified. |
| `maxPollingAttempts` | `integer` | No | Maximum number of times to check the status before timing out. Only used if Wait for Completion is enabled. Defaults to 3 attempts if not specified. |
| `syncDir` | `dir` | Yes | 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": "palatine_speech",
      },
    },
  },
)

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: "palatine_speech-transcribe-audio",
  arguments: {
    filePath: "File Path or URL",
    model: "Recognition Model",
  },
})
```

**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: "palatine_speech-transcribe-audio",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    palatine_speech: { authProvisionId: "apn_xxxxxxx" },
    filePath: "File Path or URL",
    model: "Recognition Model",
  },
})

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": "palatine_speech-transcribe-audio",
    "configured_props": {
      "palatine_speech": { "authProvisionId": "apn_xxxxxxx" },
      "filePath": "File Path or URL",
      "model": "Recognition Model"
    }
  }'
```

---

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