# Rocket Equation API
> Rocket-propulsion maths as an API, computed locally and deterministically. The delta-v endpoint applies the Tsiolkovsky rocket equation, Δv = ve·ln(m0/mf) with the exhaust velocity ve = Isp·g0, to give the velocity change a stage can produce from its wet (fuelled) mass, dry (burnout) mass and specific impulse — the delta-v budget that determines which manoeuvres are possible. The mass-ratio endpoint inverts the equation to give the mass ratio m0/mf = exp(Δv/ve) and the propellant mass fraction required to achieve a target delta-v, and, given a dry mass, the wet mass and propellant needed — revealing the steep, exponential tyranny of the rocket equation. The burn endpoint computes the propellant mass-flow rate ṁ = thrust/ve, the burn time and the total impulse from the thrust and propellant mass, and the delta-v if the wet mass is given. Masses are in kilograms, specific impulse in seconds, exhaust velocity and delta-v in metres per second and thrust in newtons, with standard gravity g0 = 9.80665 m/s². Everything is computed locally and deterministically, so it is instant and private. Ideal for aerospace, model-rocketry, spaceflight-simulation and orbital-mission app developers, stage-sizing and trajectory tools, and physics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is rocket propulsion; for orbital velocity and escape velocity use an orbital-mechanics 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/rocket-api/..."
```

## Pricing
- **Free** (Free) — 2,750 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 38,500 calls/Mo, 6 req/s
- **Pro** ($24/Mo) — 256,000 calls/Mo, 15 req/s
- **Mega** ($74/Mo) — 1,720,000 calls/Mo, 40 req/s

## Endpoints

### Rocket

#### `GET /v1/burn` — Burn time

**Parameters:**
- `thrust` (query, required, string) — Thrust (N) Example: `10000`
- `propellant_mass` (query, required, string) — Propellant mass (kg) Example: `600`
- `specific_impulse` (query, optional, string) — Specific impulse Isp (s) Example: `300`
- `exhaust_velocity` (query, optional, string) — Or exhaust velocity (m/s)
- `wet_mass` (query, optional, string) — Wet mass for delta-v (kg)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rocket-api/v1/burn?thrust=10000&propellant_mass=600&specific_impulse=300"
```

**Response:**
```json
{
    "data": {
        "note": "Mass flow ṁ = thrust/ve; burn time = propellant/ṁ. Total impulse = thrust × burn time. A higher Isp burns propellant more slowly for the same thrust.",
        "inputs": {
            "thrust": 10000,
            "propellant_mass": 600,
            "exhaust_velocity_ms": 2941.995
        },
        "burn_time_s": 176.5197,
        "total_impulse_ns": 1765197,
        "mass_flow_rate_kg_s": 3.399054
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:28.929Z",
        "request_id": "155d5c57-12bf-49f8-8bba-dace7e3b697c"
    },
    "status": "ok",
    "message": "Burn time",
    "success": true
}
```

#### `GET /v1/delta-v` — Tsiolkovsky delta-v

**Parameters:**
- `wet_mass` (query, required, string) — Wet mass m0 (kg) Example: `1000`
- `dry_mass` (query, required, string) — Dry mass mf (kg) Example: `400`
- `specific_impulse` (query, optional, string) — Specific impulse Isp (s) Example: `300`
- `exhaust_velocity` (query, optional, string) — Or exhaust velocity (m/s)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rocket-api/v1/delta-v?wet_mass=1000&dry_mass=400&specific_impulse=300"
```

**Response:**
```json
{
    "data": {
        "note": "Tsiolkovsky rocket equation Δv = ve·ln(m0/mf), with exhaust velocity ve = Isp·g0. The Δv budget determines what manoeuvres a stage can perform.",
        "inputs": {
            "dry_mass": 400,
            "wet_mass": 1000,
            "exhaust_velocity_ms": 2941.995
        },
        "delta_v_ms": 2695.7228,
        "mass_ratio": 2.5,
        "delta_v_kms": 2.695723,
        "propellant_mass": 600
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:29.002Z",
        "request_id": "58686881-d5a9-4a92-a24a-464976b13b9d"
    },
    "status": "ok",
    "message": "Delta-v",
    "success": true
}
```

#### `GET /v1/mass-ratio` — Mass ratio

**Parameters:**
- `delta_v` (query, required, string) — Target delta-v (m/s) Example: `2695.7`
- `specific_impulse` (query, optional, string) — Specific impulse Isp (s) Example: `300`
- `exhaust_velocity` (query, optional, string) — Or exhaust velocity (m/s)
- `dry_mass` (query, optional, string) — Dry mass to size propellant (kg) Example: `400`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rocket-api/v1/mass-ratio?delta_v=2695.7&specific_impulse=300&dry_mass=400"
```

**Response:**
```json
{
    "data": {
        "note": "Required mass ratio m0/mf = exp(Δv/ve). The propellant mass fraction 1 − mf/m0 grows steeply with Δv — the tyranny of the rocket equation.",
        "inputs": {
            "delta_v": 2695.7,
            "exhaust_velocity_ms": 2941.995
        },
        "dry_mass": 400,
        "wet_mass": 999.992267,
        "mass_ratio": 2.499981,
        "propellant_mass": 599.992267,
        "propellant_mass_fraction": 0.599997
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:29.098Z",
        "request_id": "b8404a1b-0620-4ea2-89a8-dad0862070bd"
    },
    "status": "ok",
    "message": "Mass ratio",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Masses in kg, specific impulse in s, exhaust velocity and Δv in m/s, thrust in N. Standard gravity g0 = 9.80665 m/s².",
        "service": "rocket-api",
        "formulae": {
            "burn": "ṁ = thrust/(Isp·g0) ; burn = propellant/ṁ",
            "delta_v": "Δv = Isp·g0·ln(m0/mf)",
            "mass_ratio": "m0/mf = exp(Δv/(Isp·g0))"
        },
        "constants": {
            "standard_gravity_ms2": 9.80665
        },
        "endpoints": {
            "GET /v1/burn": "Mass flow rate, burn time and total impulse from thrust and propellant.",
            "GET /v1/meta": "This document.",
            "GET /v1/delta-v": "Delta-v from wet/dry mass and specific impulse (or exhaust velocity).",
            "GET /v1/mass-ratio": "Mass ratio and propellant fraction needed for a target delta-v."
        },
        "description": "Rocket-propulsion calculator: the Tsiolkovsky delta-v from the mass ratio, the mass ratio and propellant needed for a target delta-v, and burn time and mass flow from thrust."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:29.198Z",
        "request_id": "bffa168a-0574-4654-ac09-95037dc9b62c"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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