API Reference
OpenAPI / Swagger Reference

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:

UIURLBest for
Swagger UI/api/v1/docsExploring and testing endpoints in the browser
ReDoc/api/v1/redocClean, readable reference documentation

For the NAT SaaS platform, these are available at:

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.json

For self-hosted deployments, replace the base URL with your own host:

curl http://localhost:8080/api/v1/openapi.json -o nat-openapi.json

Import into API clients

Import the spec directly into your favorite HTTP client tool β€” no manual configuration needed.

Import from URL:

  1. Open Postman and click Import
  2. Select the Link tab and enter:
    https://api.nat-testing.io/api/v1/openapi.json
  3. Postman imports all endpoints with request schemas and example responses
  4. Create a collection variable apiKey and 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.json

Then 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-ts

Embed 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:

TagEndpoints
scansPOST /scan, GET /scan/{id}, GET /scan/{id}/results, GET /scans, GET /scan/{id}/export
functionalGET /scan/{id}/functional-results, GET /scan/{id}/visual-regression, GET /scan/{id}/accessibility, GET /scan/{id}/performance
usageGET /usage, GET /usage/alerts, GET /usage/history
billingGET /billing/status, POST /billing/checkout, POST /billing/portal
securityPOST /security-scan
llmPOST /llm/generate
healthGET /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-Key

Your key starts with nat_pk_. Obtain one from the dashboard (opens in a new tab) or the API Quickstart.


Next steps

Was this helpful?