Using Deepgram Text Intelligence (Java SDK)
Analyze text you already have — transcripts, chats, documents, or other plain text — via /v1/read.
When to use this product
- You already have text, not audio.
- You want one-shot REST analysis for sentiment, topics, intents, or summary-like outputs.
Use a different skill when:
- The source is audio and you want analysis during transcription →
deepgram-java-audio-intelligence.
Authentication
import com.deepgram.DeepgramClient;
DeepgramClient client = DeepgramClient.builder()
.apiKey(System.getenv("DEEPGRAM_API_KEY"))
.build();
Quick start
import com.deepgram.resources.read.v1.text.requests.TextAnalyzeRequest;
import com.deepgram.types.ReadV1Request;
import com.deepgram.types.ReadV1RequestText;
import com.deepgram.types.ReadV1Response;
ReadV1RequestText textBody = ReadV1RequestText.builder()
.text("Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.")
.build();
TextAnalyzeRequest request = TextAnalyzeRequest.builder()
.body(ReadV1Request.of(textBody))
.sentiment(true)
.topics(true)
.intents(true)
.language("en")
.build();
ReadV1Response response = client.read().v1().text().analyze(request);
response.getResults().getTopics().ifPresent(System.out::println);
response.getResults().getIntents().ifPresent(System.out::println);
response.getResults().getSentiments().ifPresent(System.out::println);
Quick start — custom topics and intents
import com.deepgram.resources.read.v1.text.types.TextAnalyzeRequestCustomIntentMode;
import com.deepgram.resources.read.v1.text.types.TextAnalyzeRequestCustomTopicMode;
import java.util.Arrays;
TextAnalyzeRequest request = TextAnalyzeRequest.builder()
.body(ReadV1Request.of(textBody))
.language("en")
.sentiment(true)
.topics(true)
.intents(true)
.customTopic(Arrays.asList("Customer Retention", "Product Quality"))
.customTopicMode(TextAnalyzeRequestCustomTopicMode.EXTENDED)
.customIntent(Arrays.asList("Request Refund", "Complaint"))
.customIntentMode(TextAnalyzeRequestCustomIntentMode.EXTENDED)
.build();
Async equivalent
import com.deepgram.AsyncDeepgramClient;
import java.util.concurrent.CompletableFuture;
AsyncDeepgramClient asyncClient = AsyncDeepgramClient.builder()
.apiKey(System.getenv("DEEPGRAM_API_KEY"))
.build();
CompletableFuture<com.deepgram.types.ReadV1Response> future =
asyncClient.read().v1().text().analyze(request);
Key parameters / API surface
TextAnalyzeRequest.builder().body(ReadV1Request.of(...)) is the high-level request path
- Body types are
ReadV1RequestText or URL-based ReadV1Request variants
- Verified request fields:
language, sentiment, summarize, topics, intents, customTopic, customTopicMode, customIntent, customIntentMode, callback, callbackMethod, tag
- Methods:
text().analyze(ReadV1Request), text().analyze(TextAnalyzeRequest), plus async and withRawResponse() variants
- Results live under
ReadV1Response.getResults()
API reference (layered)
- In-repo source of truth:
src/main/java/com/deepgram/resources/read/v1/text/ and examples/read/. No reference.md file is present here.
- Canonical OpenAPI: https://developers.deepgram.com/openapi.yaml
- Context7:
/llmstxt/developers_deepgram_llms_txt
- Product docs:
Gotchas
- Use
body(ReadV1Request.of(...)), not raw maps. This SDK is strongly typed.
TextAnalyzeRequest wraps both query-style options and the request body. ReadV1Request alone only supplies the input content.
- Custom topics/intents need matching modes (
STRICT or EXTENDED) if you want deterministic behavior.
- The request surface exposes
summarize separately from Listen V1. Do not assume Listen's versioned summarize enum applies here.
- Language is explicit in examples. Follow that pattern when using topics, intents, or sentiment.
- This repo has no dedicated async example for Read. Use
AsyncDeepgramClient and CompletableFuture directly.
Example files in this repo
examples/read/AnalyzeText.java
examples/read/AdvancedAnalysis.java
Central product skills
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).
1---2name: deepgram-java-text-intelligence3description: Use when writing or reviewing Java code in this repo that calls Deepgram Text Intelligence / Read (`/v1/read`) for text analysis. Covers `client.read().v1().text().analyze(...)` with `ReadV1Request` or `TextAnalyzeRequest`. Use `deepgram-java-audio-intelligence` when the source is audio instead of text. Triggers include "read api", "text intelligence", "analyze text", "sentiment", "topics", "intents", and "summarize text".4---56# Using Deepgram Text Intelligence (Java SDK)78Analyze text you already have — transcripts, chats, documents, or other plain text — via `/v1/read`.910## When to use this product1112- You already have **text**, not audio.13- You want one-shot REST analysis for sentiment, topics, intents, or summary-like outputs.1415**Use a different skill when:**16- The source is audio and you want analysis during transcription → `deepgram-java-audio-intelligence`.1718## Authentication1920```java21import com.deepgram.DeepgramClient;2223DeepgramClient client = DeepgramClient.builder()24 .apiKey(System.getenv("DEEPGRAM_API_KEY"))25 .build();26```2728## Quick start2930```java31import com.deepgram.resources.read.v1.text.requests.TextAnalyzeRequest;32import com.deepgram.types.ReadV1Request;33import com.deepgram.types.ReadV1RequestText;34import com.deepgram.types.ReadV1Response;3536ReadV1RequestText textBody = ReadV1RequestText.builder()37 .text("Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.")38 .build();3940TextAnalyzeRequest request = TextAnalyzeRequest.builder()41 .body(ReadV1Request.of(textBody))42 .sentiment(true)43 .topics(true)44 .intents(true)45 .language("en")46 .build();4748ReadV1Response response = client.read().v1().text().analyze(request);49response.getResults().getTopics().ifPresent(System.out::println);50response.getResults().getIntents().ifPresent(System.out::println);51response.getResults().getSentiments().ifPresent(System.out::println);52```5354## Quick start — custom topics and intents5556```java57import com.deepgram.resources.read.v1.text.types.TextAnalyzeRequestCustomIntentMode;58import com.deepgram.resources.read.v1.text.types.TextAnalyzeRequestCustomTopicMode;59import java.util.Arrays;6061TextAnalyzeRequest request = TextAnalyzeRequest.builder()62 .body(ReadV1Request.of(textBody))63 .language("en")64 .sentiment(true)65 .topics(true)66 .intents(true)67 .customTopic(Arrays.asList("Customer Retention", "Product Quality"))68 .customTopicMode(TextAnalyzeRequestCustomTopicMode.EXTENDED)69 .customIntent(Arrays.asList("Request Refund", "Complaint"))70 .customIntentMode(TextAnalyzeRequestCustomIntentMode.EXTENDED)71 .build();72```7374## Async equivalent7576```java77import com.deepgram.AsyncDeepgramClient;78import java.util.concurrent.CompletableFuture;7980AsyncDeepgramClient asyncClient = AsyncDeepgramClient.builder()81 .apiKey(System.getenv("DEEPGRAM_API_KEY"))82 .build();8384CompletableFuture<com.deepgram.types.ReadV1Response> future =85 asyncClient.read().v1().text().analyze(request);86```8788## Key parameters / API surface8990- `TextAnalyzeRequest.builder().body(ReadV1Request.of(...))` is the high-level request path91- Body types are `ReadV1RequestText` or URL-based `ReadV1Request` variants92- Verified request fields: `language`, `sentiment`, `summarize`, `topics`, `intents`, `customTopic`, `customTopicMode`, `customIntent`, `customIntentMode`, `callback`, `callbackMethod`, `tag`93- Methods: `text().analyze(ReadV1Request)`, `text().analyze(TextAnalyzeRequest)`, plus async and `withRawResponse()` variants94- Results live under `ReadV1Response.getResults()`9596## API reference (layered)97981. **In-repo source of truth**: `src/main/java/com/deepgram/resources/read/v1/text/` and `examples/read/`. No `reference.md` file is present here.992. **Canonical OpenAPI**: https://developers.deepgram.com/openapi.yaml1003. **Context7**: `/llmstxt/developers_deepgram_llms_txt`1014. **Product docs**:102 - https://developers.deepgram.com/reference/text-intelligence/analyze-text103 - https://developers.deepgram.com/docs/text-intelligence104 - https://developers.deepgram.com/docs/text-sentiment-analysis105106## Gotchas1071081. **Use `body(ReadV1Request.of(...))`, not raw maps.** This SDK is strongly typed.1092. **`TextAnalyzeRequest` wraps both query-style options and the request body.** `ReadV1Request` alone only supplies the input content.1103. **Custom topics/intents need matching modes** (`STRICT` or `EXTENDED`) if you want deterministic behavior.1114. **The request surface exposes `summarize` separately from Listen V1.** Do not assume Listen's versioned summarize enum applies here.1125. **Language is explicit in examples.** Follow that pattern when using topics, intents, or sentiment.1136. **This repo has no dedicated async example for Read.** Use `AsyncDeepgramClient` and `CompletableFuture` directly.114115## Example files in this repo116117- `examples/read/AnalyzeText.java`118- `examples/read/AdvancedAnalysis.java`119120## Central product skills121122For 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:123124```bash125npx skills add deepgram/skills126```127128This SDK ships language-idiomatic code skills; `deepgram/skills` ships cross-language product knowledge (see `api`, `docs`, `recipes`, `examples`, `starters`, `setup-mcp`).