> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://one.miles-api.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://one.miles-api.com/_mcp/server.

# Getting started

# Getting started

This guide helps you make your first authenticated call to the Miles USP `/v7` API.

## Prerequisites

* Network access to one of the [documented server environments](/welcome#base-urls).
* For user-scoped routes: a valid **Bearer JWT** (see [Authentication](/authentication)).
* For admin tooling: phone OTP login via `/v7/login-with-phone-otp` and `/v7/verify-otp`.

## 1. Smoke-test the API

Confirm the `/v7` prefix is mounted:

```bash
curl -s https://api.milescaira.com/v7/ping
```

Expected: a small JSON payload confirming the versioned surface is live.

## 2. Check health

```bash
curl -s https://api.milescaira.com/v7/health
curl -s https://api.milescaira.com/v7/health/ready
```

`/v7/health/ready` returns `503` when the database or cache is degraded.

## 3. Authenticate

Most product endpoints require:

```http
Authorization: Bearer <your-jwt>
```

Obtain a token via SSO (mobile app / web) or admin phone OTP. Details are in [Authentication](/authentication).

## 4. Call an endpoint

Example — list account-related routes are under the **Account & auth** section in the API Reference. Use the **API Explorer** on any endpoint page to send a live request with your token pre-filled.

## Regenerating the OpenAPI contract

The committed spec at `docs/openapi.yaml` is generated from the FastAPI app:

```bash
source .venv_fastapi/bin/activate
python tests/contract/generate_openapi_yaml.py
```

After regenerating, restart `fern docs dev` to pick up changes.

## Local development

```bash
source .venv_fastapi/bin/activate
uvicorn app.main:app --reload --port 8080
```

Point the API Explorer server dropdown at **Local** (`http://localhost:8080`).