> ## Documentation Index
> Fetch the complete documentation index at: https://floppydata.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> How API keys and proxy credentials are used in v2.

## API Requests

All Client API v2 endpoints require an API key in the `X-Api-Key` header.

```bash theme={null}
curl --request GET \
  --url "https://api.floppydata.net/v2/account/balances" \
  --header "X-Api-Key: YOUR_API_KEY"
```

Create or copy API keys in [API keys](https://app.floppydata.com/api-keys).

## Proxy Connections

Proxy tools and proxy traffic use proxy username/password credentials inside the proxy URL.

```text theme={null}
http://USERNAME:PASSWORD@HOST:PORT
```

You do not need to manage proxy usernames through Client API v2. For rotating proxies, call `POST /v2/proxy/rotating/connections` and copy `connection.connectionString` from the response.

```json theme={null}
{
  "connection": {
    "protocol": "http",
    "host": "geo.g-w.info",
    "port": 10080,
    "username": "user-USERNAME-type-residential-country-US-rotation-15",
    "password": "PASSWORD",
    "connectionString": "http://user-USERNAME-type-residential-country-US-rotation-15:PASSWORD@geo.g-w.info:10080"
  }
}
```

For static proxies, call `GET /v2/proxy/static` and copy `items[n].connection.connectionString`.

## Cloud Browser Connections

Cloud Browser control requests use the Client API key. Creating or getting an active session returns a signed `connectUrl` for Playwright or Puppeteer.

Do not add `X-Api-Key` to the WebSocket connection. The signed URL authorizes only that session and expires with it. Use the URL exactly as returned, keep it out of logs, and get the active session again when you need a fresh URL.

## Which Credential Goes Where

| Credential                    | Where to use it                        | Example                                       |
| ----------------------------- | -------------------------------------- | --------------------------------------------- |
| API key                       | Client API request header              | `X-Api-Key: YOUR_API_KEY`                     |
| Proxy username/password       | Proxy connection URL                   | `http://USERNAME:PASSWORD@geo.g-w.info:10080` |
| Signed browser connection URL | Playwright or Puppeteer CDP connection | `connectOverCDP(connectUrl)`                  |

<Warning>
  Do not place your API key inside a proxy connection string. Do not send proxy passwords in the `X-Api-Key` header. Treat signed browser connection and live-view URLs as temporary secrets: do not log, publish, or reuse them for another session.
</Warning>

## Test API Access

```bash theme={null}
curl --request GET \
  --url "https://api.floppydata.net/v2/account/balances" \
  --header "X-Api-Key: YOUR_API_KEY"
```

## Test Proxy Access

Use the proxy URL returned by the API.

```bash theme={null}
curl --proxy "http://USERNAME:PASSWORD@geo.g-w.info:10080" \
  "https://example.com"
```

Or check the proxy through the Client API:

```bash theme={null}
curl --request POST \
  --url "https://api.floppydata.net/v2/proxy/check" \
  --header "Content-Type: application/json" \
  --header "X-Api-Key: YOUR_API_KEY" \
  --data '{
    "connectionString": "http://USERNAME:PASSWORD@geo.g-w.info:10080"
  }'
```
