OpenAPI / Swagger Reference
NAT automatically generates an OpenAPI 3.1 specification for its REST API. You can use this spec to explore all available endpoints interactively, or to generate a fully typed client in any language.
Live interactive docs
NAT ships two interactive API documentation UIs out of the box:
| UI | URL | Best for |
|---|---|---|
| Swagger UI | /api/v1/docs | Exploring and testing endpoints in the browser |
| ReDoc | /api/v1/redoc | Clean, readable reference documentation |
For the NAT SaaS platform, these are available at:
- Swagger UI: https://api.nat-testing.io/api/v1/docs (opens in a new tab)
- ReDoc: https://api.nat-testing.io/api/v1/redoc (opens in a new tab)
To authenticate in Swagger UI, click Authorize and enter your API key in the X-API-Key field. All requests you send from the UI will include your key automatically.
Download the spec
The raw OpenAPI JSON spec is always available at /api/v1/openapi.json.
curl https://api.nat-testing.io/api/v1/openapi.json -o nat-openapi.jsonFor self-hosted deployments, replace the base URL with your own host:
curl http://localhost:8080/api/v1/openapi.json -o nat-openapi.jsonImport into API clients
Import the spec directly into your favorite HTTP client tool β no manual configuration needed.
Import from URL:
- Open Postman and click Import
- Select the Link tab and enter:
https://api.nat-testing.io/api/v1/openapi.json - Postman imports all endpoints with request schemas and example responses
- Create a collection variable
apiKeyand add a Pre-request Script to inject the header:pm.request.headers.add({ key: "X-API-Key", value: pm.collectionVariables.get("apiKey"), });
Import from file:
curl https://api.nat-testing.io/api/v1/openapi.json -o nat-openapi.jsonThen in Postman: Import β File β select nat-openapi.json.
Generate a client from the spec
Use the downloaded spec to generate a typed client in your language of choice.
openapi-generator (opens in a new tab) supports 50+ languages and frameworks.
# Install
npm install -g @openapitools/openapi-generator-cli
# Generate a Python client
openapi-generator-cli generate \
-i https://api.nat-testing.io/api/v1/openapi.json \
-g python \
-o ./nat-client-python
# Generate a TypeScript/Axios client
openapi-generator-cli generate \
-i https://api.nat-testing.io/api/v1/openapi.json \
-g typescript-axios \
-o ./nat-client-tsEmbed the Swagger UI in your own site
If you are running a self-hosted NAT deployment, you can embed the Swagger UI iframe directly:
<iframe
src="https://api.nat-testing.io/api/v1/docs"
width="100%"
height="800px"
style="border: none;"
title="NAT API Reference"
></iframe>Or link to it from your internal developer portal:
[NAT API Reference](https://api.nat-testing.io/api/v1/docs)Spec structure overview
The spec is organized into the following tag groups:
| Tag | Endpoints |
|---|---|
scans | POST /scan, GET /scan/{id}, GET /scan/{id}/results, GET /scans, GET /scan/{id}/export |
functional | GET /scan/{id}/functional-results, GET /scan/{id}/visual-regression, GET /scan/{id}/accessibility, GET /scan/{id}/performance |
usage | GET /usage, GET /usage/alerts, GET /usage/history |
billing | GET /billing/status, POST /billing/checkout, POST /billing/portal |
security | POST /security-scan |
llm | POST /llm/generate |
health | GET /health |
Use the tag filter in Swagger UI to focus on one group at a time, or use the sidebar in ReDoc to jump directly to any endpoint. The functional tag covers all visual regression, accessibility, and performance endpoints.
Authentication in the spec
All endpoints (except GET /health) require the X-API-Key header:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-KeyYour key starts with nat_pk_. Obtain one from the dashboard (opens in a new tab) or the API Quickstart.
Next steps
- API Quickstart β end-to-end walkthrough with curl, Python, and JavaScript
- Functional Testing API β visual regression, accessibility, and performance endpoints
- Scan API β full request/response schemas for scan endpoints
- Usage & Quotas API β monitor quota and usage
- Billing API β manage subscriptions programmatically
- Code Examples β copy-paste-ready examples for every language