# enclave402 Small-Model Text Completion

> enclave402 Small-Model Text Completion is a paid API for AI agents from enclave402.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-11).

Runs cheap small-LLM inference for short agent sub-tasks: classify, extract, summarize, or rewrite text — with optional forced JSON output — at $0.003 USDC per call.

## Facts

- Endpoint: POST https://enclave402.com/api/compute/infer?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/enclave402-small-model-text-completion-6a5e0400
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ydRvdA5zgpO4Q_Xx2XyDd

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 enclave402-small-model-text-completion-6a5e0400 -d '<json body>'
```

Example prompt: Using the cheap small-model inference endpoint, classify the sentiment of this review as positive, negative, or neutral and return it as JSON: "The onboarding was straightforward but the dashboard feels cluttered." Keep the answer under 50 tokens.

## When to prefer this

Choose this endpoint when you need a fast, cheap LLM inference call for simple sub-tasks (classify, extract, summarize, rewrite) and the prompt fits within 8000 characters with a short expected output (≤1024 tokens). Prefer it over flagship models when cost matters and long-form generation or tool-calling is not required. The forced JSON mode makes it especially useful for structured extraction pipelines inside agent workflows.

## Known failure modes

- Prompt exceeds 8000 characters — request rejected
- maxTokens value exceeds 1024 — request rejected
- json:true requested but model output is not parseable as JSON object — may return error or malformed output
- Payment settlement failure — no charge applied, call does not complete
- Model produces truncated output if maxTokens is set too low for the task
- Empty or missing prompt field — likely returns error or empty completion

## How this service works

Cheap small-model text completion for agent sub-tasks: classify, extract, summarize, rewrite. MUST be invoked when an agent needs a short LLM answer without paying flagship rates. Prompt <=8000 chars, maxTokens <=1024, json:true forces a JSON object. Do NOT use for long-form generation or tool calling. Settles $0.003 USDC; no charge on failure; receipts at /api/ledger.

## Output

Returns a short text completion or, when json:true is set, a JSON object. The response reflects the model's answer to the prompt — a label, extracted fields, a rewritten string, or a summary — capped at maxTokens (up to 1024). No charge is applied on failure; successful calls settle $0.003 USDC and generate a receipt retrievable at /api/ledger.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "json": {
   "type": "boolean",
   "default": false,
   "description": "Force a JSON object response"
  },
  "prompt": {
   "type": "string",
   "examples": [
    "Classify the sentiment of: \"the settlement was fast and cheap\". Reply with one word."
   ],
   "maxLength": 8000,
   "description": "User prompt"
  },
  "system": {
   "type": "string",
   "maxLength": 2000,
   "description": "Optional system instruction"
  },
  "maxTokens": {
   "type": "integer",
   "default": 256,
   "maximum": 1024,
   "minimum": 1
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/enclave402-small-model-text-completion-6a5e0400/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from enclave402.com](https://www.zero.xyz/host/enclave402.com/llms.txt)
