Contents
On this page

Transcribe Episode - Plugixa Stream

POST /plugixa-stream/v1/admin/ai/episodes/{id}/transcribe

Turn an episode’s speech into a subtitle track in its spoken language, replacing an earlier track in that language.

Needs a user with the plugixa_stream_edit capability (signed in with an Application Password or the login cookie). Administrators hold it; other roles only when you grant it. Uses your OpenAI key; the episode’s video file is sent to OpenAI.

Note. The video must be a file the server can read or download, up to 25 MB. HLS-only sources need an MP4 rendition.

Request

POST https://your-site.example/wp-json/plugixa-stream/v1/admin/ai/episodes/2815/transcribe

Path parameters

Name Type Description
id integer The episode’s id

Request body

Content type: application/json

Field Type Required Description
language string No The spoken language. Defaults to the title’s spoken language; when none is set, it is detected and the track is saved as und.
{
  "language": "en"
}

Responses

201 Created. data is the new track.

{
  "success": true,
  "data": {
    "lang": "en",
    "label": "",
    "attachment_id": 3119,
    "source": "ai",
    "from": "",
    "url": "https://your-site.example/wp-content/uploads/2026/10/flash-gordon-ep-1.en.vtt"
  }
}
Field Type Meaning
data.lang string The track’s language
data.attachment_id integer The WebVTT file in the Media Library
data.source string ai
data.from string The language it was translated from; empty for a transcription
data.url string The file’s URL

Errors

Status Code When
401 / 403 plugixa_stream_forbidden The caller lacks the capability.
404 plugixa_stream_not_found No episode with that id.
422 plugixa_stream_ai_source The video cannot be read or downloaded, or it is over 25 MB. A failed download can also answer with WordPress’s own http_* code.
400 plugixa_stream_ai_setup No OpenAI key is saved.
422 plugixa_stream_ai_empty No speech was found.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-stream/v1/admin/ai/episodes/2815/transcribe" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"language":"en"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/ai/episodes/2815/transcribe');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'language' => 'en',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-stream/v1/admin/ai/episodes/2815/transcribe', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ language: 'en' }),
});
const { data } = await response.json();

Quick Links

Share