{"record":{"id":"cb3baea0dfb7599b","repo":"vercel/ai","slug":"cartesia-ink-2-currently-supports-english-only","errorCode":null,"errorMessage":"Cartesia Ink 2 currently supports English only.","messagePattern":"Cartesia Ink 2 currently supports English only\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cartesia/src/cartesia-realtime-model.ts","lineNumber":85,"sourceCode":"  }\n\n  async doCreateClientSecret(\n    options: RealtimeModelV4ClientSecretOptions,\n  ): Promise<RealtimeModelV4ClientSecretResult> {\n    const expiresIn = options.expiresAfterSeconds;\n    if (\n      expiresIn != null &&\n      (!Number.isInteger(expiresIn) || expiresIn <= 0 || expiresIn > 3600)\n    ) {\n      throw new Error(\n        'Cartesia realtime client secrets must expire between 1 and 3600 seconds.',\n      );\n    }\n\n    const sessionConfig = options.sessionConfig;\n    const language = sessionConfig?.inputAudioTranscription?.language;\n    if (language != null && language !== 'en') {\n      throw new Error('Cartesia Ink 2 currently supports English only.');\n    }\n\n    const fetchFn = this.config.fetch ?? fetch;\n    const response = await fetchFn(`${this.config.baseURL}/access-token`, {\n      method: 'POST',\n      headers: {\n        ...this.config.headers(),\n        'Content-Type': 'application/json',\n      },\n      body: JSON.stringify({\n        grants: { stt: true },\n        ...(expiresIn != null ? { expires_in: expiresIn } : {}),\n      }),\n    });\n\n    if (!response.ok) {\n      const text = await response.text();\n      throw new Error(","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/cartesia/src/cartesia-realtime-model.ts#L67-L103","documentation":"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.","triggerScenarios":"Requesting a realtime client secret with options.sessionConfig.inputAudioTranscription.language set to e.g. 'es', 'fr', 'de', or any locale other than 'en'.","commonSituations":"Building multilingual voice apps and enabling input transcription for the user's language; copying sessionConfig from another realtime provider that supports many languages.","solutions":["Set inputAudioTranscription.language to 'en' or remove inputAudioTranscription entirely.","Disable transcription for non-English sessions until Cartesia expands Ink 2 language support.","Use a different realtime/transcription provider if non-English transcription is required."],"exampleFix":"// before\nconst secret = await model.doCreateClientSecret({\n  sessionConfig: { inputAudioTranscription: { language: 'es' } },\n});\n\n// after\nconst secret = await model.doCreateClientSecret({\n  sessionConfig: { inputAudioTranscription: { language: 'en' } },\n});","handlingStrategy":"validation","validationCode":"const lang = opts.sessionConfig?.inputAudioTranscription?.language;\nif (lang != null && lang !== 'en') {\n  throw new Error(`Cartesia Ink 2 transcription is English-only; got ${lang}`);\n}","typeGuard":"function isSupportedTranscriptionLanguage(c?: { inputAudioTranscription?: { language?: string } }): boolean {\n  const lang = c?.inputAudioTranscription?.language;\n  return lang == null || lang === 'en';\n}","tryCatchPattern":"try {\n  return await model.doCreateClientSecret(options);\n} catch (e) {\n  if (/supports English only/.test(String(e.message))) {\n    const { inputAudioTranscription, ...rest } = options.sessionConfig ?? {};\n    return model.doCreateClientSecret({ ...options, sessionConfig: rest });\n  }\n  throw e;\n}","preventionTips":["Gate non-English transcription behind a feature flag that defaults off for Cartesia.","Detect the user's language before enabling inputAudioTranscription.","Only send inputAudioTranscription when language is 'en'."],"tags":["validation","realtime","unsupported-feature"],"backgroundTag":"unsupported-language","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}