# Animica Train — ML Model Fine-Tuning via x402

> Animica Train — ML Model Fine-Tuning via x402 is a paid API for AI agents from animica.dev, paid per call via x402, $1/call, status unknown (last checked 2026-09-15).

Fine-tune or extend an Animica ML model (linear head or LoRA head) on a labeled dataset, paying per training run via x402.

## Facts

- Endpoint: POST https://animica.dev/x402/train
- Price: $1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/animica-train-ml-model-fine-tuning-via-x402-7673c583
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_an9F7jp5pMGSwk3AVL9w5

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 animica-train-ml-model-fine-tuning-via-x402-7673c583 -d '<json body>'
```

Example prompt: Train a linear_head classifier on my dataset — texts are ['buy now','great deal','spam offer'] with labels [1,1,1] and targets of 0.92 accuracy within 3600 seconds, budget $1 USDC — use Animica's training endpoint and return the resulting model ID.

## When to prefer this

Choose this endpoint when you need to fine-tune or adapt an ML model on your own labeled dataset without managing GPU infrastructure, and want pay-per-call pricing with no upfront commitment. Prefer it over generic cloud ML platforms when you want to build on an existing Animica model baseline, need crypto-native payment (USDC via x402), or want to chain training with other Animica services like inference, blob storage, or prediction markets in a single agent workflow.

## Known failure modes

- Insufficient budget: training job exceeds the specified USDC amount before reaching target metric
- Invalid task type: task field must be exactly 'linear_head' or 'lora_head'
- Dataset format error: texts and labels arrays must be non-empty and equal length
- Timeout: training exceeds max_duration_seconds without reaching target_score
- Invalid model_id: referenced base model does not exist or is inaccessible
- Payment failure: x402 payment of $1 USDC not confirmed before job starts
- Stale quote_id: quote has expired and must be refreshed from /x402/train/quote

## How this service works

Animica Python Cloud: deploy a Python function to animica.dev, get a public endpoint, and earn ANM every time someone runs it. Free AI (OpenAI-compatible, no key), free scheduled Workers, and an 80/20 developer split.

## Output

Returns a JSON object containing the trained model's ID, achieved metric score, training duration, and status. The model can subsequently be referenced by model_id for inference calls or further fine-tuning iterations.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "task": {
   "type": "string",
   "description": "linear_head | lora_head"
  },
  "budget": {
   "type": "object",
   "description": "{\"amount\":\"1.00\",\"currency\":\"USDC\"}"
  },
  "dataset": {
   "type": "object",
   "description": "{\"texts\":[...],\"labels\":[...]}"
  },
  "model_id": {
   "type": "string",
   "description": "improve an existing Animica model instead of creating one; the baseline becomes that model"
  },
  "quote_id": {
   "type": "string",
   "description": "a quote from POST /x402/train/quote; without one the request is priced at the default budget"
  },
  "requirements": {
   "type": "object",
   "description": "{\"target_metric\":\"accuracy\",\"target_score\":0.92,\"max_duration_seconds\":3600}"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/animica-train-ml-model-fine-tuning-via-x402-7673c583/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from animica.dev](https://www.zero.xyz/host/animica.dev/llms.txt)
