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.
npx skills add microsoft/skills --skill azure-ai-transcription-py -a claude-codeWhat 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.wavas an Azure AI Transcription batch job. - Show how to stream
audio.wavand 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-code2Manually: put the files in place
~/.claude/skills/azure-ai-transcription-py/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/azure-ai-transcription-py/
Manually: put the files in place
.agents/skills/azure-ai-transcription-py/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/azure-ai-transcription-py/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install microsoft/skills azure-ai-transcription-py2Manually: put the files in place
.github/skills/azure-ai-transcription-py/SKILL.mdPlatform CLI
gemini skills install https://github.com/microsoft/skills --path .github/plugins/azure-sdk-python/skills/azure-ai-transcription-pyManually: put the files in place
.devin/skills/azure-ai-transcription-py/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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