Skip to main content

Choose the model, or start a run, for Format transcript

Premium Intermediate

Format transcript sends a finished transcript to OpenAI’s Chat Completions API with gpt-4o-mini. To use another model for one show:

  • The run is in the background and reads the filter there. Only the request below starts one, never anything automatic: it is charged to the podcaster’s OpenAI account.
  • From an admin screen, with core’s nonce: POST …/shows/{show_id}/episodes/{episode_id}/transcript/format answers 202 { formatting: { state: 'queued', … } }; poll GET …/transcript and read transcript.formatting.state until it is complete or failed. The HTML lands in html_formatted (wp_kses_post()ed).
  • A correction or Replace clears the formatted version; format again afterwards.

Code

<?php
add_filter( 'benecaster_html_formatting_model', function ( string $model, int $episode_id ): string {
    return 12 === (int) get_post_field( 'post_parent', $episode_id ) ? 'gpt-4.1-mini' : $model;
}, 10, 2 );

View on GitHub →

Hooks Used

Need this built rather than just documented? See our services →