vercel/ai · error · Error

Cartesia Ink 2 currently supports English only.

Error message

Cartesia Ink 2 currently supports English only.

What it means

doCreateClientSecret checks sessionConfig.inputAudioTranscription.language and throws if it is set to anything other than 'en'. Cartesia Ink 2 transcription currently supports English only, so non-English transcription requests are rejected before hitting the API.

Source

Thrown at packages/cartesia/src/cartesia-realtime-model.ts:85

  }

  async doCreateClientSecret(
    options: RealtimeModelV4ClientSecretOptions,
  ): Promise<RealtimeModelV4ClientSecretResult> {
    const expiresIn = options.expiresAfterSeconds;
    if (
      expiresIn != null &&
      (!Number.isInteger(expiresIn) || expiresIn <= 0 || expiresIn > 3600)
    ) {
      throw new Error(
        'Cartesia realtime client secrets must expire between 1 and 3600 seconds.',
      );
    }

    const sessionConfig = options.sessionConfig;
    const language = sessionConfig?.inputAudioTranscription?.language;
    if (language != null && language !== 'en') {
      throw new Error('Cartesia Ink 2 currently supports English only.');
    }

    const fetchFn = this.config.fetch ?? fetch;
    const response = await fetchFn(`${this.config.baseURL}/access-token`, {
      method: 'POST',
      headers: {
        ...this.config.headers(),
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        grants: { stt: true },
        ...(expiresIn != null ? { expires_in: expiresIn } : {}),
      }),
    });

    if (!response.ok) {
      const text = await response.text();
      throw new Error(

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Set inputAudioTranscription.language to 'en' or remove inputAudioTranscription entirely.
  2. Disable transcription for non-English sessions until Cartesia expands Ink 2 language support.
  3. Use a different realtime/transcription provider if non-English transcription is required.

Example fix

// before
const secret = await model.doCreateClientSecret({
  sessionConfig: { inputAudioTranscription: { language: 'es' } },
});

// after
const secret = await model.doCreateClientSecret({
  sessionConfig: { inputAudioTranscription: { language: 'en' } },
});
Defensive patterns

Strategy: validation

Validate before calling

const lang = opts.sessionConfig?.inputAudioTranscription?.language;
if (lang != null && lang !== 'en') {
  throw new Error(`Cartesia Ink 2 transcription is English-only; got ${lang}`);
}

Type guard

function isSupportedTranscriptionLanguage(c?: { inputAudioTranscription?: { language?: string } }): boolean {
  const lang = c?.inputAudioTranscription?.language;
  return lang == null || lang === 'en';
}

Try / catch

try {
  return await model.doCreateClientSecret(options);
} catch (e) {
  if (/supports English only/.test(String(e.message))) {
    const { inputAudioTranscription, ...rest } = options.sessionConfig ?? {};
    return model.doCreateClientSecret({ ...options, sessionConfig: rest });
  }
  throw e;
}

Prevention

When it happens

Trigger: Requesting a realtime client secret with options.sessionConfig.inputAudioTranscription.language set to e.g. 'es', 'fr', 'de', or any locale other than 'en'.

Common situations: Building multilingual voice apps and enabling input transcription for the user's language; copying sessionConfig from another realtime provider that supports many languages.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/cb3baea0dfb7599b. Report an issue: GitHub.