---
title: "Generate a failed track again, without paying twice"
method: POST
path: "/api/x402/music/retry"
---

# Generate a failed track again, without paying twice

`POST /api/x402/music/retry`

## Request

- Base URL: `https://www.trezalabs.com`
- URL: `https://www.trezalabs.com/api/x402/music/retry`
- Auth: HTTP bearer

A track that failed after the payment settled charged nothing, so the payment is still on the wallet's balance. POST here with the failed run's claim ticket to try again on that balance, with the same settings it was sold with. Send {"prompt": "..."} to reword it (the fix for prompt_refused), or no body to use the original. Each failed run can be retried once. Waits and streams like the paid POST; "async": true or Prefer: respond-async answers at once (200, status running).

## Query parameters

- `runId` string, required
- `token` string, required

## Headers

- `Prefer` string

## Request body

- object
  - `prompt` string: A reworded input. Omit to use the original.
  - `async` boolean: true answers at once (200, status running) with a statusUrl to poll.

## Response `200`

The retry started and the response waited for it, streamed the same way as the paid POST. Same shape as the paid POST 200, plus retryOf and paidUsd 0.

## Other responses

- `400`: runId and token are required, or the prompt sent is empty or too long
- `402`: The wallet balance does not cover this retry; the body carries balanceUsd, priceUsd, and payUrl for a new paid request
- `403`: Invalid, expired, or mismatched token
- `404`: Run not found, or the ticket is not for a pay-per-call music run
- `409`: The run is still going, finished successfully, or has already been retried
- `429`: Rate limit exceeded
- `503`: Pay-per-call music is temporarily unavailable

---

[API](https://skmtc.dev/trezalabs/apis/treza-pipelines-api.md) · [All operations](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/revisions/a76574c1731b?raw)
