Reserve credits for a bundle
const url = 'https://api.braiv.co/v1/videos/vid_01JZ8M6A/reservations';const options = { method: 'POST', headers: { 'Idempotency-Key': 'import-launch-demo-20260901', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"durationSeconds":184,"captionLanguageCodes":["es","fr"],"shorts":{"kind":"promo","includeSoundtrack":true}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.braiv.co/v1/videos/vid_01JZ8M6A/reservations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: import-launch-demo-20260901' \ --data '{ "durationSeconds": 184, "captionLanguageCodes": [ "es", "fr" ], "shorts": { "kind": "promo", "includeSoundtrack": true } }'Atomically debits the full quoted bundle into escrow. Pass reservation and line-item IDs to supported product creation calls. Required scope: videos:write.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Braiv library video document ID.
Example
vid_01JZ8M6AHeader Parameters
Section titled “Header Parameters ”Caller-generated key for safe POST retries. The API retains the first
JSON response for 24 hours. Reusing a key with another path or body
returns 409 IDEMPOTENCY_REPLAY.
Example
import-launch-demo-20260901Request Body
Section titled “Request Body ”At least one billable action is required.
object
Settled billing duration; otherwise resolved from the source video.
Dubs included in the quote or reservation.
object
Dubbing product to price.
Target languages priced separately.
Caption translation languages to price.
Reserve source transcription as a standalone action.
Shorts-family bundle to price.
object
Shorts-family product to price:
shorts prices short highlights, promo prices one promotional
edit, and clips prices long-form excerpts.
Number of clips priced; defaults to one.
Affects clip pricing and subscriber rebates.
Pricing hint consumed by the bundle pricer.
Adds the promo soundtrack product.
Adds generated thumbnail pricing to each long clip.
Zero-prompt thumbnail bundle to price.
object
Only true creates thumbnail line items.
Additional catalog products used as references.
Character reference slots added to pricing.
Thumbnail translation languages priced individually.
Adds the content-moment-detect line item. Set this when the
generation recipe uses Precision autoDetectContentReferences.
Quote field name stays autoDetectContentMoments for pricing.
Example
{ "durationSeconds": 184, "captionLanguageCodes": [ "es", "fr" ], "shorts": { "kind": "promo", "includeSoundtrack": true }}Responses
Section titled “ Responses ”Credits reserved and line items created.
object
Escrow identifier supplied to product requests.
Total credits moved into escrow.
Settled duration used to reserve credits.
Escrow lines consumed by matching product actions.
object
Billable action consumed by downstream work.
Internal catalog product used for pricing.
Language charged by this line
Exact credits quoted or reserved.
Human-readable line-item summary.
Escrow line item passed to the matching create operation.
Example
{ "reservationId": "rsv_01JZ9A", "total": 132, "durationSeconds": 184, "lineItems": [ { "lineItemId": "li_01", "actionKey": "captions", "product": "translate-captions-only", "targetLanguageCode": "es", "credits": 46 }, { "lineItemId": "li_02", "actionKey": "promo", "product": "promo", "credits": 40 } ]}Request fields are missing, malformed, out of bounds, or mutually inconsistent.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "INVALID_ARGUMENT", "message": "The request contains invalid or missing fields.", "details": {} }}A supported authentication header is missing or contains an invalid Public API key.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Examples
Authentication header missing
{ "error": { "code": "UNAUTHENTICATED", "message": "Missing API key.", "details": {} }}API key invalid
{ "error": { "code": "INVALID_API_KEY", "message": "Invalid API key", "details": {} }}Authentication succeeded, but the required scope, workspace role, or resource permission is missing.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Examples
{ "error": { "code": "INSUFFICIENT_SCOPE", "message": "The API key lacks the required scope.", "details": {} }}The resource does not exist or is not accessible to the caller.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "NOT_FOUND", "message": "Resource not found.", "details": {} }}The Idempotency-Key was reused with a different path or request body.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "IDEMPOTENCY_REPLAY", "message": "Idempotency-Key was reused with a different request.", "details": { "pathMatch": true, "hashMatch": false } }}Media duration is unknown for duration-priced work.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "UNAUTHENTICATED" }}The account has insufficient credits, or the request exceeded a rate limit.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "INSUFFICIENT_CREDITS", "message": "Not enough credits.", "details": { "required": 60, "available": 20, "shortfall": 40 } }}An unexpected server error occurred.
object
Structured public API error envelope.
object
Stable machine-readable error code.
Human-readable error summary.
Machine-readable operation-specific context; empty when unavailable.
object
Example
{ "error": { "code": "INTERNAL", "message": "An unexpected error occurred.", "details": {} }}