Sume TTS 400: send transcript or transcript_source, never both

A TTS request needs exactly one of transcript or transcript_source. Both, or neither, is an error. Live-commerce Formats need the source. A validator.

3 min readSume
All posts

Sume TTS 1.0 takes exactly one text input: transcript, a literal string, or transcript_source, a reference to a script revision. Sending both, or sending neither, is rejected.

The two shapes

  • transcript: literal text, up to 20,000 characters. Fine for generic requests.
  • transcript_source: an object with script_revision_id and sentence_ids (up to 1,000). Sume resolves the text server side.
  • Live-commerce Formats require transcript_source. A literal transcript there fails with tts_text_source_required.

Check before you send

This Python function runs offline and mirrors the rule, so a bad body fails in your tests instead of at the API.

def check_body(body):
    has_text = "transcript" in body
    has_source = "transcript_source" in body
    if has_text == has_source:
        raise ValueError("send exactly one of transcript or transcript_source")
    if has_text and len(body["transcript"]) > 20000:
        raise ValueError("transcript over 20,000 characters")
    if has_source:
        ids = body["transcript_source"].get("sentence_ids", [])
        if not 1 <= len(ids) <= 1000:
            raise ValueError("sentence_ids must hold 1 to 1000 ids")
    return True


print(check_body({"transcript": "Hello", "language": "en"}))
try:
    check_body({"transcript": "Hello", "transcript_source": {"sentence_ids": ["a"]}})
except ValueError as e:
    print("rejected:", e)

Why it is strict

Source-bound requests are resolved before the credit reservation, so a stale revision or wrong workspace fails closed and charges nothing. Because the text is chosen by id, retries with the same idempotency key reuse the same job instead of drifting.

Related posts

More in Developers

All Developers posts

Written by Sume