UNPKG

@ai-sdk/elevenlabs

Version:

The **[ElevenLabs provider](https://ai-sdk.dev/providers/ai-sdk-providers/elevenlabs)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the ElevenLabs chat and completion APIs and embedding model support for the ElevenLabs em

49 lines (32 loc) 1.54 kB
# AI SDK - ElevenLabs Provider The **[ElevenLabs provider](https://ai-sdk.dev/providers/ai-sdk-providers/elevenlabs)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the ElevenLabs chat and completion APIs and embedding model support for the ElevenLabs embeddings API. > **Deploying to Vercel?** With Vercel's AI Gateway you can access ElevenLabs (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway). ## Setup The ElevenLabs provider is available in the `@ai-sdk/elevenlabs` module. You can install it with ```bash npm i @ai-sdk/elevenlabs ``` ## Skill for Coding Agents If you use coding agents such as Claude Code or Cursor, we highly recommend adding the AI SDK skill to your repository: ```shell npx skills add vercel/ai ``` ## Provider Instance You can import the default provider instance `elevenlabs` from `@ai-sdk/elevenlabs`: ```ts import { elevenlabs } from '@ai-sdk/elevenlabs'; ``` ## Example ```ts import { elevenlabs } from '@ai-sdk/elevenlabs'; import { experimental_transcribe as transcribe } from 'ai'; const { text } = await transcribe({ model: elevenlabs.transcription('scribe_v1'), audio: new URL( 'https://github.com/vercel/ai/raw/refs/heads/main/examples/ai-functions/data/galileo.mp3', ), }); ``` ## Documentation Please check out the **[ElevenLabs provider documentation](https://ai-sdk.dev/providers/ai-sdk-providers/elevenlabs)** for more information.