Text tools
Summaries with sources, translations that keep your terms
Summarize, translate and grammar share one word meter. Summaries point to the text they came from and grammar edits show what changed, so your app can show the result next to the original.
- Endpoints
- summarize, translate, grammar
- Meter
- text.words, shared by all three
- Per request
- 20,000 words to summarize, 10,000 to translate or correct
- From
- $5 a month for 1,000,000 words
One notice, three calls
text
31 words
- 0 to 57The city council approved a new bike lane on Main Street.
- 58 to 113Construction starts in March and takes about six weeks.
- 114 to 172Parking on the north side will be removed during the work.
POST/v1/text/summarize
length: "short"
- The city council approved a new bike lane on Main Street.source_span 0 to 57
- Construction starts in March and takes about six weeks.source_span 58 to 113
- Left out of a short summary
POST/v1/text/translate
target: "de", 3 glossary terms
- Der Stadtrat hat einen neuen Radweg auf der Main Street genehmigt.
- Der Bau beginnt im März und dauert etwa sechs Wochen.
- Die Parkplätze auf der Nordseite fallen während der Arbeiten weg.
POST/v1/text/grammar
on the draft, mode: "standard"
theThecapitalizationoffset 0aprovedapprovedspellingoffset 17
startstartsgrammaroffset 70
therepeated_wordoffset 126
One document, three operations. Each response says what it used or what it changed.
A summary nobody can check, a translation that renames your product, or a grammar fix that rewrites the whole paragraph all send someone back to the original text. The output is only useful when you can see what it was based on and what it changed.
SummarizePOST/v1/text/summarize | TranslatePOST/v1/text/translate | GrammarPOST/v1/text/grammar | |
|---|---|---|---|
| Used for | Support tools that summarize long threads and link each line back to the message it came from | Product teams translating help articles and interface strings with a fixed glossary of product names | Editors and form builders that underline grammar fixes inline, one underline per edit |
| You send | text, length, format, language | text, source, target, glossary, formality | text, language, mode |
| You get back | summary, bullets, coverage[], words | text, detected_source, target, words | text, edits[], words |
| Checked by | Every statement traced to a span of your text | Glossary terms verified, then the text translated back to compare meaning | Edits cut to the smallest diff, each with a reason |
| Points at your text with | source_span: start, end | No offsets: it returns the text | offset, length |
| Limit per request | 20,000 words, 150,000 characters | 10,000 words, 80,000 characters, 200 glossary entries | 10,000 words, 80,000 characters |
| Offsets | UTF-16 code units, the same as JavaScript string indices. An end offset is exclusive. | ||
| Meter | text.words, one meter for all three. | ||
| Answers | JSON, or a stream when the request sends Accept: text/event-stream on its own. | ||
The three operations, side by side
Summarize
POST/v1/text/summarize
- Used for
- Support tools that summarize long threads and link each line back to the message it came from
- You send
- text, length, format, language
- You get back
- summary, bullets, coverage[], words
- Checked by
- Every statement traced to a span of your text
- Points at your text with
- source_span: start, end
- Limit per request
- 20,000 words, 150,000 characters
Translate
POST/v1/text/translate
- Used for
- Product teams translating help articles and interface strings with a fixed glossary of product names
- You send
- text, source, target, glossary, formality
- You get back
- text, detected_source, target, words
- Checked by
- Glossary terms verified, then the text translated back to compare meaning
- Points at your text with
- No offsets: it returns the text
- Limit per request
- 10,000 words, 80,000 characters, 200 glossary entries
Grammar
POST/v1/text/grammar
- Used for
- Editors and form builders that underline grammar fixes inline, one underline per edit
- You send
- text, language, mode
- You get back
- text, edits[], words
- Checked by
- Edits cut to the smallest diff, each with a reason
- Points at your text with
- offset, length
- Limit per request
- 10,000 words, 80,000 characters
- Offsets
- UTF-16 code units, the same as JavaScript string indices. An end offset is exclusive.
- Meter
- text.words, one meter for all three.
- Answers
- JSON, or a stream when the request sends Accept: text/event-stream on its own.
Every statement points back. Offsets into the text you sent.
The city council approved a new bike lane on Main Street.
start 0end 57
coverage[0]"source_span": { "start": 0, "end": 57 }Construction starts in March and takes about six weeks.
start 58end 113
coverage[1]"source_span": { "start": 58, "end": 113 }Parking on the north side will be removed during the work.
start 114end 172
Not in a short summarylength: medium covers it
Each coverage entry pairs a statement with source_span, the offsets of the sentence it came from. The end is exclusive, so text.slice(start, end) gives that sentence back. Use it to light up the source, or to check a statement before you show it.
One notice through all three. Pick a call and read what it returns.
Nothing here calls the API. The short summary is the documented example. The medium summary, the translations and the draft's edits are written by hand in the real response shape, and are not model output.
text
summary
The city council approved a new bike lane on Main Street. Construction starts in March and takes about six weeks.
Coverage
112 of 172 characters traced
Not in this summary: 114 to 172
Accept: text/event-stream
{
"data": {
"summary": "The city council approved a new bike lane on Main Street. Construction starts in March and takes about six weeks.",
"coverage": [
{
"claim": "The city council approved a new bike lane on Main Street.",
"source_span": {
"start": 0,
"end": 57
}
},
{
"claim": "Construction starts in March and takes about six weeks.",
"source_span": {
"start": 58,
"end": 113
}
}
],
"words": 31
},
"meta": {
"request_id": "3f1c9a52-7d4e-4b8a-9e21-6c0d5b7a8f13",
"version": "1",
"engine": "native",
"module": "text",
"units": 31
}
}One model, a check per task. What runs between your text and the response.
We run one instruction-tuned open model on our own servers and put a check for each task after it: source tracing for summaries, glossary and back-translation for translations, a minimal diff for grammar. You pay for input words at what the stack costs us to run plus a margin.
Steps, in order:
- Your text (input)
- Split by structure (check)
- Your glossary (input)
- Task routing (check)
- Model registry (store)
- Instruction-tuned open model (model)
- Task check (check)
- Entity guard (check)
- Text with coverage or edits (output)
Connections:
- Your text to Split by structure
- Split by structure to Task routing
- Task routing to Instruction-tuned open model
- Your glossary to Instruction-tuned open model: terms
- Model registry to Instruction-tuned open model: weights
- Instruction-tuned open model to Task check
- Task check to Entity guard
- Entity guard to Text with coverage or edits
| Step | What it does | Runs on | Goes in | Comes out |
|---|---|---|---|---|
| 01 · segmentSplit by structure | Splits the text into headings, paragraphs, list items and sentences and records their offsets, so the output can keep the same shape. | CPU worker, before any model call | text | segments[] with offsets |
| 02 · routeRoute the task | Sets the task parameters: length and format for a summary, target language, formality and glossary for a translation, minimal or standard mode for grammar. | CPU worker | segments[] + request | task plan |
| 03 · generateGenerate under constraints | The instruction-tuned open model writes the output with constrained decoding, so the requested format and glossary terms hold. | Our GPU nodes | task plan | draft output |
| 04 · checkCheck the task | Summaries: every statement is traced to a source span. Translations: glossary terms are verified and the text is translated back to compare meaning. Grammar: edits are reduced to the smallest diff and each one gets a reason tag. | CPU worker plus small scoring models | draft output | checked output |
| 05 · entitiesGuard names and numbers | Compares names, numbers and other entities between input and output. | CPU worker | checked output | guarded output |
| 06 · assembleReassemble | Puts the segments back in their original order and structure, attaches coverage or edits, and counts the input words charged. With Accept: text/event-stream the text is sent in chunks as it is ready. | API node | guarded output | response |
01 · segment
Split by structure
Splits the text into headings, paragraphs, list items and sentences and records their offsets, so the output can keep the same shape.
- Runs on
- CPU worker, before any model call
- In and out
- text -> segments[] with offsets
02 · route
Route the task
Sets the task parameters: length and format for a summary, target language, formality and glossary for a translation, minimal or standard mode for grammar.
- Runs on
- CPU worker
- In and out
- segments[] + request -> task plan
03 · generate
Generate under constraints
The instruction-tuned open model writes the output with constrained decoding, so the requested format and glossary terms hold.
- Runs on
- Our GPU nodes
- In and out
- task plan -> draft output
04 · check
Check the task
Summaries: every statement is traced to a source span. Translations: glossary terms are verified and the text is translated back to compare meaning. Grammar: edits are reduced to the smallest diff and each one gets a reason tag.
- Runs on
- CPU worker plus small scoring models
- In and out
- draft output -> checked output
05 · entities
Guard names and numbers
Compares names, numbers and other entities between input and output.
- Runs on
- CPU worker
- In and out
- checked output -> guarded output
06 · assemble
Reassemble
Puts the segments back in their original order and structure, attaches coverage or edits, and counts the input words charged. With Accept: text/event-stream the text is sent in chunks as it is ready.
- Runs on
- API node
- In and out
- guarded output -> response
Three endpoints, plain HTTP. JSON in, JSON or a stream out.
All three take the same key in the x-api-key header. Branch on error.code, never on the message.
POST/v1/text/summarizeReturns the summary and traces every statement to a span of the input.
- Answers
- Sync or stream
- Meter
text.words
POST/v1/text/translateTranslates sentence by sentence and keeps structure, names and glossary terms.
- Answers
- Sync or stream
- Meter
text.words
POST/v1/text/grammarReturns the corrected text and the edits, each with an offset and a reason.
- Answers
- Sync or stream
- Meter
text.words
Request
POST/v1/text/summarizeTo stream, send Accept: text/event-stream on its own. A tie with application/json, or */*, returns JSON.
# Summarize (each statement comes back with its source span)
curl "$BASE_URL/v1/text/summarize" \
-H "x-api-key: sk_live_..." \
-H "content-type: application/json" \
-d '{"text": "The city council approved a new bike lane on Main Street. Construction starts in March and takes about six weeks. Parking on the north side will be removed during the work.", "length": "short"}'
# Translate
curl "$BASE_URL/v1/text/translate" \
-H "x-api-key: sk_live_..." \
-H "content-type: application/json" \
-d '{"text": "Good morning. The train leaves at nine.", "target": "de", "glossary": [{"from": "train", "to": "Zug"}]}'
# Correct grammar.
# Add -H "accept: text/event-stream" to any of the three to stream the text.
curl "$BASE_URL/v1/text/grammar" \
-H "x-api-key: sk_live_..." \
-H "content-type: application/json" \
-d '{"text": "i think their is a error in the the report."}'const BASE_URL = process.env.BASE_URL;
const headers = { "x-api-key": "sk_live_...", "content-type": "application/json" };
async function call(task, body) {
const res = await fetch(BASE_URL + "/v1/text/" + task, {
method: "POST",
headers,
body: JSON.stringify(body),
});
const json = await res.json();
if (!res.ok) throw new Error(json.error.code); // for example quota_exceeded
return json;
}
const summary = await call("summarize", { text: "The city council approved a new bike lane on Main Street. Construction starts in March and takes about six weeks. Parking on the north side will be removed during the work.", length: "short" });
for (const c of summary.data.coverage) console.log(c.claim, c.source_span);
const translation = await call("translate", {
text: "Good morning. The train leaves at nine.",
target: "de",
glossary: [{ from: "train", to: "Zug" }],
});
console.log(translation.data.text, translation.data.detected_source);
const grammar = await call("grammar", { text: "i think their is a error in the the report." });
for (const e of grammar.data.edits) console.log(e.offset, e.original, e.replacement, e.reason);import os
import requests
BASE_URL = os.environ["BASE_URL"]
headers = {"x-api-key": "sk_live_..."}
def call(task, body):
res = requests.post(f"{BASE_URL}/v1/text/{task}", headers=headers, json=body)
if not res.ok:
raise RuntimeError(res.json()["error"]["code"])
return res.json()
summary = call("summarize", {"text": "The city council approved a new bike lane on Main Street. Construction starts in March and takes about six weeks. Parking on the north side will be removed during the work.", "length": "short"})
for c in summary["data"]["coverage"]:
print(c["claim"], c["source_span"])
translation = call("translate", {
"text": "Good morning. The train leaves at nine.",
"target": "de",
"glossary": [{"from": "train", "to": "Zug"}],
})
print(translation["data"]["text"])
grammar = call("grammar", {"text": "i think their is a error in the the report."})
for e in grammar["data"]["edits"]:
print(e["offset"], e["original"], e["replacement"], e["reason"])Sample responses
{
"data": {
"summary": "The city council approved a new bike lane on Main Street. Construction starts in March and takes about six weeks.",
"coverage": [
{
"claim": "The city council approved a new bike lane on Main Street.",
"source_span": {
"start": 0,
"end": 57
}
},
{
"claim": "Construction starts in March and takes about six weeks.",
"source_span": {
"start": 58,
"end": 113
}
}
],
"words": 31
},
"meta": {
"request_id": "3f1c9a52-7d4e-4b8a-9e21-6c0d5b7a8f13",
"version": "1",
"engine": "native",
"module": "text",
"units": 31
}
}{
"data": {
"text": "Guten Morgen. Der Zug fährt um neun ab.",
"detected_source": "en",
"target": "de",
"words": 7
},
"meta": {
"request_id": "3f1c9a52-7d4e-4b8a-9e21-6c0d5b7a8f13",
"version": "1",
"engine": "native",
"module": "text",
"units": 7
}
}{
"data": {
"text": "I think there is an error in the report.",
"edits": [
{
"offset": 0,
"length": 1,
"original": "i",
"replacement": "I",
"reason": "capitalization"
},
{
"offset": 8,
"length": 5,
"original": "their",
"replacement": "there",
"reason": "grammar"
},
{
"offset": 17,
"length": 1,
"original": "a",
"replacement": "an",
"reason": "article"
},
{
"offset": 31,
"length": 4,
"original": " the",
"replacement": "",
"reason": "repeated_word"
}
],
"words": 10
},
"meta": {
"request_id": "3f1c9a52-7d4e-4b8a-9e21-6c0d5b7a8f13",
"version": "1",
"engine": "native",
"module": "text",
"units": 10
}
}What you are billed for
- Unit
- words
- Counted as
- Words of input text sent to summarize, translate or grammar, on the shared text.words meter. A word is a whitespace-separated token. Output words are not counted.
- Rounding
- Whole words, counted from the input before processing. A processing failure refunds the charge.
- Trial on approval
- 50,000 words
validation_error400The body is not valid, text is empty, target is missing on translate, or a field is unknown.
unauthorized401The x-api-key header is missing, revoked or wrong.
forbidden403The key or the account is not allowed to call this endpoint.
not_entitled403Your account has no active text tools plan or trial.
quota_exceeded403The text.words meter has fewer words left than the request needs.
payload_too_large413The text is over the per-request word or character limit.
rate_limited429The key sent more requests per minute than its limit.
internal_error500Something failed on our side. The charge is refunded.
provider_error502Processing failed. Retry later; the charge is refunded.
Where it stops. What it does not take.
- Per request: summarize takes up to 20,000 words (150,000 characters); translate and grammar take up to 10,000 words (80,000 characters).
- Translate accepts up to 200 glossary entries per request.
- Plain text only. There is no file upload here; send extracted text, or run the document through Smart OCR first.
- Formality applies only to target languages that distinguish it.
One meter, three tiers. Billed monthly, by invoice.
Prices are low because we run the stack ourselves. You pay our running cost plus a margin.
| Starter | Pro | Scale | |
|---|---|---|---|
| Price | $5/month | $19/month | $49/month |
| Included | 1,000,000 words | 6,000,000 words | 30,000,000 words |
| Limits | No extra limits | No extra limits | No extra limits |
| Fits | One feature, such as summaries in a support inbox | Translating a help center and the interface strings of a product | Batch summaries or translation across a document archive |
Text tools tiers, billed monthly
Starter
- Price
- $5/month
- Included
- 1,000,000 words
- Limits
- No extra limits
- Fits
- One feature, such as summaries in a support inbox
Pro
- Price
- $19/month
- Included
- 6,000,000 words
- Limits
- No extra limits
- Fits
- Translating a help center and the interface strings of a product
Scale
- Price
- $49/month
- Included
- 30,000,000 words
- Limits
- No extra limits
- Fits
- Batch summaries or translation across a document archive
Over the quota: write to us and we can raise it, or it resets next period.
All six APIs are also sold together: $19, $49 or $129 a month for the Starter, Pro or Scale quotas of every category. See the bundle on the pricing page
Offline, between releases. How the model gets retrained.
- 01Collect reviewed outputs for each task
- 02Supervised fine-tune of the instruction model
- 03Preference tuning on outputs that reviewers rejected
- 04Register the new weights in the model registry
- 05Weekly benchmark per task against external test sets
Then back to step 1, with the new reviews
Before you apply. How to check the output, and what it costs.
Will translate keep our product names?
- Pass up to 200 glossary entries, each a from and a to term, and they are translated exactly as given. Names and numbers also go through the entity guard before the response is built.
Can I see why grammar changed something?
- Each edit returns offset, length, the original text, the replacement and a reason: spelling, grammar, punctuation, capitalization, spacing, repeated_word or article. Mode minimal fixes only spacing, capitalization and repeated words.
How do I check a summary against the source?
- Every statement in coverage carries a source_span with start and end offsets. They count UTF-16 code units, the same as JavaScript string indices, so you can slice the input directly.
What counts as a word?
- Whitespace-separated tokens of the text you send. Output is not counted: you pay for the words you send, however long the result is.
What happens when my words run out?
- The API answers 403 quota_exceeded with the meter and the words left, and the request is not charged. The three endpoints share one meter. Write to us and we can raise the quota, or it resets next period.
Where does my text go?
- In production, requests run only on our own model on our own servers, so your text is not sent to a third-party model API.
Apply to use the text tools
Send an application and we review it within 72 hours. Approved accounts get credentials and a small trial, and we send invoices by hand.