# Batches

Run a file of requests in the background at 50% off, with automatic and manual retry.

POST /batches. Run a file of requests in the background at 50% off. Also GET /batches, GET /batches/{id}, POST /batches/{id}/cancel and POST /batches/{id}/retry.

```bash
curl -X POST https://api.clod.io/v1/batches \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input_file_id": "file-abc123",
  "endpoint": "/v1/chat/completions",
  "completion_window": "24h"
}'
```

If a batch stalls or a model server fails, CLōD waits, then sends the batch again, up to 3 attempts, preferring servers that finished batches quickly. You can also call POST /batches/{id}/retry on a failed, expired or cancelled batch. A retry sends only the lines that did not finish, and you pay only for those lines.
