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

# API reference

This reference is generated from the gateway's OpenAPI specification, and it documents the gateway itself: **routing, authentication, and which credentials get injected or stripped**. Request and response schemas belong to the upstreams — their own documentation defines those.

## How to read it

Every route is a **transparent proxy**:

* Build the **upstream's own** request — path, query, body — then add your bearer token and leave the upstream's key out.
* A `200` and its body are whatever the upstream returned, verbatim. Examples shown here are representative; exact field definitions live in the provider's docs.

## Authentication

All endpoints expect `Authorization: Bearer <token>`; an unknown token answers `401`. Details: [Authentication](/authentication).

```bash
curl -X POST "https://api.nativeport.ai/serper" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"q": "apple inc"}'
```

## Base URL

```
https://api.nativeport.ai
```

Local development runs against `http://localhost:8787`.

## Common responses

| Status | Meaning                                                                                                                  |
| ------ | ------------------------------------------------------------------------------------------------------------------------ |
| `401`  | The bearer token is missing, unknown, or revoked. JSON body: `{ "error": "Unauthorized." }`.                             |
| `402`  | The credit balance is empty. Requests keep answering `402` until credits are added — never a silently degraded response. |
| `404`  | No route matched, or the matched route doesn't accept that method (an unlisted `/serper/<endpoint>`, for example).       |
| other  | The upstream's own status, passed through untouched.                                                                     |

The API Explorer fires real requests: authenticate with a live bearer token, and expect calls to credit-spending upstreams to count against the account's usage.