---
title: "Gas usage and banks for one fill"
method: POST
path: "/api/v1/gas_usage"
---

# Gas usage and banks for one fill

`POST /api/v1/gas_usage`

## Request

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

For one blend: the litres of each gas it takes from the banks, each bank's pressure afterwards, and whether a bank can still decant (or needs boosting, or runs short). Same inputs as blend, plus the banks.

## Request body

- object
  - `mix_type` 'nitrox' | 'trimix' | 'heliair' | 'heliox', required: nitrox (O2 + air), trimix (He + O2 + air), heliair (He + air), heliox (He + O2).
  - `start_pressure` number: Pressure already in the tank, 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`.
  - `start_o2_percent` number: O2 percent of the gas already in the tank (21 for air).
  - `start_he_percent` number: He percent of the gas already in the tank.
  - `target_pressure` number, required: Fill pressure wanted, in pressure_unit (e.g. 200 or 232 bar, 3000 psi).
  - `target_o2_percent` number: O2 percent of the mix wanted (nitrox, trimix, heliox).
  - `target_he_percent` number: He percent of the mix wanted (trimix, heliair, heliox).
  - `how` 'partial_pressure' | 'continuous': partial_pressure: add pure He and O2 to the tank, then top up with air. continuous: He / O2 go into the compressor intake (a premix stream).
  - `helium_first` boolean: Partial pressure: add helium before oxygen (trimix, heliox).
  - `use_booster` boolean: A gas booster is available: banks that can't decant high enough are boosted. With DIVESOFT_REAL_GAS it changes the plan; with other methods it only plans the gas.
  - `tank_volume_l` number: Water volume of the tank being filled, litres (a twin 12 = 24). Used for gas litres and bank use.
  - `method` 'IDEAL_GAS_DALTON' | 'IDEAL_GAS_Z_FACTOR' | 'VAN_DER_WAALS' | 'REDLICH_KWONG' | 'PENG_ROBINSON' | 'MULTIDECO_Z_FACTOR' | 'GASGURU_REAL_GAS' | 'GASGURU_IDEAL_GAS' | 'DIVESOFT_IDEAL_GAS' | 'DIVESOFT_REAL_GAS': Calculation method (equation of state), as in the app. Default from the In Da Mix settings (see list_methods for the current default); listed in `assumed`. IDEAL_GAS_DALTON is the simple ideal-gas method; DIVESOFT_REAL_GAS also plans the decant from the banks.
  - `temperature` number: Fill-site (ambient) temperature, in temperature_unit. Default from the In Da Mix settings; listed in `assumed`.
  - `heat_correction` boolean: Correct for the heating of the gas while filling.
  - `dive_mode` 'OC' | 'CCR': Open circuit (OC) or closed-circuit rebreather (CCR). Sets which defaults apply (from the In Da Mix settings: ppO2, END, density, O2 narcotic). The values used are listed in `assumed`.
  - `banks` object: Source banks (storage cylinders). Any bank not given is taken from the In Da Mix settings and listed in `assumed`.
    - `helium` object: The helium bank.
      - `volume_l` number: Water volume, litres (a "50 L" bank = 50; several linked cylinders = their sum).
      - `pressure` number: Current pressure, in pressure_unit.
    - `oxygen` object: The oxygen bank.
      - `volume_l` number: Water volume, litres (a "50 L" bank = 50; several linked cylinders = their sum).
      - `pressure` number: Current pressure, in pressure_unit.
    - `top_up` object: The bank the Top Up supply gas comes from.
      - `volume_l` number: Water volume, litres (a "50 L" bank = 50; several linked cylinders = their sum).
      - `pressure` number: Current pressure, in pressure_unit.
  - `pressure_unit` 'bar' | 'psi': Unit of every pressure in the question and the answer.
  - `depth_unit` 'm' | 'ft': Unit of every depth in the question and the answer.
  - `temperature_unit` 'C' | 'F': Unit of the fill temperature.
  - `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)
