Annotate text
Annotate text with language corrections and semantic tags. Useful for processing colloquial transcriptions.
This endpoint requires authentication. Include your API key in the Authorization header.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | valsea-annotate | Yes | Model name. Always valsea-annotate. |
text | string | Yes | Text to annotate. |
response_format | json | verbose_json | No | Default: json |
language | string | No | Optional language hint (e.g. "singlish"). |
enable_correction | boolean | No | Enable language/grammar correction. |
enable_tags | boolean | No | Enable semantic tagging. |
Code Examples
curl -X POST https://api.valsea.ai/v1/annotations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "valsea-annotate",
"text": "Hello, world"
}'
Response
Minimal (json)
| Field | Type | Description |
|---|---|---|
text | string | The annotated (optionally corrected) text. |
annotations | array | Detected tag spans, each with start, end, tag, and phrase (non-overlapping). |
Verbose (verbose_json)
| Field | Type | Description |
|---|---|---|
text | string | The annotated (optionally corrected) text. |
raw_text | string | The original input text, before correction. |
accent_corrections | array | Corrections applied to the text. Present only when corrections are generated. |
semantic_tags | array | The semantic tags found in the text, each with its tag, phrase, and meaning. |
annotated_text | string | The input text with the detected phrases marked up with their tags. |
annotations | array | The detected phrases, each with its position (start/end), tag, and phrase. |
Errors
| Status | Description |
|---|---|
400 | Invalid request — missing/empty text, or unsupported model |
401 | Missing or invalid API key |
402 | Insufficient credits |