> For the complete documentation index, see [llms.txt](https://docs.crosscurve.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.crosscurve.fi/developer-documentation/integration-guide-old/direct-integration-with-rest-api/routing-response.md).

# Routing Response

`POST /routing/scan/stream` streams route objects as NDJSON (newline-delimited JSON). Each line is a JSON object with either a `simulation` field (success) or an `error` field (failure). The `simulation` object contains the fields below.

`POST /routing/scan` returns all routes as a single JSON array. Each item has the same fields. Use `/routing/scan/stream` for better responsiveness — routes arrive as they are evaluated, rather than waiting for all providers to finish.

| Field                      | Type   | Description                                                      |
| -------------------------- | ------ | ---------------------------------------------------------------- |
| `query`                    | object | Echo of request parameters (`params`, `slippage`)                |
| `route`                    | array  | Ordered list of route steps (pass entire object to `/tx/create`) |
| `amountIn`                 | string | Input amount in smallest token units                             |
| `amountOut`                | string | Expected output amount in smallest token units                   |
| `amountOutWithoutSlippage` | string | Output amount without slippage applied                           |
| `tokenInPrice`             | number | USD price of the input token                                     |
| `tokenOutPrice`            | number | USD price of the output token                                    |
| `priceImpact`              | number | Price impact as a percentage                                     |
| `sourceFee`                | object | Fee charged on the source chain                                  |
| `deliveryFee`              | object | Fee for cross-chain delivery                                     |
| `slippage`                 | number | Slippage tolerance as provided in the request                    |
| `expectedFinalitySeconds`  | number | Estimated time to finality in seconds                            |
| `deadline`                 | number | Expiration timestamp in milliseconds                             |
| `signature`                | string | Encrypted signature (pass to `/tx/create` as-is)                 |
| `txs`                      | array  | Per-chain gas estimates                                          |

**Fee objects (`sourceFee`, `deliveryFee`)**

| Field    | Type   | Description                             |
| -------- | ------ | --------------------------------------- |
| `token`  | string | Token address the fee is denominated in |
| `amount` | string | Fee amount in smallest token units      |
| `usd`    | number | Fee value in USD                        |

**Gas estimate objects (`txs` array items)**

| Field            | Type   | Description                          |
| ---------------- | ------ | ------------------------------------ |
| `chainId`        | number | Chain where gas will be consumed     |
| `gasConsumption` | number | Estimated gas units                  |
| `gasFeeUsd`      | number | Gas cost in USD                      |
| `gasFeeNative`   | string | Gas cost in the chain's native token |

**Route step objects (`route` array items)**

Each step describes one leg of the swap:

| Field              | Type   | Description                                    |
| ------------------ | ------ | ---------------------------------------------- |
| `chainId`          | number | Chain where this step executes                 |
| `type`             | string | Step type (e.g. `"bridgeIn"`)                  |
| `params.tokenIn`   | object | Input token (`address`, `symbol`, `decimals`)  |
| `params.tokenOut`  | object | Output token (`address`, `symbol`, `decimals`) |
| `params.amountIn`  | string | Input amount for this step                     |
| `params.amountOut` | string | Output amount for this step                    |

> When calling `/tx/create`, pass the route object as the `routing` field. For `/routing/scan/stream`, this is the `simulation` object from each NDJSON line. For `/routing/scan`, this is an item from the response array. Do not modify or cherry-pick fields from it.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.crosscurve.fi/developer-documentation/integration-guide-old/direct-integration-with-rest-api/routing-response.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
