Skip to main content

Transcription API

The Transcription API uses AI to transcribe audio and video content. It converts spoken content into text that you can use for captions, subtitles, repurposing into text posts, or any other text-based workflow.

Transcribe Media

Submit an audio or video file for AI transcription.
POST /v1/ai/transcribe
Transcription consumes AI credits from your account balance. The number of credits debited depends on the duration of the media. Check your credit balance in the Soku dashboard under Account > Credits.

Headers

HeaderRequiredDescription
Content-TypeYesMust be application/json
soku-api-keyYesYour Soku API key
Idempotency-KeyNoA unique string to prevent duplicate transcription jobs. If you send the same Idempotency-Key within a reasonable time window, the API returns the original result instead of creating a new job.

Request Body

FieldTypeRequiredDescription
mediaIdstringYesThe ID of the media file to transcribe. This must be a media file already uploaded to the Soku media library.
languagestringNoThe language of the audio content as an ISO 639-1 code (for example, "en", "es", "fr"). Defaults to auto-detection if omitted.
modelstringNoThe transcription model to use. Currently supported: "whisper-1". Defaults to "whisper-1".
durationSecondsnumberNoThe duration of the media in seconds. Providing this helps the API estimate credit cost before processing.

Response

FieldTypeDescription
jobIdstringA unique identifier for the transcription job
transcriptstringThe transcribed text content
creditsDebitednumberThe number of AI credits consumed by this transcription
likelyLyricsbooleanWhether the AI detected that the audio content is likely song lyrics rather than speech
{
  "jobId": "tj_a1b2c3d4-e5f6-7890",
  "transcript": "Welcome to today's episode. We are going to talk about building an audience on social media from scratch.",
  "creditsDebited": 10,
  "likelyLyrics": false
}

Examples

Basic transcription

curl -X POST https://api.mysoku.io/v1/ai/transcribe \
  -H "Content-Type: application/json" \
  -H "soku-api-key: sk_live_your_api_key_here" \
  -d '{
    "mediaId": "media_f7e8d9c0b3c4",
    "language": "en",
    "model": "whisper-1"
  }'
Response:
{
  "jobId": "tj_d4e5f6a7-b8c9-0123",
  "transcript": "Welcome to today's episode. We are going to talk about building an audience on social media from scratch.",
  "creditsDebited": 10,
  "likelyLyrics": false
}

Transcription with idempotency

Use the Idempotency-Key header to prevent duplicate charges if you need to retry a request:
curl -X POST https://api.mysoku.io/v1/ai/transcribe \
  -H "Content-Type: application/json" \
  -H "soku-api-key: sk_live_your_api_key_here" \
  -H "Idempotency-Key: unique-request-id-abc123" \
  -d '{
    "mediaId": "media_f7e8d9c0b3c4",
    "language": "en",
    "model": "whisper-1",
    "durationSeconds": 120
  }'
If you send the same request with the same Idempotency-Key, you receive the original result without being charged again.

Transcription with duration estimate

Providing durationSeconds helps the API estimate the credit cost:
curl -X POST https://api.mysoku.io/v1/ai/transcribe \
  -H "Content-Type: application/json" \
  -H "soku-api-key: sk_live_your_api_key_here" \
  -d '{
    "mediaId": "media_a1b2c3d4e5f6",
    "language": "es",
    "model": "whisper-1",
    "durationSeconds": 300
  }'

Transcribe and publish as a text post

A common workflow is to transcribe a video, then publish the transcript as a text post:
# Step 1: Transcribe the video
TRANSCRIPT=$(curl -s -X POST https://api.mysoku.io/v1/ai/transcribe \
  -H "Content-Type: application/json" \
  -H "soku-api-key: sk_live_your_api_key_here" \
  -d '{
    "mediaId": "media_f7e8d9c0b3c4",
    "language": "en"
  }' | jq -r '.transcript')

# Step 2: Publish the transcript as a text post
curl -X POST https://api.mysoku.io/v1/posts \
  -H "Content-Type: application/json" \
  -H "soku-api-key: sk_live_your_api_key_here" \
  -d "{
    \"post\": {
      \"content\": {
        \"text\": \"$TRANSCRIPT\",
        \"mediaType\": \"text\",
        \"platform\": [\"threads\", \"linkedin\"]
      }
    }
  }"

Credit Costs

Transcription costs vary based on the duration of the media file. Credits are debited from your account balance when the transcription completes. The creditsDebited field in the response tells you exactly how many credits were consumed.
Monitor your credit balance in the Soku dashboard under Account > Credits. For information on credit pricing and how to purchase more credits, see Credits System.

Idempotency

The Idempotency-Key header is strongly recommended for transcription requests. Because transcription consumes credits, accidental duplicate requests can result in unnecessary charges. How it works:
  1. Include an Idempotency-Key header with a unique value (for example, a UUID) on your first request.
  2. If the request succeeds, the API caches the result keyed by your idempotency key.
  3. If you retry with the same Idempotency-Key, the API returns the cached result without processing the transcription again or charging additional credits.
# Both requests return the same result; credits are only charged once
curl -X POST https://api.mysoku.io/v1/ai/transcribe \
  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
  ...

curl -X POST https://api.mysoku.io/v1/ai/transcribe \
  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
  ...

Error Responses

HTTP StatusError CodeDescription
400validation_errorMissing or invalid mediaId or other fields
401unauthorizedMissing or invalid API key
402insufficient_creditsYour account does not have enough AI credits for this transcription
403forbiddenSubscription is not active
404not_foundThe specified mediaId does not exist in your media library
429rate_limit_exceededToo many requests. See Rate Limits.
500internal_errorAn error occurred during transcription processing
Example error response (insufficient credits):
{
  "error": {
    "code": "insufficient_credits",
    "message": "Your account does not have enough AI credits to complete this transcription. Estimated cost: 15 credits. Current balance: 3 credits.",
    "timestamp": "2026-02-28T12:00:00.000Z",
    "requestId": "req_abc123def456",
    "details": {
      "estimatedCost": 15,
      "currentBalance": 3
    }
  }
}

Next Steps

TopicDescription
Posts APIPublish transcribed content as posts
Media APIUpload media for transcription
Credits SystemManage your AI credit balance
AI TranscriptionUsing transcription in the dashboard