PacketStream documentation
Check your balance
Read your PacketStream account balance in US dollars with one free API call. The same balance pays for proxy traffic and for Search, Fetch, and MCP calls.
Your PacketStream account has one prepaid balance. It pays for proxy traffic and for Search, Fetch, and MCP calls. One API call returns it, so a script can warn you before it runs out.
1. Get an API key
The call needs an API key. This is not your proxy auth key.
- Sign in and open the Search API page of the dashboard.
- Select Generate key.
- Copy the key. It is shown only once.
Every customer and reseller account can create a key, even if you only use the proxy. The key is free. Your account has one key, and the Fetch API and MCP pages show the same one. If you already have a key, use it. Rotate key replaces it, and the old key stops working at once.
Load the key into your shell without writing it into the command history:
read -r -s -p 'PacketStream API key: ' PACKETSTREAM_API_KEY
printf '\n'
export PACKETSTREAM_API_KEY
2. Read the balance
curl -s https://api.packetstream.io/v1/account \
-H "Authorization: Bearer $PACKETSTREAM_API_KEY"
The response, trimmed to the balance:
{
"request_id": "6f1c2a9e-4b7d-4e3a-9c8f-2d5b1e0a7c34",
"account": {
"balance_usd": 48.2175
}
}
To print only the number, add | jq '.account.balance_usd' to the command.
balance_usdis in US dollars, rounded down to four decimals.- It is your whole account balance, the total on the dashboard’s Balance card. Proxy traffic, searches, and fetches all draw from it.
- The call is free and does not count against your key’s rate limit.
- The full response also has your API usage counts, the price per 1,000 calls, and the key’s rate limit. See the account endpoint.
Errors
401 unauthorizedmeans the key is missing, wrong, or revoked. Check the header, or create a new key on the dashboard.500 internal_errormeans the balance could not be read just now. The API never returns 0 in its place. Try again later.
When the balance runs out
- HTTP and HTTPS proxy requests fail with
502 Proxy Error (no funds available). - SOCKS5 authentication fails, just as it does with a wrong password.
- An open proxy connection closes the next time it sends or receives data.
- Search and Fetch calls fail with
402 insufficient_balance. They are not billed.
Add funds on the Deposit page.
Resellers can also read the reseller balance, in USD cents, from the Reseller API.