vitna.ai/docs/web/proxy Machine view
Raw .md llms.txt
> Source: https://vitna.ai/docs/web/proxy
> Raw Markdown: https://vitna.ai/docs/web/proxy.md
> Corpus index: https://vitna.ai/llms.txt

# Proxy access

Account-granted HTTPS CONNECT datacenter egress gateways billed to metered byte allowances.


```text
GET    /v1/proxy
GET    /v1/proxy/keys
POST   /v1/proxy/keys
DELETE /v1/proxy/keys/KEY_ID
```

Datacenter proxies from Vitna's own egress gateways, for your own HTTP
clients. The operator grants access account by account, with a monthly
allowance. The account owner then mints proxy keys with the owner token. The
key is shown once:

```bash
curl -X POST https://web.example.com/v1/proxy/keys \
  -H "Authorization: Bearer $VITNA_WEB_OWNER_TOKEN" \
  -H "Content-Type: application/json" -d '{"label":"crawler"}'
```

The response carries `username` (the account), `proxyKey`, and the key's `id`
and `label`. Connect through any gateway in `GET /v1/proxy` as an HTTPS
proxy:

```bash
curl -x "https://ACCOUNT:[email protected]:8791" https://example.com/
```

`GET /v1/proxy` returns `access` (`granted`, `suspended`, or `not_granted`),
`username`, `endpoints` (each gateway's host, port, and country), `limits`
(`monthlyBytes`, `concurrency`, `tunnelsPerMinute`), the month's
`usage.bytes`, and the keys without their secrets. Revoking a key takes
effect at every gateway within about a minute, including on tunnels already
open. Proxy routes take the owner token, never an API key, and are relayed
by the website like the other account routes.

Only HTTPS destinations are reachable: CONNECT to port 443 of a public
address. A refusal names its reason in an `X-Vitna-Error` header, listed in
the [gateway reference](../unblocker/overview.md#run-an-owned-egress-gateway).
Bytes in both directions are metered and settled hourly into the account's
statement as `proxyBytes`. They are priced per decimal GB at
`VITNA_WEB_BILLING_PROXY_GB_MICRO_USD`. Settled and still-open hours both
count against the month's allowance, which gateways enforce within about a
minute of each other.

The operator configures the grants and gateways:

```dotenv
VITNA_WEB_PROXY_ACCESS={"acct_ID":{"monthlyGb":50,"concurrency":10,"tunnelsPerMinute":600}}
VITNA_WEB_PROXY_GATEWAYS=[{"id":"egress-de","tokenHash":"GATEWAY_TOKEN_HASH","endpoint":"egress-de.example.com:8791","country":"DE"}]
VITNA_WEB_BILLING_PROXY_GB_MICRO_USD=3000000
```

| Grant field | Default | Meaning |
|---|---|---|
| `monthlyGb` | Required | Decimal GB per UTC month, 1 to 100,000 |
| `concurrency` | 10 | Tunnels open at once, 1 to 1,000 |
| `tunnelsPerMinute` | 600 | Tunnels started per minute, 1 to 100,000 |
| `suspended` | `false` | `true` stops the account's access and closes its tunnels |

A grant names an account this service holds, and public signup never
creates one. A grant is the operator's check on the customer: confirm who
the customer is and what the traffic is for before adding one. Changes take
effect on restart, and gateways see them within a minute. Each gateway's
`tokenHash` comes from `npm run egress:gateway-key` on that gateway, and its
`endpoint` is the public host and port customers connect to.
Human Machine Shift+M