# Bézier Curve API
> Bézier-curve geometry maths as an API, computed locally and deterministically. The point endpoint evaluates a quadratic (three control points) or cubic (four) Bézier curve at a parameter t between 0 and 1 using de Casteljau's algorithm, returning the point on the curve and the tangent there — its direction vector, angle and speed (the derivative B'(t)). The length endpoint computes the arc length of the curve by fine polyline sampling, together with the straight-line chord length and the axis-aligned bounding box (min and max x and y, width and height). The split endpoint splits the curve at a parameter into two sub-curves and returns the control points of each — the standard de Casteljau subdivision used for trimming and adaptive rendering. Control points are passed as plain x/y coordinates. Everything is computed locally and deterministically, so it is instant and private. Ideal for graphics, CAD, font, animation, game-engine and vector-design app developers, path and curve tools, and computational-geometry education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is Bézier-curve geometry; for animation easing and timing functions use an easing 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/bezier-api/..."
```

## Pricing
- **Free** (Free) — 3,000 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 40,000 calls/Mo, 5 req/s
- **Pro** ($15/Mo) — 250,000 calls/Mo, 15 req/s
- **Mega** ($49/Mo) — 1,542,000 calls/Mo, 40 req/s

## Endpoints

### Bezier

#### `GET /v1/length` — Arc length & bbox

**Parameters:**
- `x0` (query, required, string) — Start point x Example: `0`
- `y0` (query, required, string) — Start point y Example: `0`
- `x1` (query, required, string) — Control 1 x Example: `0`
- `y1` (query, required, string) — Control 1 y Example: `1`
- `x2` (query, required, string) — Control 2 / end x Example: `1`
- `y2` (query, required, string) — Control 2 / end y Example: `1`
- `x3` (query, optional, string) — End x (cubic) Example: `1`
- `y3` (query, optional, string) — End y (cubic) Example: `0`
- `steps` (query, optional, string) — Sampling steps Example: `2000`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bezier-api/v1/length?x0=0&y0=0&x1=0&y1=1&x2=1&y2=1&x3=1&y3=0&steps=2000"
```

**Response:**
```json
{
    "data": {
        "note": "Arc length from fine polyline sampling (default 2000 steps). Bounding box from the sampled points.",
        "inputs": {
            "steps": 2000,
            "degree": 3
        },
        "arc_length": 2,
        "bounding_box": {
            "max_x": 1,
            "max_y": 0.75,
            "min_x": 0,
            "min_y": 0,
            "width": 1,
            "height": 0.75
        },
        "chord_length": 1
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:03.377Z",
        "request_id": "76d04365-4fdb-4691-b395-105987d0669b"
    },
    "status": "ok",
    "message": "Arc length",
    "success": true
}
```

#### `GET /v1/point` — Point & tangent at t

**Parameters:**
- `x0` (query, required, string) — Start point x Example: `0`
- `y0` (query, required, string) — Start point y Example: `0`
- `x1` (query, required, string) — Control 1 x Example: `0`
- `y1` (query, required, string) — Control 1 y Example: `1`
- `x2` (query, required, string) — Control 2 / end x Example: `1`
- `y2` (query, required, string) — Control 2 / end y Example: `1`
- `x3` (query, optional, string) — End x (cubic) Example: `1`
- `y3` (query, optional, string) — End y (cubic) Example: `0`
- `t` (query, required, string) — Parameter 0–1 Example: `0.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bezier-api/v1/point?x0=0&y0=0&x1=0&y1=1&x2=1&y2=1&x3=1&y3=0&t=0.5"
```

**Response:**
```json
{
    "data": {
        "x": 0.5,
        "y": 0.75,
        "note": "Point via de Casteljau; tangent is the first derivative B'(t). Degree 2 = quadratic, 3 = cubic.",
        "inputs": {
            "t": 0.5,
            "degree": 3,
            "control_points": 4
        },
        "tangent": {
            "dx": 1.5,
            "dy": 0,
            "speed": 1.5,
            "angle_deg": 0
        }
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:03.488Z",
        "request_id": "5463a626-82e1-4c46-8a25-f1a597a725dc"
    },
    "status": "ok",
    "message": "Curve point",
    "success": true
}
```

#### `GET /v1/split` — Split at t

**Parameters:**
- `x0` (query, required, string) — Start point x Example: `0`
- `y0` (query, required, string) — Start point y Example: `0`
- `x1` (query, required, string) — Control 1 x Example: `0`
- `y1` (query, required, string) — Control 1 y Example: `1`
- `x2` (query, required, string) — Control 2 / end x Example: `1`
- `y2` (query, required, string) — Control 2 / end y Example: `1`
- `x3` (query, optional, string) — End x (cubic) Example: `1`
- `y3` (query, optional, string) — End y (cubic) Example: `0`
- `t` (query, required, string) — Parameter 0–1 Example: `0.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bezier-api/v1/split?x0=0&y0=0&x1=0&y1=1&x2=1&y2=1&x3=1&y3=0&t=0.5"
```

**Response:**
```json
{
    "data": {
        "note": "de Casteljau split at t: left_curve and right_curve share the split point and together reproduce the original.",
        "inputs": {
            "t": 0.5,
            "degree": 3
        },
        "left_curve": [
            {
                "x": 0,
                "y": 0
            },
            {
                "x": 0,
                "y": 0.5
            },
            {
                "x": 0.25,
                "y": 0.75
            },
            {
                "x": 0.5,
                "y": 0.75
            }
        ],
        "right_curve": [
            {
                "x": 0.5,
                "y": 0.75
            },
            {
                "x": 0.75,
                "y": 0.75
            },
            {
                "x": 1,
                "y": 0.5
            },
            {
                "x": 1,
                "y": 0
            }
        ],
        "split_point": {
            "x": 0.5,
            "y": 0.75
        }
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:03.574Z",
        "request_id": "649f0ab6-b241-4d68-b87b-4fb33e4ac544"
    },
    "status": "ok",
    "message": "Split curve",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Control points as x0,y0,x1,y1,x2,y2 (quadratic) plus x3,y3 (cubic). Parameter t in [0,1]. 2D curves.",
        "service": "bezier-api",
        "formulae": {
            "cubic": "B(t) = (1−t)³P₀ + 3(1−t)²t·P₁ + 3(1−t)t²·P₂ + t³P₃",
            "quadratic": "B(t) = (1−t)²P₀ + 2(1−t)t·P₁ + t²P₂",
            "derivative_cubic": "B'(t) = 3(1−t)²(P₁−P₀) + 6(1−t)t(P₂−P₁) + 3t²(P₃−P₂)"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/point": "Point (x,y) and tangent on the curve at parameter t (de Casteljau).",
            "GET /v1/split": "Split the curve at t into two sub-curves' control points.",
            "GET /v1/length": "Arc length and axis-aligned bounding box of the curve."
        },
        "description": "Bézier-curve geometry calculator: evaluate a point and tangent at a parameter, the arc length and bounding box, and split a quadratic or cubic curve at a parameter."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:03.686Z",
        "request_id": "cc5170b7-0dee-4311-8d99-cc8f2f95a5da"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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