# AsterPay Sentiment Analysis

> AsterPay Sentiment Analysis is a paid API for AI agents from x402.asterpay.io, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Analyzes the sentiment of a text input and returns a positive/negative/neutral classification with a numeric score and optional emotion breakdown.

## Facts

- Endpoint: POST https://x402.asterpay.io/v1/ai/sentiment
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/asterpay-sentiment-analysis-df490f6d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cVx-GlI_rqqrLuIZrGjVm

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability asterpay-sentiment-analysis-df490f6d -d '<json body>'
```

Example prompt: Can you analyze the sentiment of this customer review and tell me whether it's positive, negative, or neutral along with a confidence score: 'The onboarding process was smooth but the support response times were frustratingly slow.'

## When to prefer this

Choose this endpoint when you need a fast, pay-per-call sentiment classification with a numeric polarity score and optional emotion breakdown, especially in agentic workflows where you want micropayment-native (x402/USDC) billing without managing API keys or subscriptions. Prefer it over free-tier alternatives when running in automated pipelines that benefit from per-call pricing and on-chain payment auditability.

## Known failure modes

- Empty or missing `text` field returns a validation error
- Extremely long text inputs may be truncated or rejected
- Non-English text may reduce confidence scores significantly
- Payment failure via x402 (insufficient USDC balance) blocks the request
- Ambiguous or sarcastic text may produce low confidence scores with uncertain sentiment labels

## How this service works

Analyze sentiment of text. Returns positive/negative/neutral score.

## Output

Returns a JSON object with a `sentiment` field (enum: positive, negative, neutral), a `score` number between -1 and 1 indicating sentiment polarity, a `confidence` number between 0 and 1, and optionally an `emotions` object with fine-grained emotion scores (e.g. joy, trust, surprise).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "schema": {
  "type": "object",
  "required": [
   "sentiment",
   "score"
  ],
  "properties": {
   "score": {
    "type": "number",
    "maximum": 1,
    "minimum": -1
   },
   "sentiment": {
    "enum": [
     "positive",
     "negative",
     "neutral"
    ],
    "type": "string"
   },
   "confidence": {
    "type": "number",
    "maximum": 1,
    "minimum": 0
   }
  }
 },
 "example": {
  "score": 0.85,
  "emotions": {
   "joy": 0.7,
   "trust": 0.6,
   "surprise": 0.2
  },
  "sentiment": "positive",
  "confidence": 0.92
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/asterpay-sentiment-analysis-df490f6d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.asterpay.io](https://www.zero.xyz/host/x402.asterpay.io/llms.txt)
