Guides Java developers using Deepgram TTS v1 for one-shot REST or streaming WebSocket audio synthesis. Covers client setup, REST generate(), and WebSocket streaming.
Ships in deepgram-java-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.
Convert text to audio with REST or stream audio back incrementally over WebSocket via /v1/speak.
audio().generate) — one-shot synthesis when you already have the full text.v1WebSocket()) — lower-latency synthesis while text arrives in chunks.Use a different skill when:
deepgram-java-voice-agent.import com.deepgram.DeepgramClient;
DeepgramClient client = DeepgramClient.builder()
.apiKey(System.getenv("DEEPGRAM_API_KEY"))
.build();
API key auth uses Authorization: Token <apiKey>.
import com.deepgram.resources.speak.v1.audio.requests.SpeakV1Request;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
SpeakV1Request request = SpeakV1Request.builder()
.text("Hello! This is a text-to-speech example using the Deepgram Java SDK.")
.build();
InputStream audioStream = client.speak().v1().audio().generate(request);
Files.copy(audioStream, Path.of("output.mp3"), StandardCopyOption.REPLACE_EXISTING);
audioStream.close();
REST returns an InputStream, not JSON.
import com.deepgram.resources.speak.v1.types.SpeakV1Close;
import com.deepgram.resources.speak.v1.types.SpeakV1CloseType;
import com.deepgram.resources.speak.v1.types.SpeakV1Flush;
import com.deepgram.resources.speak.v1.types.SpeakV1FlushType;
import com.deepgram.resources.speak.v1.types.SpeakV1Text;
import com.deepgram.resources.speak.v1.websocket.V1WebSocketClient;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
Logger logger = Logger.getLogger("StreamingTts");
V1WebSocketClient wsClient = client.speak().v1().v1WebSocket();
OutputStream audioOutput = new FileOutputStream("output_streaming.wav");
// Log write failures rather than throwing from the WebSocket callback thread
// (matches examples/speak/StreamingTts.java).
wsClient.onSpeakV1Audio(audioData -> {
try {
audioOutput.write(audioData.toByteArray());
} catch (IOException e) {
logger.log(Level.SEVERE, "Failed to write streaming audio to output file.", e);
}
});
// Close the output stream when the server disconnects so we don't leak the file handle.
wsClient.onDisconnected(message -> {
try {
audioOutput.close();
} catch (IOException e) {
logger.log(Level.WARNING, "Failed to close streaming audio output file.", e);
}
});
wsClient.connect().get(10, TimeUnit.SECONDS);
wsClient.sendText(SpeakV1Text.builder().text("Hello, this is streaming text to speech.").build());
wsClient.sendFlush(SpeakV1Flush.builder().type(SpeakV1FlushType.FLUSH).build());
wsClient.sendClose(SpeakV1Close.builder().type(SpeakV1CloseType.CLOSE).build());
import com.deepgram.AsyncDeepgramClient;
import java.io.InputStream;
import java.util.concurrent.CompletableFuture;
AsyncDeepgramClient asyncClient = AsyncDeepgramClient.builder()
.apiKey(System.getenv("DEEPGRAM_API_KEY"))
.build();
CompletableFuture<InputStream> future = asyncClient.speak().v1().audio().generate(request);
SpeakV1Request.builder().text(...)model, encoding, sampleRate, bitRate, container, callback, callbackMethod, mipOptOut, tagaudio().generate(request) and audio().withRawResponse().generate(request)model, encoding, sampleRate, mipOptOutsendText(...), sendFlush(...), sendClear(...), sendClose(...)onSpeakV1Audio, onMetadata, onFlushed, onCleared, onWarning, plus generic connection/error hookssrc/main/java/com/deepgram/resources/speak/v1/ and examples/speak/. reference.md is not present in this checkout./llmstxt/developers_deepgram_llms_txtInputStream. Save or consume it; do not try to deserialize JSON.Flush before Close so the tail of the audio is not lost.ByteString. Convert to bytes before writing or playback.container and bitRate are REST request fields, not WebSocket connect options in this checkout.text; pick an explicit model/encoding when output format matters.TextBuilder helper in this repo. That Python helper does not exist here.CompletableFuture<InputStream>. You still need to close the stream after the future resolves.examples/speak/TextToSpeech.javaexamples/speak/StreamingTts.javaexamples/agent/ProviderCombinations.java — shows Aura model selection inside Agent configsFor 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
/deepgram-deepgram-java-sdk:deepgram-java-text-to-speechfrom deepgram-java-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.
7 skills in this plugin
/deepgram-java-audio-intelligenceUse when writing or reviewing Java code in this repo that enables Deepgram intelligence overlays on `/v1/listen` audio transcription - diarization, entity detection, sentiment, summarize, topics, intents, language detection, and redaction. Same endpoint as plain STT, but with extra request fields on `ListenV1RequestUrl` or `MediaTranscribeRequestOctetStream`. Use `deepgram-java-speech-to-text` for plain transcripts and `deepgram-java-text-intelligence` for analysis on existing text. Triggers include "audio intelligence", "diarize", "summarize audio", "sentiment from audio", "topic detection", and "redact"./deepgram-java-conversational-sttUse when writing or reviewing Java code in this repo that calls Deepgram Conversational STT v2 / Flux over `/v2/listen`. Covers `client.listen().v2().v2WebSocket()`, `V2ConnectOptions`, `onTurnInfo`, and turn-aware close handling. Use `deepgram-java-speech-to-text` for standard v1 transcription and `deepgram-java-voice-agent` for fully interactive assistants. Triggers include "flux", "conversational stt", "listen v2", "turn detection", "end of turn", and "eot"./deepgram-java-management-apiUse when writing or reviewing Java code in this repo that calls Deepgram Management APIs for projects, project models, API keys, members, invites, usage, and billing. Covers `client.manage().v1().*` plus related think-model discovery under `client.agent().v1().settings().think().models()`. Use `deepgram-java-voice-agent` for live agent conversations instead of admin APIs. Triggers include "management api", "list projects", "api keys", "members", "invites", "usage", "billing", and "models".Other plugins' skills for the same job