Implements Deepgram Voice Agent from the Rust SDK: WebSocket client, Settings/Update messages, typed AgentResponse events, function calling, and saved agent configurations.
Ships in deepgram-rust-sdk. 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.
Use this skill when the user wants an end-to-end conversational voice agent — STT, LLM, and TTS orchestrated by Deepgram over one WebSocket.
Prefer conversational STT (flux_request) instead when the application only needs turn-based transcripts and drives its own LLM and TTS.
The Voice Agent client is behind the agent feature (on by default).
[dependencies]
deepgram = { version = "0.12", default-features = false, features = ["agent"] }
tokio = { version = "1", features = ["full"] }
futures = "0.3"
agent is also part of the crate's default features, so a plain
cargo add deepgram includes it.
let dg = deepgram::Deepgram::new(std::env::var("DEEPGRAM_API_KEY")?)?;
The credential travels in the handshake's Authorization header. start() uses the SaaS endpoint; start_at_url() accepts a custom host but requires wss:// (plain ws:// is allowed only for loopback, so local mock servers work). Do not hand-roll a raw tokio_tungstenite::connect_async session: the SDK client also supplies the shared rustls connector (so rustls-tls-native-roots and Deepgram::tls_config apply), the correct Host authority for non-default ports, and Debug redaction of provider credentials.
use deepgram::agent::{
audio::{AudioConfig, AudioInput, AudioInputEncoding},
listen::{AgentListenProvider, AgentListenSettings, DeepgramListenV2Provider},
settings::{AgentConfig, InlineAgentConfig, SettingsMessage},
speak::{DeepgramSpeakModel, DeepgramSpeakProvider, SpeakProvider, SpeakSettings},
think::{OpenAiModel, OpenAiThinkProvider, ThinkProvider, ThinkSettings},
AgentEvent, AgentResponse,
};
use deepgram::{Deepgram, DeepgramError};
use futures::stream::StreamExt;
#[tokio::main]
async fn main() -> Result<(), DeepgramError> {
let dg = Deepgram::new(std::env::var("DEEPGRAM_API_KEY").unwrap())?;
let (mut handle, mut events) = dg.agent().start().await?;
handle
.send_settings(SettingsMessage::new(
AudioConfig::new(
Some(AudioInput::new(AudioInputEncoding::Linear16, 16_000)),
None,
),
AgentConfig::inline(
InlineAgentConfig::from_parts(
AgentListenSettings::new(AgentListenProvider::DeepgramV2(
DeepgramListenV2Provider::new("flux-general-en"),
)),
ThinkSettings::new(ThinkProvider::OpenAi(OpenAiThinkProvider::new(
OpenAiModel::Gpt4oMini,
))),
SpeakSettings::new(SpeakProvider::Deepgram(DeepgramSpeakProvider::new(
DeepgramSpeakModel::Aura2ThaliaEn,
))),
)
.with_greeting("Hello! How can I help today?"),
),
))
.await?;
// Stream microphone audio with handle.send_data(pcm) from another task.
while let Some(event) = events.next().await {
match event? {
AgentEvent::Json(AgentResponse::ConversationText(c)) => {
println!("{:?}: {}", c.role, c.content)
}
AgentEvent::Json(AgentResponse::Error(e)) => {
eprintln!("{}: {}", e.code, e.description);
break;
}
AgentEvent::Json(AgentResponse::Unknown(value)) => println!("unmodeled: {value}"),
AgentEvent::Audio(bytes) => println!("{} bytes of agent audio", bytes.len()),
_ => {} // AgentEvent and AgentResponse are #[non_exhaustive]
}
}
Ok(())
}
dg.agent().start(), dg.agent().start_at_url(url). Both return (AgentHandle, AgentEventStream).AgentHandle client messages: send_settings, send_update_listen, send_update_speak, send_update_think, send_update_think_live, send_update_prompt, send_inject_user_message, send_inject_agent_message, send_inject_dynamic_agent_message, send_function_call_response, send_custom_to_think_provider, send_data (binary audio), keep_alive, force_end_turn, close, and send_raw_json as the escape hatch for messages the SDK has not typed yet.AgentEventStream implements futures::Stream<Item = Result<AgentEvent>>; AgentEvent is Json(AgentResponse) or Audio(Bytes), interleaved in protocol order.AgentConfig::inline(InlineAgentConfig…) or AgentConfig::saved(uuid) for a saved configuration. Listen providers are Deepgram V1 (Nova) and V2 (Flux STT, with language_hints, eot_threshold, eager_eot_threshold, eot_timeout_ms, keyterms); Think providers are OpenAI, Anthropic, AWS Bedrock, Deepgram, Google, and Groq; Speak providers are Deepgram, ElevenLabs, Cartesia, OpenAI, and AWS Polly. InlineAgentConfig::with_think_live(ThinkLiveSettings::new(ThinkLiveProvider::new())) enables backchannels, presence checks, dynamic fillers, and typed FrustrationDetected events.think-fast is Early Access and requires Model Improvement Program participation; sessions with mip_opt_out: true must use phonellm-mini-alpha-2-fp8. With the latter model, omit reasoning_mode or use DeepgramReasoningMode::None so the agent does not speak reasoning text.handle.request_id() / events.request_id() from the upgrade header, or AgentResponse::Welcome's request_id when the header is absent.src/agent/websocket.rs (client, handle, event stream)src/agent/settings.rs, src/agent/messages.rs, src/agent/response.rssrc/agent/{audio,listen,think,speak,history,endpoint,aws_credentials}.rsexamples/agent/websocket/simple_agent.rs, examples/agent/websocket/function_calling.rstests/agent_websocket_local.rshttps://developers.deepgram.com/openapi.yamlhttps://developers.deepgram.com/reference/voice-agent/voice-agenthttps://developers.deepgram.com/asyncapi.yamlhttps://developers.deepgram.com/reference/voice-agent/voice-agent/llmstxt/developers_deepgram_llms_txthttps://developers.deepgram.com/docs/voice-agentagent.deepgram.com, not api.deepgram.com. Deepgram::with_base_url does not redirect it; use start_at_url for a self-hosted deployment.Settings comes first. Send it before any audio, and wait for SettingsApplied before assuming the configuration is live. Update* messages are confirmed by their own ListenUpdated / SpeakUpdated / ThinkUpdated / ThinkLiveUpdated / PromptUpdated events. UpdateThink_Live replaces the whole Think Live provider block, so resend every desired option.keep_alive() every 8 seconds during an idle period. It does not extend the 2-hour session cap.send_* on a retained handle returns an error instead of silently dropping the message; close() on an ended session is a no-op.type the SDK does not model lands in AgentResponse::Unknown(serde_json::Value) rather than breaking the stream — including the production {"type":"EndOfTurn","trigger":"model"|"timeout"} message from Flux STT listen providers, which is not in the published spec yet. An event whose type is modeled but whose payload does not fit its schema arrives as an Err item naming the event type, so a malformed Error event is never mistaken for an ignorable Unknown. A modeled event carrying an unmodeled value is neither: a role the SDK does not name arrives as ConversationRole::Unknown(String) holding the wire string, and a History entry matching neither modeled shape as HistoryMessage::Unknown(serde_json::Value), so a new server enum value never ends the session.force_end_turn needs Flux STT. With any other listen provider the server answers FORCE_END_TURN_UNSUPPORTED as a Warning and the turn does not end.FunctionCallCancelled. It reports calls the server abandoned; only FunctionCallRequest expects a send_function_call_response.wss:// agent.think.endpoint.url, then call send_custom_to_think_provider(CustomToThinkProviderMessage::new(json)). The provider's JSON response arrives as AgentResponse::CustomFromThinkProvider; non-JSON provider output arrives as a JSON string.examples/agent/websocket/simple_agent.rs — connect, configure, print events, close.examples/agent/websocket/function_calling.rs — client-side function execution and FunctionCallResponse.For cross-language Deepgram product knowledge — the consolidated API reference, documentation finder, focused runnable recipes, third-party integration examples, and MCP setup — install the central skills:
npx skills add deepgram/skills
This SDK ships language-idiomatic code skills; deepgram/skills ships cross-language product knowledge (see api, docs, recipes, examples, starters, setup-mcp).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/deepgram-rust-audio-intelligenceUse when implementing Deepgram audio intelligence from the Rust SDK, especially when intelligence features are attached to STT Options and batch responses instead of a separate audio-intelligence module./deepgram-rust-conversational-sttUse when implementing Deepgram Flux conversational STT from the Rust SDK, including flux_request APIs, turn events, FluxResponse handling, and turn-detection tuning for voice-agent-style pipelines./deepgram-rust-management-apiUse when implementing Deepgram project, key, member, scope, billing, invitation, or usage operations from the Rust SDK, including manage feature flags and the real Deepgram::projects/keys/members/scopes/billing/usage APIs./deepgram-rust-speech-to-textUse when implementing Deepgram speech-to-text in the Rust SDK, including prerecorded REST transcription, live WebSocket streaming, listen feature flags, Options builder usage, and response handling./deepgram-rust-text-intelligenceUse when a user asks for Deepgram text intelligence from Rust. The crate exposes /v1/read through a typed client behind the `read` Cargo feature./deepgram-rust-text-to-speechUse when implementing Deepgram text-to-speech in the Rust SDK, including Aura and Flux TTS model selection, speak feature flags, output file or byte-stream handling, the streaming Aura and Flux TTS WebSocket handles, and real crate APIs under speak::options, speak::flux, and Speak./deepgram-deepgram-rust-sdk:deepgram-rust-voice-agentfrom deepgram-rust-sdk
Claude Code refuses to install this plugin
This plugin's marketplace entry is invalid: skills.0: Invalid string: must start with "./", skills.1: Invalid string: must start with "./", skills.2: Invalid string: must start with "./" (+4 more)
This plugin's marketplace entry is invalid: skills.0: Invalid string: must start with "./", skills.1: Invalid string: must start with "./", skills.2: Invalid string: must start with "./" (+4 more)
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
Other plugins' skills for the same job