# Isentropic Flow API
> Isentropic compressible-flow (gas-dynamics) maths as an API, computed locally and deterministically. The isentropic endpoint gives the stagnation-to-static ratios of a perfect gas from a Mach number and the heat-capacity ratio γ (1.4 for air): the temperature ratio T0/T = 1 + (γ−1)/2·M², the pressure ratio p0/p = (T0/T)^(γ/(γ−1)), the density ratio and the area ratio A/A* relative to the sonic throat, and classifies the flow as subsonic, sonic or supersonic. The stagnation endpoint turns a static temperature and pressure plus a Mach number into the stagnation (total) conditions, the speed of sound a = √(γRT) and the flow velocity. The mach endpoint inverts the relations, solving the Mach number from a pressure, temperature or area ratio — an area ratio gives both the subsonic and supersonic roots — or from a velocity and temperature. Everything is computed locally and deterministically, so it is instant and private. Ideal for aerospace, propulsion, nozzle-design and wind-tunnel app developers, supersonic-flow and ducting tools, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is compressible isentropic flow; for the standard atmosphere use an atmosphere API and for incompressible Bernoulli flow a Bernoulli API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/isentropic-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 40,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 250,000 calls/Mo, 20 req/s
- **Mega** ($74/Mo) — 1,542,000 calls/Mo, 60 req/s

## Endpoints

### Isentropic

#### `GET /v1/isentropic` — Isentropic ratios

**Parameters:**
- `mach` (query, required, string) — Mach number Example: `2`
- `gamma` (query, optional, string) — Heat-capacity ratio γ Example: `1.4`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/isentropic-api/v1/isentropic?mach=2&gamma=1.4"
```

**Response:**
```json
{
    "data": {
        "note": "Isentropic ratios of stagnation to static for a perfect gas. A/A* is the area relative to the sonic throat.",
        "inputs": {
            "mach": 2,
            "gamma": 1.4
        },
        "flow_regime": "supersonic",
        "area_ratio_A_Astar": 1.6875,
        "pressure_ratio_p0_p": 7.824449,
        "static_to_stagnation": {
            "T_T0": 0.555556,
            "p_p0": 0.127805,
            "rho_rho0": 0.230048
        },
        "density_ratio_rho0_rho": 4.346916,
        "temperature_ratio_T0_T": 1.8
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:59.532Z",
        "request_id": "7a03ff89-c6b9-4ee7-9411-ea105aff4b38"
    },
    "status": "ok",
    "message": "Flow ratios",
    "success": true
}
```

#### `GET /v1/mach` — Solve Mach number

**Parameters:**
- `pressure_ratio` (query, optional, string) — p0/p
- `temperature_ratio` (query, optional, string) — T0/T
- `area_ratio` (query, optional, string) — A/A* Example: `1.6875`
- `velocity` (query, optional, string) — Velocity (m/s)
- `temperature` (query, optional, string) — Static temperature (K) with velocity
- `gamma` (query, optional, string) — γ Example: `1.4`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/isentropic-api/v1/mach?area_ratio=1.6875&gamma=1.4"
```

**Response:**
```json
{
    "data": {
        "note": "An area ratio A/A* ≥ 1 has two isentropic solutions — one subsonic and one supersonic.",
        "inputs": {
            "gamma": 1.4,
            "area_ratio": 1.6875,
            "solved_from": "area_ratio"
        },
        "subsonic_mach": 0.372244,
        "supersonic_mach": 2
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:59.616Z",
        "request_id": "9a3b77ef-161b-439c-b409-0023cac9f608"
    },
    "status": "ok",
    "message": "Solve Mach",
    "success": true
}
```

#### `GET /v1/stagnation` — Stagnation conditions

**Parameters:**
- `mach` (query, required, string) — Mach number Example: `2`
- `temperature` (query, optional, string) — Static temperature (K) Example: `300`
- `pressure` (query, optional, string) — Static pressure Example: `101325`
- `gamma` (query, optional, string) — γ Example: `1.4`
- `gas_constant` (query, optional, string) — R (J/kg·K) Example: `287`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/isentropic-api/v1/stagnation?mach=2&temperature=300&pressure=101325&gamma=1.4&gas_constant=287"
```

**Response:**
```json
{
    "data": {
        "note": "Stagnation (total) = static × the isentropic ratio. Speed of sound a = √(γRT); velocity = M·a.",
        "inputs": {
            "mach": 2,
            "gamma": 1.4,
            "gas_constant": 287
        },
        "velocity_ms": 694.377419,
        "static_pressure": 101325,
        "speed_of_sound_ms": 347.188709,
        "pressure_ratio_p0_p": 7.824449,
        "stagnation_pressure": 792812.3017,
        "static_temperature_k": 300,
        "density_ratio_rho0_rho": 4.346916,
        "temperature_ratio_T0_T": 1.8,
        "stagnation_temperature_k": 540
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:59.706Z",
        "request_id": "ad298dc3-ffa5-425d-8a06-96beac6e7722"
    },
    "status": "ok",
    "message": "Stagnation",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/isentropic-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "γ defaults to 1.4 (air); gas constant R defaults to 287 J/(kg·K). Temperatures in kelvin. Perfect-gas, isentropic flow.",
        "service": "isentropic-api",
        "formulae": {
            "area_ratio": "A/A* = (1/M)·[(2/(γ+1))·(T0/T)]^((γ+1)/(2(γ−1)))",
            "pressure_ratio": "p0/p = (T0/T)^(γ/(γ−1))",
            "temperature_ratio": "T0/T = 1 + (γ−1)/2·M²"
        },
        "endpoints": {
            "GET /v1/mach": "Mach number from a pressure/temperature/area ratio or velocity & temperature.",
            "GET /v1/meta": "This document.",
            "GET /v1/isentropic": "Temperature, pressure, density and area ratios from a Mach number.",
            "GET /v1/stagnation": "Stagnation/static conditions, speed of sound and velocity."
        },
        "description": "Isentropic compressible-flow (gas dynamics) calculator: stagnation-to-static ratios from Mach number, stagnation conditions with speed of sound and velocity, and the Mach number from a ratio."
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:59.797Z",
        "request_id": "406f3e73-6019-48db-8142-176abc724dfe"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/isentropic-api
OpenAPI spec: https://www.oanor.com/api/isentropic-api/openapi.json
