Skip to content

Generate speech

POSThttps://api.vidmoat.com/v1/ai/speech
Bearer tokenScope ai.speech15 credits Grok; 30 credits OpenAITry it in the playground

AI-generated speech, up to 1,000 characters (longer text is cut and the response says where). provider:auto/grok/openai; optional voiceId, language, speed, and OpenAI instructions for delivery. quoteOnly:true quotes without spending. Auto may fall back after a confirmed quota rejection within maxCredits; a named voice stays pinned. Creator and Studio.

Body#

  • textstringrequired
    What to say. Over 1,000 characters is cut, and truncated reports it.
  • providerenumdefault auto
    Who generates it. Auto picks the cheapest that can.
    One of auto, grok, openai
  • voiceIdstring
    OpenAI: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse, marin (default), cedar. Grok: eve (default), ara, leo, rex, sal. A voice only one provider has pins that provider.
  • languagestring
    auto or a language code.
  • speednumberdefault 1
    0.7 to 1.5.
  • instructionsstring
    OpenAI only, up to 500 characters: how to deliver the line.
  • maxCreditsnumber
    Never spend more than this. Routes above it are excluded.
  • quoteOnlyboolean
    true returns the route and price without generating or charging.

Response#

Returns 200.

Response fields#

  • urlstring
    The audio file. Use as a clip src.
  • routeobject
    The provider route chosen: provider, model, credits, maxCredits, reason and policy (and voiceId for speech).
  • aiGeneratedboolean
    Always true.
  • creditsobject
    { charged, remaining }: what this call cost and the balance after it.
  • truncatedobject
    Present when the text was cut: { at, droppedChars, note }.
  • hintstring
    What to do with it.

Errors#

Besides the errors any request can get (authentication, rate limits):

StatusCodeWhen
402plan_requiredThe plan has no speech generation.
402insufficient_creditsThe balance cannot cover the call. Nothing ran. remaining is the balance.
422prompt_rejectedThe prompt failed the safety check. Nothing was charged. field names the field.
502provider_errorThe generation provider failed. The charge is refunded.