Integrations / Vercel AI SDK
Vercel AI SDK apps with Cartesia speech and transcription
Install the AI SDK's Cartesia provider, then call generateSpeech for audio or stream a transcription with Ink 2.
What you can do with Vercel AI SDK
What teams build when they put Cartesia and Vercel AI SDK together.
Speech from TypeScript
generateSpeech takes a Cartesia model, the text and a voice ID, and returns the audio to your TypeScript code.
Streaming transcription
The AI SDK's streaming transcription is experimental. It accepts Ink 2 and emits partial and final transcripts.
Realtime sessions
An experimental realtime factory runs browser sessions with a short-lived token that your server creates.
More code for Vercel AI SDK
From the AI SDK's Cartesia provider page.
Set it up
Built in: Cartesia is a provider in the AI SDK, published as @ai-sdk/cartesia and maintained in the AI SDK's own packages. Vendor details read in October 2026.
Install
Add
aiand@ai-sdk/cartesia.Set CARTESIA_API_KEY
The provider reads it from the environment by default.
Call generateSpeech
Pass a model, your text, an output format and a voice ID.
Stream a transcript
Use
experimental_streamTranscribewith theink-2model.
Documentation
Before you build
Model IDs
The AI SDK page lists the Sonic model IDs its provider accepts. Cartesia's current model and dated snapshots are on the model page in Cartesia's docs.
Experimental pieces
The AI SDK marks streaming transcription and realtime as experimental, and their names may change.
More integrations
Vercel AI SDK integration FAQs
Does the Vercel AI SDK support text to speech?
Yes. generateSpeech in the ai package turns text into audio, and @ai-sdk/cartesia adds Cartesia's Sonic models to it. Call cartesia.speech('sonic-3.5') with your text, an output format and a voice ID. The AI SDK page also lists sonic-3, sonic-2, sonic-turbo and sonic-latest.
Can the AI SDK transcribe audio with Cartesia?
Yes, two ways. The ink-whisper model handles batch transcription of recorded audio, and experimental_streamTranscribe with ink-2 streams raw audio and emits partial and final transcripts. The AI SDK marks streaming and realtime transcription as experimental, so their names may change.
Is Cartesia available through Vercel AI Gateway?
No. The AI SDK's Cartesia page says Cartesia models are not currently available through AI Gateway, so install @ai-sdk/cartesia and call it with your own CARTESIA_API_KEY, which the provider reads from the environment by default.
Who maintains the @ai-sdk/cartesia provider?
It lives in the AI SDK's own packages, published as @ai-sdk/cartesia, and Cartesia's docs describe the models it calls. Cartesia's current Sonic model and its dated snapshots are listed on the TTS models page.
What does Cartesia cost through the AI SDK?
The provider calls Cartesia's API, so you pay API credits on your plan. Sonic text to speech costs 1 credit per character, about 750 to 800 credits per minute of audio, and Ink 2 transcription costs 3 credits per second. The Free plan includes 20K credits a month, and paid plans start at $5/month.
Get started today
Talk to an expert.
Connect with a member of our team and learn how Cartesia can help you build world-class voice experiences.
Start building.
Access our models via API and bring a voice agent into production in minutes.