Sentiment Analysis
Read the sentiment of a text (positive, negative, neutral or mixed) with confidence scores and the sentiment towards each aspect.
Pay by wallet (x402) AI-generated
sentiment-analyze Example
Example answer
{
"scores": {
"neutral": 0.95,
"negative": 0,
"positive": 0.05
},
"aspects": [
{
"aspect": "purpose of the text",
"sentiment": "neutral",
"text_span": "test input for automated capability testing"
}
],
"summary": "The text is neutral in sentiment, describing a technical testing scenario without expressing any emotional valence.",
"sentiment": "neutral",
"confidence": 0.95,
"detected_language": "English"
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
text | string | Yes | Text to analyze |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
scores | object | Always (present in every successful answer) |
aspects | array | Always (present in every successful answer) |
sentiment | string | Always (present in every successful answer) |
confidence | number | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "sentiment-analyze",
"inputs": {
"text": "This is a test input for automated capability testing."
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "sentiment-analyze",
"inputs": {
"text": "This is a test input for automated capability testing."
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "sentiment-analyze",
inputs: {
"text": "This is a test input for automated capability testing."
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="sentiment-analyze",
inputs={
"text": "This is a test input for automated capability testing.",
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/sentiment-analyze?text=This+is+a+test+input+for+automated+capability+testing.' Limitations
Sarcasm and cultural expressions can be misread
AI-based sentiment — sarcasm, irony, and culturally-specific expressions may be misinterpreted
What to do instead: Use the confidence score in the response and flag low-confidence results for human review in critical applications
Related tools
- Text Classification €0.05
- Text Summary €0.05
- Translation €0.05