Endpoints
AI Script Writer API
Use the free AI script writer API to turn a brief into one or more moderated short-video scripts, then review the text before starting a paid render.
Keyword target: AI script writer API
The script endpoint creates short-video copy from a structured brief using the same moderated writer as the Reviral app. Writing is free; credits are charged only if the approved text is later submitted to a render or media-generation endpoint.
- Describe the topic, audience, offer, and desired action in prompt.
- Set durationSec and optional tone, format, media type, variant count, or supporting asset text.
- Review the returned script, then pass approved copy to the appropriate video endpoint.
Working example
Set REVIRAL_API_KEY only in your server environment, then run this request with values valid for your account.
curl -X POST "https://reviral.ai/api/v1/script" \
-H "Authorization: Bearer $REVIRAL_API_KEY" \
-H "Content-Type: application/json" \
--data '{"prompt":"Write a practical 30-second script showing three ways a travel mug prevents commuter spills.","durationSec":30,"tone":"conversational","variants":1,"wordsOnly":false,"assetBlocks":[]}'{
"data": {
"ok": true,
"script": {
"title": "The five-second bag test",
"voiceover": "Your commute should not begin with coffee inside your bag..."
},
"scripts": [
{
"title": "The five-second bag test",
"voiceover": "Your commute should not begin with coffee inside your bag..."
}
],
"promptVariant": null
}
}Frequently asked questions
- Does the script writer charge credits?
- No. Script writing is free. A later render request is priced and charged separately.
- Can the script endpoint return variants?
- Yes. Request one to three variants, then choose and edit the strongest result before rendering.
- Is script input moderated?
- Yes. The public endpoint uses the same validation and moderation path as the product writer.
/api/v1/script
Write a script
Uses the same moderated free script writer as the product.
Authentication: Bearer API key required
curl -X POST "https://reviral.ai/api/v1/script" \
-H "Authorization: Bearer $REVIRAL_API_KEY" \
-H "Content-Type: application/json" \
--data '{"prompt":"Write a practical 30-second script showing three ways a travel mug prevents commuter spills.","durationSec":30,"tone":"conversational","variants":1,"wordsOnly":false,"assetBlocks":[]}'Request body
| Field | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | — |
| durationSec | integer (min 15, max 120) | No | — |
| tone | string | No | — |
| scriptFormat | string | No | — |
| mediaType | string | No | — |
| variants | integer (min 1, max 3) | No | — |
| wordsOnly | boolean | No | — |
| assetBlocks | array | No | — |
Responses
- 200
- Script response
- 400
- Settings are invalid or a reference field is unsupported
- 401
- Key is missing, revoked, or invalid
- 422
- Settings are invalid or a reference field is unsupported
- 429
- Too many requests
- 500
- Job could not be started
- 503
- Models or rate limiting are temporarily unavailable