Skip to content
Video and audio3 min

Generate video and speech

Make short video clips charged per second and speech charged per 1,000 characters, and work out the cost before you send.

You need

  • A Tovano API key in TOVANO_API_KEY
  • a way to receive webhooks or poll tasks

Video and speech models run as tasks, like images. The difference is the unit: video is charged per second of output and speech per 1,000 characters of input text.

ModelUnitPrice
video/demo-1second$0.100 / second
audio/demo-tts-11K characters$0.030 / 1K characters

Video

Inputs

FieldTypeDefaultNotes
promptstringRequired. What happens in the clip
durationinteger5Length in seconds, 1 to 10. This is what you are charged for
aspect_ratiostring16:916:9, 9:16 or 1:1

Create a clip

curl https://api.tovano.ai/v1/tasks \
  -H "Authorization: Bearer $TOVANO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "video/demo-1",
    "input": { "prompt": "Slow push-in on a cup of coffee, steam rising", "duration": 5, "aspect_ratio": "9:16" },
    "webhook_url": "https://example.com/hooks/tovano"
  }'

A five-second clip reserves and then charges $0.500. Video takes longer than images, so a webhook is the better way to wait.

The result

{
  "status": "completed",
  "output": {
    "video": {
      "url": "https://files.tovano.ai/...",
      "width": 144,
      "height": 256,
      "duration": 5,
      "has_audio": false
    }
  },
  "unit": "second",
  "units": 5,
  "charged_micro": 500000
}

Speech

Inputs

FieldTypeDefaultNotes
textstringRequired. Up to 5,000 characters. Its length is what you are charged for
voicestringavaava, leo or mia

Create speech

curl https://api.tovano.ai/v1/tasks \
  -H "Authorization: Bearer $TOVANO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "audio/demo-tts-1",
    "input": { "text": "Your order has shipped and will arrive on Thursday.", "voice": "leo" }
  }'

The result has a WAV file and the character count:

{
  "status": "completed",
  "output": {
    "audio": { "url": "https://files.tovano.ai/...", "content_type": "audio/wav", "duration_ms": 3120 },
    "characters": 51
  },
  "unit": "1k_chars",
  "units": 0.051,
  "charged_micro": 1530
}

Work out the cost first

Both units are known before you send the request, so the estimate is exact:

const PRICE = { video: 100_000, speech: 30_000 }; // micro-dollars per unit

const videoCost = (seconds: number) => seconds * PRICE.video;
const speechCost = (text: string) => Math.ceil((text.length * PRICE.speech) / 1000);

videoCost(5); // 500000 = $0.50
speechCost("Your order has shipped and will arrive on Thursday."); // 1530 = $0.00153

Read live prices from GET /v1/models rather than hard-coding them, so a price change never surprises your own billing.

Tips

  • Split long text. Speech requests take up to 5,000 characters. For longer scripts, split at sentence ends and join the files. The total price is the same.
  • Keep clips short while testing. Use duration: 1 while you build. It costs $0.100 per run instead of $0.500.
  • Store the files. Output URLs work for 24 hours; files are deleted after 30 days.

Stuck? Write to support@tovano.ai with the task ID and the X-Request-Id of the response.