# Create Transcription — OpenAI (ChatGPT)

> Transcribes audio into the input language. See the documentation

- Key: `openai-create-transcription`
- Type: Action (Write)
- Version: 0.3.6
- App: OpenAI (ChatGPT) (`openai`) — https://pipedream.com/apps/openai.md
- This page (HTML): https://pipedream.com/apps/openai/actions/create-transcription
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/openai/actions/create-transcription/create-transcription.mjs

## Description

Transcribes audio into the input language. [See the documentation](https://platform.openai.com/docs/api-reference/audio/createTranscription)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `file` | `string` | Yes | The file to process. Provide either a file URL or a path to a file in the /tmp directory (for example, /tmp/myFile.txt). See the Assistants Tools guide to learn more about the types of files supported. The Fine-tuning API only supports .jsonl files. |
| `model` | `string` | Yes | ID of the model to use |
| `include` | `string[]` | No | Additional information to include in the transcription response. logprobs will return the log probabilities of the tokens in the response to understand the model's confidence in the transcription. logprobs only works with response_format set to json and only with the models gpt-4o-transcribe and gpt-4o-mini-transcribe. |
| `language` | `string` | No | The language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency. |
| `prompt` | `string` | No | An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language. |
| `response_format` | `string` | No | The format of the output. For gpt-4o-transcribe and gpt-4o-mini-transcribe, the only supported format is json. |
| `temperature` | `string` | No | The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. |
| `timestamp_granularities` | `string[]` | No | The timestamp granularities to populate for this transcription. response_format must be set verbose_json to use timestamp granularities. Either or both of these options are supported: word, or segment. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. |
| `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": "openai",
      },
    },
  },
)

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: "openai-create-transcription",
  arguments: {
    file: "File Path or URL",
    model: "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: "openai-create-transcription",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    openai: { authProvisionId: "apn_xxxxxxx" },
    file: "File Path or URL",
    model: "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": "openai-create-transcription",
    "configured_props": {
      "openai": { "authProvisionId": "apn_xxxxxxx" },
      "file": "File Path or URL",
      "model": "Model"
    }
  }'
```

---

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