# Get started

> Start the Nullgate HTTP API with one command and receive cookies or protection data through POST /solve. No SDK installation required.

The HTTP API fetches the page, finds its scripts and runs the supported flow. Your code sends one request and receives `cookies` and `result`.

## Get a key

Open [@nullgate_app](https://t.me/nullgate_app): **Keys → Create**. Top up your balance before the first solve.

## Start the server

The command installs [uv](https://docs.astral.sh/uv/) and starts the server. You do not need Git, Docker, a browser or a preinstalled Python.

```sh
curl -LsSf https://astral.sh/uv/install.sh | sh && "$HOME/.local/bin/uvx" --python 3.11 --from "nullgate-http-api @ https://github.com/nullgate-club/http-api/archive/refs/heads/main.tar.gz" nullgate-http-api
```

```powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"; & "$HOME\.local\bin\uvx.exe" --python 3.11 --from "nullgate-http-api @ https://github.com/nullgate-club/http-api/archive/refs/heads/main.tar.gz" nullgate-http-api
```

Enter your key at the hidden prompt. Keep the window open: the server listens at `http://127.0.0.1:8191`. Only the server needs the key, not your HTTP requests.

Check that it started:

```sh
curl http://127.0.0.1:8191/health
```

```powershell
Invoke-RestMethod http://127.0.0.1:8191/health
```

The response contains `{"status":"ok"}`. Press Ctrl+C to stop the server.

## Solve

Create `solve.json`. Replace `url`, `user_agent` and `proxy` with your own values. The address below is a placeholder, not a working protected page.

```json
{
  "type": "akamai",
  "url": "https://shop.example/login",
  "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36",
  "proxy": "http://user:password@proxy.example:8080",
  "session": "visit-1"
}
```

Send the file to the server:

```sh
curl http://127.0.0.1:8191/solve -H "Content-Type: application/json" --data-binary @solve.json
```

```powershell
Invoke-RestMethod http://127.0.0.1:8191/solve -Method Post -ContentType "application/json" -Body (Get-Content -Raw solve.json)
```

Every successful response has two fields:

| Field | What to do |
| --- | --- |
| `cookies` | Restore cookies in your HTTP client with their domain, path, expiry and other attributes |
| `result` | Read the selected product's result |

| `type` | Result |
| --- | --- |
| `akamai` | Cookies and `result.accepted: true` |
| `threatmetrix` | Cookies and `result.collected: true` |
| `pingone` | `result.data` to include in the application's request |
| `amazon_acic` | Cookies and `result.status: "PASS"` after verification and continuation |

Use the same user agent and proxy for subsequent requests to the site.

## Continue a session

Keep the same `session` name for one visit. If your client receives new cookies, pass them in the next `/solve`. If `_abck` becomes `-1` again, call `/solve` with the current cookies and the same session.

Omit `session` for a one-shot call. Sessions live in server memory and do not survive a restart.

## Cost and limits

The local server is free. One solve can include several billed generations at [Nullgate's prices](https://nullgate.club/en/prices).

The server does not log in to the application. A successful solve does not guarantee later requests will succeed. Unsupported flows return an error.

Next: [HTTP API fields and errors](https://nullgate.club/en/solver). SDK clients, manual generation and transport details are in [Deep](https://nullgate.club/en/deep).
