---
title: "Goal-based source picker (JSON body)"
method: POST
path: "/api/intent/solve"
tags: ["best-execution"]
---

# Goal-based source picker (JSON body)

`POST /api/intent/solve`

## Request

- Base URL: `https://api.anygas.xyz/svc`
- URL: `https://api.anygas.xyz/svc/api/intent/solve`
- Auth: none declared

State a goal, a destination and 1–10 candidate funding sources; the solver reads /compare once per source and ranks them, returning a plan with ready-to-POST execute params. It NEVER executes. Rate limit 20/min.

## Request body

- IntentRequest
  - `toChain` union, required
    - string
    - integer
  - `toToken` string, required
  - `from` object[], required: 1–10 candidate sources.
    - `chain` unknown
    - `token` string
    - `amount` string
  - `goal` 'max-output' | 'cheapest' | 'fastest'
  - `amount` string: Shared amount if sources omit their own.
  - `toAddress` string: Recipient, echoed into plan.execute.

## Response `200`

Ranked plan

- IntentPlan
  - `goal` string
  - `to` object
    - `chain` unknown
    - `token` string
  - `plan` object, nullable: Winner (null if nothing quoted). plan.execute is ready to POST to /api/route/execute.
    - `from` object
    - `rail` string
    - `estOut` string
    - `qualityScore` integer
    - `execute` object
  - `alternatives` object[]
  - `skipped` object[]
  - `sourcesConsidered` integer
  - `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)
