# Inference402 Sentiment Analysis

> Inference402 Sentiment Analysis is a paid API for AI agents from inference402.worlddata402.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-19).

Analyzes a text string and returns a sentiment label (positive/negative/neutral) with a numeric confidence score, powered by Llama 3.1 8B, paid per-call via USDC on Base.

## Facts

- Endpoint: GET https://inference402.worlddata402.workers.dev/v1/sentiment?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/inference402-sentiment-analysis-d2f1323b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_so74AbXaZB0FSEvjpDIzI

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 inference402-sentiment-analysis-d2f1323b
```

Example prompt: Can you analyze the sentiment of this customer review and give me a score: 'The product arrived quickly and works perfectly, but the packaging was a bit flimsy'?

## When to prefer this

Choose this endpoint when you need lightweight, pay-as-you-go sentiment analysis with no API key or account setup, paying $0.002 USDC per call on Base mainnet. Ideal for agents that need occasional or burst sentiment classification without committing to a subscription, or for autonomous agents that can self-fund inference via x402. Prefer over heavier NLP pipelines when a fast scalar sentiment score (label + confidence) is sufficient and you do not need entity-level or aspect-level breakdown.

## Known failure modes

- Text exceeds 8000 character limit — request rejected
- Payment not received or USDC balance insufficient — 402 Payment Required response
- Empty or missing 'text' parameter — likely returns an error or unexpected sentiment
- Model inference timeout on very dense or complex text
- Non-English text may yield lower accuracy sentiment scores (model is optimized for English)

## How this service works

Pay-per-call AI inference for agents: chat (Llama 3.3 70B / 3.1 8B), structured JSON, summarize, translate (incl. Egyptian Arabic), extract, classify, sentiment, keywords, rewrite, embeddings, moderation, vision and speech-to-text. USDC on Base mainnet over x402. No API key, no account.

## Output

Returns a JSON object with three fields: 'sentiment' (a label such as 'positive', 'negative', or 'neutral'), 'score' (a float between 0 and 1 indicating confidence), and 'model' (the specific Llama model variant used, e.g. '@cf/meta/llama-3.1-8b-instruct-fp8').

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "@cf/meta/llama-3.1-8b-instruct-fp8",
  "score": 0.82,
  "sentiment": "positive"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/inference402-sentiment-analysis-d2f1323b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from inference402.worlddata402.workers.dev](https://www.zero.xyz/host/inference402.worlddata402.workers.dev/llms.txt)
