Skip to main content
skill

azure-ai-transcription-py — Claude Code skill for transcription

This skill guides Python development with Azure AI Transcription for batch jobs and live speech recognition. Use it when an app needs speaker labels or timestamps alongside the transcript.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add microsoft/skills --skill azure-ai-transcription-py -a claude-code
Open on GitHub

What azure-ai-transcription-py does

The skill covers the azure-ai-transcription SDK in both batch and streaming workflows. A batch job can transcribe audio from a storage URL, while a live session sends audio through TranscriptionClient and reads text from emitted events. Speaker diarization helps distinguish people in a recording; timestamps can support subtitle generation.

Install the azure-ai-transcription Python package and provide the resource address through TRANSCRIPTION_ENDPOINT. Authentication uses either TRANSCRIPTION_KEY or Microsoft Entra ID credentials. Clients should run inside context managers, and sync and async clients should not be mixed in the same call path. Without a valid endpoint and credentials, the client cannot connect.

What it helps with

  • Transcribe a long recording as a batch job
  • Read recognized text from a live audio stream
  • Separate transcript segments by speaker
  • Add timestamps for subtitle generation

Example prompts for the agent

  • Write Python code to transcribe audio.wav as an Azure AI Transcription batch job.
  • Show how to stream audio.wav and read text from transcription events.
  • Add speaker diarization and timestamps to the transcription example.

How to install azure-ai-transcription-py

1Skills CLI (Vercel)

npx skills add microsoft/skills --skill azure-ai-transcription-py -a claude-code

2Manually: put the files in place

~/.claude/skills/azure-ai-transcription-py/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/azure-ai-transcription-py/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about azure-ai-transcription-py

How do I install azure-ai-transcription-py in Claude Code?

Run npx skills add microsoft/skills --skill azure-ai-transcription-py -a claude-code. The skill file is at ~/.claude/skills/azure-ai-transcription-py/SKILL.md.

What does azure-ai-transcription-py do?

It guides Python code that uses Azure AI Transcription for batch and real-time speech recognition. The examples cover timestamps and separating speakers.

What do I need to connect to Azure AI Transcription?

Install azure-ai-transcription, set TRANSCRIPTION_ENDPOINT, and authenticate with TRANSCRIPTION_KEY or Microsoft Entra ID credentials.

Source text

SKILL.md · MIT
---
name: azure-ai-transcription-py
description: |
  Azure AI Transcription SDK for Python. Use for real-time and batch speech-to-text transcription with timestamps and diarization.
  Triggers: "transcription", "speech to text", "Azure AI Transcription", "TranscriptionClient".
license: MIT
metadata:
  author: Microsoft
  version: "1.0.0"
  package: azure-ai-transcription
---

# Azure AI Transcription SDK for Python

Client library for Azure AI Transcription (speech-to-text) with real-time and batch transcription.

## Installation

```bash
pip install azure-ai-transcription
```

## Environment Variables

```bash
TRANSCRIPTION_ENDPOINT=https://<resource>.cognitiveservices.azure.com
TRANSCRIPTION_KEY=<your-key>  # For key auth; not needed when using DefaultAzureCredential/TokenCredential
```

## Authentication & Lifecycle

> **🔑 Two rules apply to every code sample below:**
>
> 1. **Two auth modes are supported:** `AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"])` for key-based auth, or `DefaultAzureCredential()` / any `TokenCredential` for Entra ID. Prefer `DefaultAzureCredential` in production; never hardcode credentials in code.
> 2. **Wrap every client in a context manager** so HTTP transports and sockets are released deterministically:
>    - Sync: `with <Client>(...) as client:`
>    - Async: `async with <Client>(...) as client:`
>
> Snippets may abbreviate this setup, but production code should always follow both rules.

Use subscription key authentication:

```python
import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription import TranscriptionClient

with TranscriptionClient(
    endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
) as client:
    transcriptions = list(client.list_transcriptions())
```

## Transcription (Batch)

```python
import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription import TranscriptionClient

with TranscriptionClient(
    endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
) as client:
    job = client.begin_transcription(
        name="meeting-transcription",
        locale="en-US",
        content_urls=["https://<storage>/audio.wav"],
        diarization_enabled=True,
    )
    result = job.result()
    print(result.status)
```

## Transcription (Real-time)

```python
import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.transcription import TranscriptionClient

with TranscriptionClient(
    endpoint=os.environ["TRANSCRIPTION_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["TRANSCRIPTION_KEY"]),
) as client:
    stream = client.begin_stream_transcription(locale="en-US")
    stream.send_audio_file("audio.wav")
    for event in stream:
        print(event.text)
```

## Best Practices

1. **Pick sync OR async and stay consistent.** Do not mix `azure.xxx` sync clients with `azure.xxx.aio` async clients in the same call path. Choose one mode per module.
2. **Always use context managers for clients and async credentials.** Wrap every client in `with Client(...) as client:` (sync) or `async with Client(...) as client:` (async). For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up.
3. **Enable diarization** when multiple speakers are present
4. **Use batch transcription** for long files stored in blob storage
5. **Capture timestamps** for subtitle generation
6. **Specify language** to improve recognition accuracy
7. **Handle streaming backpressure** for real-time transcription
8. **Close transcription sessions** when complete

## Reference Files

| File | Contents |
|------|----------|
| [references/capabilities.md](references/capabilities.md) | Additional non-hero capabilities, operation-group coverage, and production checklists. |
| [references/non-hero-scenarios.md](references/non-hero-scenarios.md) | Dedicated non-hero examples for secondary/advanced scenarios. |

© Microsoft · MIT · microsoft/skills

Similar skills

All skills for Cloud: AWS, Azure, GCP →

From the same set143

The whole set →
azure-containerregistry-py This skill guides Python work with Azure Container Registry, covering repositories, images, manifests, and tags. Use it when building ACR tooling. 2installs azure-appconfiguration-py A skill that teaches the agent to work with Azure App Configuration from Python: read and write settings, toggle feature flags, take snapshots. 2installs azure-ai-vision-imageanalysis-py This skill guides Python work with Azure AI Vision Image Analysis, from OCR and object detection to captions and smart crops. Use it when building image-understanding features. 2installs azure-ai-translation-text-py A skill covering the Azure AI Translator Python SDK: text translation, transliteration, language detection and dictionary lookups. Useful when an app has to translate strings at runtime. 2installs azure-ai-textanalytics-py A skill that wires Azure AI Language into your Python code: sentiment, entities, key phrases, language detection, PII, and healthcare NLP. 2installs azure-ai-contentsafety-py This skill guides Python projects through Azure AI Content Safety for checking text and images. Use it when an app needs harmful-content moderation. 2installs azure-servicebus-dotnet Get .NET guidance for Azure Service Bus, from sending and receiving messages to background processing and dead-letter queues. 2installs azure-ai-openai-dotnet This skill guides .NET work with Azure OpenAI and OpenAI services, covering chat, embeddings, image generation, transcription, and assistants. 2installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor