---
title: "What If: add gas and see the mix"
method: POST
path: "/api/v1/what_if"
---

# What If: add gas and see the mix

`POST /api/v1/what_if`

## Request

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

What mix you get when you add given pressures of oxygen, helium and/or air to what is in the tank (the app's What If): the pressure after each addition, the resulting mix, its MOD, EAD, END and gas density.

## Request body

- object
  - `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.
  - `add_oxygen` number: Pressure of pure oxygen added, in pressure_unit.
  - `add_helium` number: Pressure of pure helium added, in pressure_unit.
  - `add_air` number: Pressure of air added, in pressure_unit.
  - `helium_first` boolean: Partial pressure: add helium before oxygen (trimix, heliox).
  - `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`.
  - `target_depth` number: Depth for the gas density, in depth_unit. Default 30 m.
  - `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`.
  - `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)
