---
title: "Decant (cascade from cylinders)"
method: POST
path: "/api/v1/decant"
---

# Decant (cascade from cylinders)

`POST /api/v1/decant`

## Request

- Base URL: `https://indamix.divingtechnics.com`
- URL: `https://indamix.divingtechnics.com/api/v1/decant`
- Auth: none required

Decanting one gas (oxygen, or helium) from source cylinders into a small cylinder without a compressor, as the app's Decant: a cascade, each cylinder equalised in turn (ideal gas). g.

## Request body

- object
  - `plan` 'refills' | 'diving_days': refills: the tank goes from start_pressure to target_pressure at every refill. diving_days: the app's Decant planner (use per day, dives a day).
  - `tank_volume_l` number: Water volume of the cylinder being refilled, litres (e.g. a rebreather's 2 or 3 L).
  - `start_pressure` number: refills: the tank's pressure before each refill (what is left after a dive), in pressure_unit. 0 = empty. This changes the result a lot: if the user did not give it, ask before calling. If you call without it, the tool assumes an empty tank and lists that in `assumed`. diving_days: its pressure now.
  - `target_pressure` number: refills: the pressure wanted after each refill, in pressure_unit (needed). diving_days: the pressure it is filled to at most.
  - `gas_o2_percent` number: O2 percent of the gas decanted (100 for oxygen, 0 for helium); only names it in the answer.
  - `gas_he_percent` number: He percent of that gas.
  - `sources` object[]: The source cylinders, each with its volume and pressure; several identical ones: one entry with count. refills: needed; opened lowest pressure first. diving_days: decanted in this order; left out = the app's defaults (listed in `assumed`).
    - `volume_l` number, required: Water volume, litres.
    - `pressure` number, required: Pressure now, in pressure_unit.
    - `count` integer: Number of identical cylinders.
    - `label` string: Name shown in the plan (e.g. "O2 3L").
    - `extra` boolean: diving_days: an Extra (reserve) cylinder; the answer says how many days it adds.
    - `included` boolean: Use this cylinder.
  - `refills` integer: refills: how many refills in a row are wanted (e.g. dives − 1). Left out: as many as the cylinders give.
  - `dives_per_day` integer: diving_days: dives a day.
  - `min_pressure_before_dive` number: diving_days: the cylinder needs at least this before a dive, in pressure_unit.
  - `use_per_day_min` number: diving_days: lowest O2 use a day, in pressure_unit of the cylinder.
  - `use_per_day_max` number: diving_days: highest O2 use a day. Give one use: both are taken as it.
  - `fill_before_every_dive` boolean: diving_days: refill before every dive (true) or once a day (false).
  - `min_pressure_to_start_day` number: diving_days, daily fill: the cylinder must start the day with at least this. Default: min_pressure_before_dive + use_per_day_max × (dives_per_day − 1) / dives_per_day.
  - `pressure_unit` 'bar' | 'psi': Unit of every pressure in the question and the answer.
  - `language` 'en' | 'hr': Language of the texts in the answer: en (English) or hr (Croatian). Use the user's language.
  - `include_steps` boolean: Also return the app's ƒx steps ("How this was calculated"): every formula with its numbers. Long: only when the user asks how it was calculated.

## Response `200`

The calculation: summary (the steps or result in the user's language), the numbers, and the analyser disclaimer to pass on. If error is set, the calculation was refused; explain message to the user.

- Answer
  - `summary` string, required: The answer as text lines, in the requested language.
  - `disclaimer` string: Always pass this on to the user.
  - `version` string: The In Da Mix version that calculated this, v<version>.<build>.
  - `excel_url` string: Link to the Excel workbook of this calculation (the app's View in Excel). Give it to the user when they want a spreadsheet or the full working.
  - `fx_steps` object[]: With include_steps: the app's ƒx steps (title, formula, values, result, detail) in the user's language.
  - `terms` string: The terms of use notice with its link: show it to the user once, with the first In Da Mix answer of a conversation.
  - `error` string: Set when the calculation was refused (an engine error code or INVALID_INPUT).
  - `message` string: Why it was refused, in the user's language.

## Other responses

- `400`: Invalid or missing input; message says what is needed.

---

[API](https://skmtc.dev/divingtechnics/apis/in-da-mix-gas-blending-calculator.md) · [All operations](https://skmtc.dev/divingtechnics/apis/in-da-mix-gas-blending-calculator/llms.txt) · [OpenAPI document](https://skmtc.dev/divingtechnics/apis/in-da-mix-gas-blending-calculator/revisions/d1610faf1201?raw)
