Grok Voice Transcribe 2.0
xai/grok-voice-transcribe-2.0Turn a recording into text.
- second
- Price: $0.00002778
- Xai
- 5 min
Overview
Takes an audio recording and returns what was said as plain text. The audio is sent as base64 and the gateway builds the upload, so no multipart handling is needed on the caller's side. AgentSky currently limits each upload to 25 MB even though xAI accepts files up to 500 MB, so longer material must be split first. A language code skips detection and improves accuracy. Billing counts the seconds of audio as reported by xAI in its response; when xAI reports none, it falls back to the duration you declare, or to the length measured from the recording's WAV header.
The transcript text.
Input
These go in the input object of the run request.
| Field | Type | Required | Description |
|---|---|---|---|
| audio_base64 | base64 | Yes | The recording, base64-encoded. |
| filename | string | No | A name for the uploaded file, which sets its extension. |
| content_type | string | No | Media type of the recording. |
| duration_seconds | number | No | Length of the recording, used for billing only when xAI reports no duration of its own. |
| language | string | No | The spoken language as an ISO 639-1 code, such as en or ko. |
Requests up to 35 MB, audio up to 25 MB.
Example
Use your own API key and a saved idempotency key for each new job. Replace image or media placeholders with your own publicly reachable HTTPS URLs. Keep the same key and request body when recovering a timeout.
# Set once per job; reuse this key and the identical body after a timeout.
: "${AGENTSKY_IDEMPOTENCY_KEY:?Set a unique, saved key for this job}"
curl --fail-with-body https://gateway.agentsky.dev/v1/run \
-H "authorization: Bearer $AGENTSKY_API_KEY" \
-H "content-type: application/json" \
-H "Idempotency-Key: $AGENTSKY_IDEMPOTENCY_KEY" \
-d '{"provider":"xai","endpoint":"grok-voice-transcribe-2.0","input":{"audio_base64":"UklGRiQAAABXQVZFZm10IBAAAAABAAEA...","filename":"meeting.wav","content_type":"audio/wav","language":"en"}}'
# If status is READY/RUNNING, poll GET /v1/runs/{runId} with the same API key.Pricing
$0.00002778 per second using your plan when signed in. Read the final customer charge from price.amount.value after the run finishes. A RUNNING response is not the final bill.
