---
title: "Plan a multi-leg payout (gated, dry-run by default)"
method: POST
path: "/api/route/batch"
tags: ["primitives"]
---

# Plan a multi-leg payout (gated, dry-run by default)

`POST /api/route/batch`

## Request

- Base URL: `https://api.anygas.xyz/svc`
- URL: `https://api.anygas.xyz/svc/api/route/batch`
- Auth: none declared

Plans a multi-recipient/multi-leg payout (up to 20 legs), each via /compare. Plans & stores only — it does NOT move funds. Execution needs the watcher running with PRIMITIVES_LIVE=1 AND the record carrying live:true; the shipped default (live:false) simulates every tick. Rate limit 30/min.

## Request body

- BatchRequest
  - `routes` object[], required: Up to 20 legs; toAddress required per leg.
    - `fromChain` unknown
    - `fromToken` string
    - `toChain` unknown
    - `toToken` string
    - `amount` string
    - `toAddress` string
  - `live` boolean: Ignored unless the watcher runs with PRIMITIVES_LIVE=1.

## Response `200`

Planned batch record

- BatchResult
  - `id` string
  - `status` string
  - `live` boolean
  - `legs` object[]
  - `warnings` string[]
  - `note` string

---

[API](https://skmtc.dev/anygas/apis/robyn-anygas-api.md) · [All operations](https://skmtc.dev/anygas/apis/robyn-anygas-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anygas/apis/robyn-anygas-api/revisions/9b7498be8304?raw)
