---
title: "regenerate_turn"
description: "Regenerate a turn"
canonical: "https://poddub.com/docs/agents/tools/regenerate_turn"
last-updated: "2026-10-29"
---

# regenerate_turn

Regenerate a turn

Has poddub write one turn of the version under review again, inside the call, which can take up to about two minutes. Any member who can see the episode can use it, once they have accepted the provider list in the app. Every call counts against the episode's rewrites, even one that fails, and it never goes past them.

## What the server says

The description an agent is given, word for word. This tool makes changes.

> Have the model rewrite one turn of the version under review, inside this call (up to about two minutes). Each call is a recorded generation, counted even when it fails. Refused with consent_required until you have accepted the provider list in the app, with turn_regenerations_exhausted when this episode's or this billing period's single-turn rewrites are spent, and with generation_paused while poddub's operator has paused generation (nothing is counted; try again later).

## Input

| Field       | Type         | Required | What it takes                                                                                     |
| ----------- | ------------ | -------- | ------------------------------------------------------------------------------------------------- |
| `version`   | whole number | yes      | 1 or more                                                                                         |
| `episodeId` | text         | yes      | not empty; The episode's id, as list_episodes or create_episode answers it.                       |
| `index`     | whole number | yes      | 0 or more; The turn's index in the script's `turns`, from 0; turn 0 is the narrator's disclosure. |

## Refusals

A refusal comes back as the tool's result, marked as an error, with the code and what explains it.

| Code                           | What it means                                                                                                                                                    |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `consent_required`             | The key's person has not accepted the current list of providers poddub works with, or withdrew it. Only that person can accept it, in the app.                   |
| `episode_not_found`            | No such episode among the ones the person can see.                                                                                                               |
| `episode_state_conflict`       | The episode is not in a state that allows this: a script no longer in review, or a retry of an episode that has not failed. The refusal says the state it is in. |
| `script_version_conflict`      | The version named is not the latest, because the script changed since it was read. The refusal carries the latest version: read the script again.                |
| `turn_locked`                  | Turn 0 is the disclosure every episode opens with, and it cannot be changed.                                                                                     |
| `turn_not_found`               | The script has no turn at that index.                                                                                                                            |
| `generation_paused`            | poddub's operator has paused generation for now. Nothing was counted or charged. Try again later; reading, editing by hand and publishing still work.            |
| `plan_required`                | The organization has no plan. An owner chooses one in the app.                                                                                                   |
| `turn_regenerations_exhausted` | The rewrites of single turns are spent, for this episode or for the organization's billing period.                                                               |
| `generation_unavailable`       | poddub cannot write scripts right now. Try again later.                                                                                                          |
| `generation_failed`            | poddub tried and could not use what came back. The attempt counts, and the script stays as it was.                                                               |

Every tool can also answer `rate_limited` and `not_a_member`: see [Limits](/docs/agents/limits) and [Keys](/docs/agents/keys).
