API: multilingual agents - additional_languages and mid-call language switching

An agent can now serve multiple languages in one session instead of needing a sibling agent per language plus a transfer. Set additional_languages on create or update; the agent switches language mid-call with full context preserved - no handoff, no dropped state.

$curl -X PATCH https://api.speechify.ai/v1/agents/{agent_id} \
> -H "Authorization: Bearer $SPEECHIFY_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "llm": {"provider": "openai", "model": "gpt-4.1"},
> "additional_languages": [
> {"language": "es", "voice_id": "sofia", "first_message": "¡Hola! ¿En qué puedo ayudarte?"}
> ]
> }'
  • language - a BCP-47 tag; today’s supported primary subtags are en, de, es, fr, it, pt. Must be unique per agent and different from the agent’s default language. Up to 10 entries.
  • voice_id - optional. Omit it and the agent’s own voice speaks the language (voice continuity through a switch); set it to serve that language with a different voice, e.g. a native speaker.
  • first_message - optional greeting used only when a session starts in that language.

When additional_languages is non-empty, the agent gains a switch_language tool automatically - it isn’t customer-attachable, so the tool and the configured languages can’t drift apart. The caller speaking a configured language, or asking for it, triggers a switch; unsupported languages continue in the current language.

POST /v1/agents/{agent_id}/sessions and POST /v1/agents/{agent_id}/conversations both accept a language field to start a session or conversation in one of the agent’s configured languages directly (the default language or an additional_languages entry, matched by primary subtag). An unconfigured language is rejected with 400.

Multilingual agents require a premium LLM

Reliable language detection and clean switching (no narrating the switch to the caller) needs a capable model, so a multilingual agent’s llm must be one of a small curated set of premium-class models. This is enforced independently of the console: an agent created through the API defaults to the managed model, so setting a non-empty additional_languages without also setting llm to a curated model - gpt-4.1 is a safe default - is rejected with 400. The console sets a curated model for you automatically when you enable multilingual in the UI; a direct API caller must set it explicitly. This makes multilingual a Pro-and-above capability, since every model in the curated set is premium-class.