Covers ElevenLabs and Cartesia speech providers in CrestApps.Core 2.0: text-to-speech, speech recognition, voice search/cloning, and speech markup. Use when adding voices, building a voice picker, or troubleshooting PCM rates or connections.
Ships in crestapps-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
ElevenLabs and Cartesia are speech-only providers: they have no chat, embedding or image models. Either can be the text-to-speech leg of a cascaded realtime deployment, the voice of a text chat, or the ITextToSpeechClient / ISpeechToTextClient any host code asks IAIClientFactory for. Cartesia can also be a cascade's speech-to-text leg. The voice library and speech markup they introduced are provider-neutral.
ConnectionName is needed.TextToSpeechOptions.VoiceId); a request without one fails with a message that says so.Pcm<rate> at a rate the provider produces. For its hearing leg use Cartesia on ink-2 or ink-preview; ElevenLabs cannot hear for a cascade.CloneAsync.Pcm24000 speech, a short transcription, a voice search, and clone plus delete if used).crestapps-core-realtime-voice; profile speech settings (rate, emotion, pronunciation, fallback voice, keywords) by crestapps-core-ai-profiles.using CrestApps.Core.AI.Cartesia;
using CrestApps.Core.AI.ElevenLabs;
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddAISuite(ai => ai
.AddOpenAI()
.AddElevenLabs()
.AddCartesia()
)
);
Without the suite builder:
using CrestApps.Core.AI.Cartesia;
using CrestApps.Core.AI.ElevenLabs;
builder.Services
.AddCoreAIServices()
.AddCoreAIElevenLabs()
.AddCoreAICartesia();
The extension methods live in the CrestApps.Core.AI.ElevenLabs and CrestApps.Core.AI.Cartesia namespaces. Each registers a named HttpClient (CrestApps.ElevenLabs, CrestApps.Cartesia), an IAIClientProvider that is also the IVoiceLibraryProvider, and a deployment provider with UseContainedConnection = true.
| ElevenLabs | Cartesia | |
|---|---|---|
| Client name | ElevenLabsConstants.ClientName (ElevenLabs) | CartesiaConstants.ClientName (Cartesia) |
| Text-to-speech model | eleven_flash_v2_5 (default), eleven_multilingual_v2, ... | sonic-2 (default), sonic-3, ... |
| Speech-to-text model | scribe_v1 (default), scribe_v2 | ink-whisper (default, batch); ink-2 or ink-preview for a cascade |
| Default endpoint | https://api.elevenlabs.io (set Endpoint for a residency region) | https://api.cartesia.ai |
| Authentication | xi-api-key header | X-API-Key header plus a pinned Cartesia-Version |
| Cloning | From one or more recordings | From one clip |
{
"CrestApps": {
"AI": {
"Deployments": [
{
"ClientName": "ElevenLabs",
"Name": "elevenlabs-tts",
"ModelName": "eleven_flash_v2_5",
"ApiKey": "your-elevenlabs-key",
"Features": [ "textToSpeech" ]
},
{
"ClientName": "Cartesia",
"Name": "cartesia-tts",
"ModelName": "sonic-2",
"ApiKey": "your-cartesia-key",
"Features": [ "textToSpeech" ]
},
{
"ClientName": "Cartesia",
"Name": "cartesia-ink",
"ModelName": "ink-2",
"ApiKey": "your-cartesia-key",
"Features": [ "speechToText" ]
}
]
}
}
}
Top-level fields of a configured deployment (here ApiKey, optionally Endpoint) become its properties, which the contained connection reads. ModelName picks the model and falls back to Name.
TextToSpeechOptions.AudioFormat set to Pcm<rate> (for example Pcm24000) returns raw 16-bit PCM; anything else returns MP3. ElevenLabs produces PCM at 8, 16, 22.05, 24, 32, 44.1 and 48 kHz; Cartesia at 8, 16, 22.05, 24, 44.1 and 48 kHz. Any other rate fails rather than playing at the wrong speed.TextToSpeechOptions.Speed is clamped to what the API accepts: ElevenLabs 0.7 to 1.2, Cartesia 0.6 to 1.5.TextToSpeechOptions.Language is sent as an ISO 639-1 code (es-MX becomes es). ElevenLabs multilingual v2 models detect the language and are sent none; Cartesia defaults to en.TextToSpeechOptionsProperties.Emotion ("emotion" in AdditionalProperties) selects Cartesia's emotion control (calm, excited, ...). ElevenLabs ignores it. A profile sets it with AIProfileSpeechSettings.SpeakingEmotion.using CrestApps.Core.AI.Speech;
using Microsoft.Extensions.AI;
var tts = await clientFactory.CreateTextToSpeechClientAsync(deployment);
var options = new TextToSpeechOptions
{
VoiceId = voiceId,
AudioFormat = "Pcm24000",
Speed = 1.1f,
AdditionalProperties = new AdditionalPropertiesDictionary
{
[TextToSpeechOptionsProperties.Emotion] = "calm",
},
};
await foreach (var update in tts.GetStreamingAudioAsync("Your code is <spell>AB12</spell>.", options, cancellationToken))
{
// Play or forward each chunk.
}
SpeechToTextOptions.SpeechSampleRate (16 kHz when unset) and wrapped in a WAV header (SpeechAudioFormat.ToUploadable).SpeechToTextOptionsProperties.BoostedKeywords are sent as key terms to ElevenLabs Scribe v2 models. Scribe v1 and Cartesia ignore them.Cartesia's realtime client opens transcription sessions on the turns endpoint (wss://api.cartesia.ai/stt/turns/websocket), which decides on the server where each user turn ends:
turn.update carries the turn so far; its new words become a partial transcript, which the cascade treats as the user talking over the assistant.turn.end carries the definitive text, the completed transcript that starts the reply, metered with the audio sent since the previous turn ended.ink-2 or ink-preview. A deployment on ink-whisper or with no model hears with ink-2. Cartesia detects the language; its realtime models transcribe English, French, Hindi, Japanese and Spanish.NotSupportedException. ElevenLabs' realtime client always throws, because its recognition is batch only.deployment.Alter<CascadedRealtimeMetadata>(cascade =>
{
cascade.SpeechToTextDeploymentName = "cartesia-ink";
cascade.ChatDeploymentName = "gpt-4.1";
cascade.TextToSpeechDeploymentName = "elevenlabs-tts";
});
ISpeechVoiceResolver returns a short list (the first 100 voices) for pickers. IVoiceLibrary searches beyond it and clones voices.
using CrestApps.Core.AI.Models;
using CrestApps.Core.AI.Speech;
var library = await voiceLibraryResolver.GetLibraryAsync(deployment, cancellationToken);
if (library is null)
{
return; // The deployment's provider has no voice library.
}
var page = await library.SearchAsync(new VoiceSearchRequest
{
Query = "calm",
Language = "es",
Gender = SpeechVoiceGender.Female,
PageSize = 25,
}, cancellationToken);
// page.Voices, and page.NextCursor as the next request's Cursor.
if (library.SupportsCloning)
{
var voice = await library.CloneAsync(new VoiceCloneRequest
{
Name = "Support agent",
Language = "en",
Samples = [new VoiceCloneSample { FileName = "agent.mp3", ContentType = "audio/mpeg", Content = recording }],
}, cancellationToken);
// voice.Id can now be used as the deployment's voice. Remove it with library.DeleteAsync(voice.Id).
}
IVoiceLibraryResolver (registered by AddCoreAIServices) finds the IVoiceLibraryProvider whose CanHandle(clientName) matches the deployment and opens it with the deployment's connection through GetLibrary(connection). It returns null when no provider has a library.PageSize; keep following NextCursor.SupportsCloning is false) throws NotSupportedException from CloneAsync and DeleteAsync.IVoiceLibraryProvider and IVoiceLibrary and register the provider with TryAddEnumerable.Prompts and replies can carry two neutral tags so they do not depend on the provider that speaks them:
| Markup | Meaning |
|---|---|
<break time="500ms"/> or <break time="1.5s"/> | A pause, at most 3 seconds |
<spell>AB12</spell> | Read one character at a time |
SpeechMarkup.Render(text, dialect) (namespace CrestApps.Core.AI.Services) renders them for SpeechMarkupDialect.ElevenLabs (break tags, hyphenated letters), Cartesia (break and spell tags) or Plain (punctuation and spaced letters). SpeechMarkup.Strip(text) renders Plain, and HasMarkup(text) detects tags. The ElevenLabs and Cartesia clients render markup themselves; the OpenAI and Azure AI Speech text-to-speech clients are wrapped in SpeechMarkupTextToSpeechClient, so a tag is never read aloud. Wrap any other provider the same way:
using CrestApps.Core.AI.Services;
ITextToSpeechClient client = new SpeechMarkupTextToSpeechClient(innerClient, SpeechMarkupDialect.Plain);
HttpRequestException with StatusCode set; the message names the provider, the status, a hint for 401 (check the API key) and 429 (rate or concurrency limit), and the start of the response body. The API key is never included.ink-2 or ink-preview.scribe_v2 models take key terms.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/crestapps-core:crestapps-core-speech-voicesfrom crestapps-core
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-core51 skills in this plugin
/crestapps-core-a2aSkill for Agent-to-Agent (A2A) protocol support in CrestApps.Core on the A2A 1.0 SDK. Covers AddA2AClient and AddCoreAIA2AClient with Entity Framework Core or YesSql connection stores, A2AConnection and A2AConnectionMetadata authentication, AIProfileA2AMetadata, the agent card cache and A2AToolRegistryProvider, the listAvailableAgents, findAgentForTask and findToolsForTask tools, building an A2A host with IAgentHandler, A2AServer, ITaskStore and MapA2A, A2A 1.0 agent cards with supportedInterfaces published at /.well-known/agent-card.json, A2AHostOptions authentication and ExposeAgentsAsSkill, system agents exposed through the host, and upgrading from the 0.3 SDK./crestapps-core-ag-uiSkill for running the CrestApps.Core 2.0 AI chat as an AG-UI agent. Covers the CrestApps.Core.AI.AGUI package (AGUIRunEventWriter, AGUIRunRequest, AGUIJson), AIChatHubCore.RunAgent over SignalR and MapAGUIChat with Server-Sent Events, the RunAgentInput members and streamed events, tool approvals with RequireApproval or an approval tool kind, ApprovalRequiredAIFunction, interrupts and resume, approvals inside agents, page context with crestAppsAGUI.registerContextProvider, shared state with registerStateProvider and update_shared_state, frontend tools, stored tool calls (ChatTurnToolActivity), runs that continue on the next page, AGUIChatOptions.DisconnectedRunTimeout, the protocol and sendPageContext chat options, and the AICompletionContextKeys and ChatResponseHandlerContext members. Use it when showing tool calls in the chat, asking a person before a tool runs, sharing page state with the agent, connecting CopilotKit or another AG-UI client, or troubleshooting approvals and continued runs.Other plugins' skills for the same job