# NeXT Grade API docs (all pages) Source: https://nextauto.ai/docs. Index: https://nextauto.ai/llms.txt. # NeXT Grade API Send photos of a vehicle and get back the visual damage section of a **Vehicle Asset Report**: an itemized list of each damaged part, the damage type and severity, the suggested repair action and the photo evidence for every line. - One report covers one vehicle. Photos are required. - A VIN and other vehicle details are optional and improve accuracy. Your details take priority over the VIN decode and the photos, and any disagreement is reported in the result. - Results are JSON. Every field is listed on [Results](https://nextauto.ai/docs/results). Coming soon: **OBD2 engine data** and **vehicle history** sections of the Vehicle Asset Report. Part numbers, related parts and repair cost come after that. None of these are in the API yet. ## Start here - [Quickstart](https://nextauto.ai/docs/quickstart): your first report in three steps. - [Agent quickstart](https://nextauto.ai/docs/agents): point your coding agent at these docs, or copy a ready-made prompt. - [Auth and keys](https://nextauto.ai/docs/auth): how to get approved and create a key. ## Every page - [Quickstart](https://nextauto.ai/docs/quickstart): Create a key, send photos, read the report. - [Agent quickstart](https://nextauto.ai/docs/agents): Point your agent at these docs, or copy a ready-made prompt. - [MCP server](https://nextauto.ai/docs/mcp): Connect Claude Code, Cursor, VS Code and other agents to create and read reports. - [Auth and keys](https://nextauto.ai/docs/auth): Approval, creating keys, and sending them. - [Create a report](https://nextauto.ai/docs/reports): POST /v1/analyses: request fields, waiting, fetching and safe retries. - [Results](https://nextauto.ai/docs/results): Every field in a finished report. - [Features and pipelines](https://nextauto.ai/docs/features): Which result features each pipeline returns, and the fields each adds. - [Webhooks](https://nextauto.ai/docs/webhooks): Get told when a report finishes, and check the signature. - [Usage and limits](https://nextauto.ai/docs/limits): GET /v1/usage, and the rate, daily and monthly limits. - [Errors](https://nextauto.ai/docs/errors): Every status code the API returns and what to do about it. - [Versioning](https://nextauto.ai/docs/versioning): API version dates and what can change without one. ## For agents Every page here has a Markdown copy: add `.md` to its address, or send `Accept: text/markdown`. [llms.txt](https://nextauto.ai/llms.txt) lists every page, [llms-full.txt](https://nextauto.ai/llms-full.txt) holds them all in one file, [openapi.json](https://nextauto.ai/openapi.json) describes every endpoint, and [SKILL.md](https://nextauto.ai/SKILL.md) tells an agent how to build an integration. --- # Quickstart Three steps from no account to your first report. ## 1. Get a key Sign up at [https://nextauto.ai/sign-up](https://nextauto.ai/sign-up). Once your account is approved, create a key on the [API keys](https://nextauto.ai/keys) page and keep it in an environment variable. Keys are shown once. ```bash export NEXTGRADE_KEY="your key" ``` ## 2. Send photos ```bash curl -X POST "https://nextauto.ai/v1/analyses?wait=true" \ -H "Authorization: Bearer $NEXTGRADE_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: my-first-report" \ -d '{ "images": [{ "url": "https://example.com/front.jpg" }, { "url": "https://example.com/left.jpg" }], "vehicle": { "vin": "5XYPG4A32JG427430" }, "reference": "my-first-report" }' ``` Send several photos from different sides. The first 24 are analyzed. `?wait=true` holds the call open until the report is ready, up to about 4.5 minutes; a report usually takes 1 to 4 minutes. ## 3. Read the report A finished report answers `200` with `status: "completed"`. The parts to read first: - `damages[]`: one line per damaged part, with severity, suggested action and photo evidence. - `coverage`: which views were captured and which major parts were never seen, so a missing line is never read as "no damage". - `summary`: the damage count and the lines that need a person's review. If it is still running you get `202`; fetch it later with `GET /v1/analyses/{id}`, or register a [webhook](https://nextauto.ai/docs/webhooks). Everything else is on [Results](https://nextauto.ai/docs/results). --- # Agent quickstart Building with a coding agent such as Claude Code, Cursor or Codex? Point it at these docs. Everything here is written to be read by people and agents alike. ## Tell your agent Copy a prompt into your agent. Each one points it at the right files. **Add Vehicle Asset Reports to your app** ```prompt Add NeXT Grade Vehicle Asset Reports to my app by following https://nextauto.ai/SKILL.md. My API key is in the NEXTGRADE_KEY environment variable. Never print it or commit it. ``` **Learn the API first** ```prompt Read https://nextauto.ai/llms.txt and the pages it links, then explain how I would send photos of a vehicle to the NeXT Grade API and read the damage report it returns. ``` **Grade a vehicle now** ```prompt Using the NeXT Grade API (https://nextauto.ai/docs/quickstart.md) and the key in NEXTGRADE_KEY, grade the vehicle in these photos: [photo URLs]. Wait for the report, then list the damage by part with severity and suggested action. ``` ## What agents can read - [llms.txt](https://nextauto.ai/llms.txt): the index of every page, with a line on each. - [llms-full.txt](https://nextauto.ai/llms-full.txt): every page in one file. - Markdown copies: add `.md` to any docs address, such as [https://nextauto.ai/docs/results.md](https://nextauto.ai/docs/results.md), or send `Accept: text/markdown`. - [openapi.json](https://nextauto.ai/openapi.json): every endpoint and request field, as OpenAPI 3.1. - [SKILL.md](https://nextauto.ai/SKILL.md): step-by-step instructions for building an integration. ## What a person still does An agent can't sign up for you. A person creates the account, waits for approval and creates the key on the [API keys](https://nextauto.ai/keys) page. Keep the key in an environment variable or a secrets manager; never paste it into a prompt or chat. If a key is missing or not approved, every API error says so and links to [Auth and keys](https://nextauto.ai/docs/auth). ## MCP server Agents can also create and read Vehicle Asset Reports directly through the NeXT Grade MCP server, with no code to write. See [MCP server](https://nextauto.ai/docs/mcp) to connect Claude Code, Cursor, VS Code or another agent. --- # MCP server The NeXT Grade MCP server lets an agent grade a vehicle from photos and read the Vehicle Asset Report, with no code. It uses the same account, keys, approval and limits as the API. - Address: `https://nextauto.ai/mcp` (Streamable HTTP) - Sign-in: your API key as `Authorization: Bearer `. Get one on the [API keys](https://nextauto.ai/keys) page; see [Auth and keys](https://nextauto.ai/docs/auth). - Coming soon: connecting from Claude and ChatGPT by signing in with your NeXT Grade account, without a key. ## Connect your agent Keep the key in the `NEXTGRADE_KEY` environment variable, never in a prompt or chat. **Claude Code** (`.mcp.json` in your project) ```json { "mcpServers": { "nextgrade": { "type": "http", "url": "https://nextauto.ai/mcp", "headers": { "Authorization": "Bearer ${NEXTGRADE_KEY}" } } } } ``` Claude Code reads the key from the environment when it starts. The one-line `claude mcp add --transport http nextgrade https://nextauto.ai/mcp --header "Authorization: Bearer "` also works, but it saves the key itself in Claude Code's settings file. **Cursor** (`~/.cursor/mcp.json`) ```json { "mcpServers": { "nextgrade": { "url": "https://nextauto.ai/mcp", "headers": { "Authorization": "Bearer ${env:NEXTGRADE_KEY}" } } } } ``` **VS Code** (`.vscode/mcp.json`) ```json { "servers": { "nextgrade": { "type": "http", "url": "https://nextauto.ai/mcp", "headers": { "Authorization": "Bearer ${input:nextgrade-key}" } } }, "inputs": [ { "type": "promptString", "id": "nextgrade-key", "description": "NeXT Grade API key", "password": true } ] } ``` VS Code asks for the key when the server first starts. Any other client that speaks Streamable HTTP, such as Codex, works the same way: the address above, plus the `Authorization` header. See your client's MCP docs for where that goes. ## Try it ```prompt Use the nextgrade MCP server to grade the vehicle in these photos: [photo URLs]. List the damage by part with severity and whether to repair or replace, then the tire grades. ``` ## Tools | Tool | What it does | Effect | | --- | --- | --- | | `create_vehicle_report` | Grade a vehicle from photos with NeXT Grade: an itemized list of damaged parts with severity and repair or replace, plus tire grades and paintwork where the report includes them. | Creates | | `get_vehicle_report` | Read a report by its report_id: its status while it runs, then the findings. | Reads only | | `list_vehicle_reports` | This account's reports, newest first, with status, vehicle, reference and damage count. | Reads only | | `create_photo_upload` | Make a link where a person can add photos of a vehicle from their phone or computer, with no sign-in. | Creates | | `check_photo_upload` | How many photos a person has added to an upload so far. | Reads only | | `list_report_features` | The sections a Vehicle Asset Report can include (damage list, tire grades, paintwork and more), with what each adds. | Reads only | | `get_usage` | Reports used this minute, today and this month, and the account's limits. | Reads only | `create_vehicle_report` uses one report from the account's daily limit, like `POST /v1/analyses`. `create_photo_upload` makes an upload link. The other tools only read. No tool deletes or changes anything else. ## Photos Give `create_vehicle_report` public `https` photo addresses in `photo_urls`. When the photos are on someone's phone or computer, call `create_photo_upload`: it returns a link the person opens to add up to 32 photos, with no sign-in, for an hour. Once they say they're done, pass its `upload_id` as `photo_upload_id`. Agents that can make HTTP requests can `PUT` each photo's bytes (JPEG, PNG or WebP, under 4.4 MB) to the `put_url` it returns. ## Waiting for a report A report takes 1 to 4 minutes. `create_vehicle_report` waits up to `wait_seconds` (default 45, at most 200) and returns the report, or its `report_id` while it's still running. Then call `get_vehicle_report` with that id and a `wait_seconds` of its own. Reports made through MCP also appear in `GET /v1/analyses` and fire your [webhooks](https://nextauto.ai/docs/webhooks). ## What comes back A short summary for the conversation, plus the report as JSON (`structuredContent`): the vehicle, each damaged part with its damage, severity, repair or replace and likelihood, tire grades and paintwork where the report has them, and the views the photos missed. Damage at or below the report's likelihood cutoff comes separately as `unlikely_damage`. `get_vehicle_report` with `detail: "full"` returns every field of the [result](https://nextauto.ai/docs/results), including photo evidence boxes; it is long. Findings are estimates from photos. Agents are told to say so, and to suggest a person reviews them before a price, loan or claim decision. Coming soon: **OBD2 engine data** and **vehicle history** sections of the Vehicle Asset Report. Part numbers, related parts and repair cost come after that. None of these are in the API yet. --- # Auth and keys Every API call needs a key sent as a Bearer token. ```http Authorization: Bearer ``` ## Getting a key 1. Sign up at [https://nextauto.ai/sign-up](https://nextauto.ai/sign-up). 2. Wait for approval. Until then every call answers `403`. Ask your NeXT Grade contact if it is taking a while. 3. Create a key on the [API keys](https://nextauto.ai/keys) page and copy it. It is shown once. A key belongs to you or to a company organization. An organization's keys share its usage and limits, so a whole team can use one account. ## Keeping keys safe - Keep keys in an environment variable or a secrets manager, never in code, prompts or chat. - Revoking a key on the API keys page stops it at once. ## Answers - `401`: the key is missing or invalid. - `403`: the account isn't approved yet, or it is paused. Both carry an `error` message, and a missing key or an account not yet approved also carries a `docs` link to this page. --- # Create a report `POST /v1/analyses` starts a Vehicle Asset Report from photos. (The path says analyses; each one is a report.) ## Request fields - `images` (required): 1 to 32 photos, each `{ "url": "https://..." }` or `{ "data": "", "media_type": "image/jpeg" }`. The first 24 are analyzed, and the result warns when more were sent. - `vehicle`: `vin`, `year`, `make`, `model`, `trim`, `market` (2 or 3 letters, such as `MX`) and `options` (a list of strings). All optional. - `notes`: up to 2,000 characters of context, such as "rear bumper replaced last year". - `reference`: your own id, up to 200 characters, echoed back in the result. - `features`: result features you need, such as `["tires"]`. With no `pipeline`, the default runs when it has them, and otherwise a pipeline that does. See [Features](https://nextauto.ai/docs/features). - `pipeline`: a pipeline id to pin, such as `X6`. Without it your account's default runs, else the platform's (`X6` today). Asking for a feature the pinned pipeline doesn't return answers `400`. - `interiors`: `skip` or `detect`, for pipelines with `photo_types`. `skip` leaves photos clearly sorted as interior, document or not a vehicle out of damage detection; borderline photos are always checked. ```bash curl -X POST "https://nextauto.ai/v1/analyses?wait=true" \ -H "Authorization: Bearer $NEXTGRADE_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: your-own-id-123" \ -d '{ "images": [{ "url": "https://example.com/front.jpg" }, { "url": "https://example.com/left.jpg" }], "vehicle": { "vin": "5XYPG4A32JG427430", "trim": "LX", "market": "MX" }, "notes": "Rear bumper replaced last year", "reference": "your-own-id-123", "features": ["tires"] }' ``` ## Answers - `202`: started. The body has the `analysis_id` and `status`; the `Location` and `x-analysis-id` headers point to it. - With `?wait=true` the call waits for the report, up to about 4.5 minutes: `200` when completed, `422` when the report failed, and `202` if it is still running. - `400`: the body is invalid (`issues` lists each problem), or the pinned pipeline lacks a requested feature. - Limits: `429` and `402`, see [Usage and limits](https://nextauto.ai/docs/limits). ## Fetch a report `GET /v1/analyses/{id}` returns the status (`queued`, `processing`, `completed`, `failed`), the current `stage` while it runs (`loading_photos`, `finding_damage` or `writing_report`), and the full result once completed. Only the account that created a report can read it; any other id answers `404`. For many reports, register a [webhook](https://nextauto.ai/docs/webhooks) instead of polling. If you poll, wait about 10 seconds between calls. ## List reports `GET /v1/analyses` lists your reports, newest first, with each one's `analysis_id`, `status`, `created_at`, `reference`, `vehicle` and `damage_count`. Use `limit` (1 to 100, default 20) and `status` to narrow it. When there are more, `next_before` is set: pass it as `before` for the next page. ## Safe retries Send an `Idempotency-Key` header with any unique string. Repeating the request with the same key returns the same report instead of starting, and paying for, a new one. --- # Results A completed report is one JSON object. Fields a pipeline doesn't return are left out, and every result lists its own `features`, so a missing field means the pipeline doesn't return it, not that nothing was found. Ignore fields you don't know: new features only add fields. ## Fields - `analysis_id`, `status`, `created_at` and your `reference`. - `api_version`, `features` and `versions` (the pipeline id that ran and the part vocabulary version). - `vehicle`: what you sent, the VIN decode, the values used and where each came from, conflicts, and what missing input limits. - `images[]`: each photo's view, whether it was usable and any quality issues, plus its type, paint color and cabin color where the pipeline has those features. - `damages[]`: one line per damaged part and position. Part code, side and zone, damage types, severity (`minor`, `moderate`, `severe`, `missing`) with probabilities, suggested action, option cues seen, a plain-language `description_query` and `lookup` strings for part search, confidence, review status with reasons, and photo evidence boxes. `points[]` splits a line into each separate damage on the part. - `tires`: four tires, left front first, each graded `good`, `fair`, `worn`, `replace` or `unknown` when no photo showed its tread, with flat and sidewall-damage scores and the photos used. - `paintwork`: which painted panels need paint and why, the share of the car that is, and whether a full repaint is recommended. - `coverage`: standard views captured and major parts never seen, so silence is never read as "no damage". `coverage.underside` says whether photos from below were checked: `body_checked` covers bumpers, valances and rockers seen from underneath, never the frame, exhaust or suspension; `not_assessed` means no underside photo was checked. - `rejected_findings[]`: what the check ruled out as reflections, glare, dirt and the like. Empty for pipelines with `unlikely_marks`, which keep and mark those lines instead. - `summary`: damage count, main damage zones and lines needing review. Results are for a person to review before a lending, insurance or purchase decision. Lines marked for review say why in `review.reasons`. ## Codes `GET /v1/vocabulary` lists the part codes, damage types, severities, photo types and review reasons a result can contain. ## Coming soon Coming soon: **OBD2 engine data** and **vehicle history** sections of the Vehicle Asset Report. Part numbers, related parts and repair cost come after that. None of these are in the API yet. --- # Features and pipelines A pipeline is a named version of the analysis, and each one returns a set of features. A feature names the result fields it adds. Ask for the features you need with `features` and the right pipeline runs, or pin one with `pipeline`. `GET /v1/pipelines` returns the same lists as JSON. ## Features | Feature | What it adds | Fields | | --- | --- | --- | | `damage_list` | One line per damaged part and position, with severity, action and photo evidence. | `damages[]`, `coverage`, `summary` | | `damage_points` | Each separate damage on a part, with its own types, severity and evidence. | `damages[].points[]` | | `damage_check` | How likely each sighting is real damage on the named part. | `damages[].evidence[].check.p_real`, `damages[].evidence[].check.p_on_part` | | `unlikely_marks` | Nothing is discarded: damage the check doubts stays on the list, marked for review, and rejected_findings stays empty. | `damages[].review.reasons: check_unlikely, check_doubtful` | | `photo_types` | Each photo sorted as exterior, interior, engine bay, underside, document or not a vehicle. | `images[].photo_type`, `images[].detection_skipped` | | `airbags` | Deployed driver, passenger, curtain and seat or knee airbags as damage lines. | `damages[] with part codes airbag_*` | | `second_looks` | A closer look at parts, such as lamps, where damage that looks minor can mean a replacement. | `damages[].evidence[].check.second_look` | | `photo_conditions` | The vehicle's paint color and how much glare its photos have. | `conditions`, `images[].conditions` | | `interior_color` | The cabin color, from photos sorted as interior. | `interior_color`, `images[].interior_color` | | `point_locations` | Where on the part each separate damage sits, such as lower right corner. | `damages[].points[].where_on_part` | | `tires` | Each tire graded good, fair, worn or replace, with flat and sidewall-damage scores. | `tires` | | `paintwork` | Which painted panels need paint and why, the share of the car that is, and whether a full repaint is recommended. | `paintwork` | | `likelihood` | How likely each damage and each separate damage point is to be real, and whether it counts as damage at the cutoff stamped on the run. Filter on damages[].likely for the damage to price. | `likelihood`, `damages[].likelihood`, `damages[].likely`, `damages[].points[].likelihood`, `damages[].points[].likely`, `summary.likely_damage_count`, `summary.likely_primary_damage_zone`, `summary.likely_secondary_damage_zone` | ## Pipelines The default today is `X6`. | Pipeline | Features | | --- | --- | | `X6` (default) | `damage_list`, `damage_points`, `unlikely_marks`, `tires`, `paintwork`, `likelihood` | --- # Webhooks `POST /v1/webhooks` with `{ "url": "https://...", "events": [...] }` registers an https endpoint and returns its signing secret once. Store it then; it is not shown again. ## Events - `analysis.completed`: carries the full result in `data.result`. - `analysis.failed` Both are sent by default. Failed deliveries are retried with backoff. ## Checking a delivery Each delivery carries `nextgrade-event`, `nextgrade-delivery` and `nextgrade-signature: t=,v1=`. The signature is the HMAC-SHA256 of `t + "." + body` with your secret. Check it, and reject old timestamps. ```js import { createHmac, timingSafeEqual } from "node:crypto"; function verify(body, header, secret) { const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("="))); if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; const expected = createHmac("sha256", secret).update(`${t}.${body}`).digest("hex"); return timingSafeEqual(Buffer.from(expected), Buffer.from(v1)); } ``` ## Managing endpoints `GET /v1/webhooks` lists them and `DELETE /v1/webhooks/{id}` turns one off. --- # Usage and limits `GET /v1/usage` shows reports this minute, today and this month, against your limits. ```json { "analyses_last_minute": 0, "analyses_today": 3, "analyses_this_month": 41, "limits": { "analyses_per_minute": 10, "analyses_per_day": 500 }, "paused": false } ``` Over a limit, `POST /v1/analyses` answers `429` (rate or daily limit) or `402` (monthly limit), with your current `usage` in the body. Usage and limits follow the key's owner, you or your organization. Reading reports, usage and the other lists doesn't count against them. --- # Errors Every error is JSON with an `error` message. Some add detail: `issues` for an invalid body, `usage` over a limit, and `docs` for auth problems. | Status | Meaning | What to do | | --- | --- | --- | | `400` | Invalid body, or the pinned pipeline lacks a requested feature | Fix the fields listed in `issues`, or drop `pipeline` | | `401` | Missing or invalid key | Send `Authorization: Bearer `, see [Auth and keys](https://nextauto.ai/docs/auth) | | `402` | Monthly limit reached | Wait for next month, or ask us to raise it | | `403` | Account not approved yet, or paused | Ask your NeXT Grade contact | | `404` | No such report on this account | Check the id and the key's owner | | `422` | The report failed | Read `error`; check that the photos load and show a vehicle | | `429` | Rate or daily limit | Wait and retry; see [Usage and limits](https://nextauto.ai/docs/limits) | | `500` | Our error | Retry with the same `Idempotency-Key` | | `503` | A service this deployment needs isn't configured | Contact us | --- # Versioning Every response carries `api_version` (today `2026-11-05`) and a `nextgrade-api-version` header. New pipelines and features only add fields, so the version stays the same; ignore fields you don't know. A change that renames or removes a field gets a new version date.