REST API for proxy automation
Purchase rotating IPv4 and IPv6 proxies, manage services, and read account state from your own code. Bearer-token authentication, predictable JSON shapes, OpenAPI 3.1 spec for code generation.
One token per key. Optional IP allowlist. 2FA-gated key creation.
Rotating proxies are created on the spot. No webhooks needed.
Generate clients in TypeScript, Python, or any OAS-compatible language.
Quickstart
- 1Top up your balance — rotating purchases via API are charged from balance (RUB).
- 2Create an API key in your dashboard. The full token is shown only once. Copy it.
- 3Make your first call:
curl https://op-proxy.com/api/v1/account \
-H "Authorization: Bearer opx_live_..."
curl https://op-proxy.com/api/v1/catalog/plans \
-H "Authorization: Bearer opx_live_..."
curl -X POST https://op-proxy.com/api/v1/purchase \
-H "Authorization: Bearer opx_live_..." \
-H "Content-Type: application/json" \
-d '{"type":"ipv4_rotating","plan_id":"<from step 2>"}'Authentication
Pass your API key in the Authorization header on every request:
Authorization: Bearer opx_live_<32 hex characters>- Keys are bound to a single account and give full control over that account. Treat them like passwords.
- You can optionally pin a key to a list of source IPs at creation time.
- Creating or revoking a key requires your account password (and TOTP if 2FA is on).
- Card / crypto / Robokassa payments are not API-callable — they require browser redirects. Top up via the dashboard.
Retries
Do not blindly retry POST /purchase or POST /extend on timeout.
Each call creates a separate service or extends by another period. If a request fails mid-flight, call GET /services first to see what happened before retrying.
Rate limits
Limits are per API key. Every response includes the rate-limit headers below. 429 responses include a Retry-After header.
| Bucket | Limit |
|---|---|
| Global | 300 req/min, 5 000 req/hour |
| POST /purchase | 60 / hour |
| POST /services/{id}/credentials | 30 / hour |
Endpoints
All endpoints accept and return JSON unless noted. Base URL: https://op-proxy.com/api/v1
/accountGet account summary
Returns your username, email, balance (RUB) and currency. Call this before /purchase to check funds.
curl https://op-proxy.com/api/v1/account \
-H "Authorization: Bearer $OPX_TOKEN"{
"status": "ok",
"data": {
"username": "alice",
"email": "alice@example.com",
"balance": 1500,
"currency": "RUB"
}
}/catalog/plansList purchasable plans
Returns only rotating plans. Filter by ?type=ipv4_rotating or ?type=ipv6_rotating.
typequerystringFilter the catalog by service type.
Enum:ipv4_rotatingipv6_rotating
curl "https://op-proxy.com/api/v1/catalog/plans?type=ipv4_rotating" \
-H "Authorization: Bearer $OPX_TOKEN"{
"status": "ok",
"data": {
"plans": [
{
"plan_id": "65a9f0c1b2c3d4e5f6a7b8c9",
"type": "ipv4_rotating",
"name": "IPv4 Rotating 100 threads",
"threads": 100,
"days": 30,
"price": 1500,
"currency": "RUB"
}
]
}
}/purchasePurchase a rotating proxy package
Charges your balance and provisions a new service. Each call creates a separate service — do NOT blindly retry on network errors; call GET /services first to check what happened.
{
"type": "ipv4_rotating",
"plan_id": "65a9f0c1b2c3d4e5f6a7b8c9",
"country": "mixed",
"rotation": "instant"
}curl -X POST https://op-proxy.com/api/v1/purchase \
-H "Authorization: Bearer $OPX_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "ipv4_rotating",
"plan_id": "65a9f0c1b2c3d4e5f6a7b8c9",
"country": "mixed",
"rotation": "instant"
}'{
"status": "ok",
"data": {
"service_id": "65aa1100b2c3d4e5f6a7b8d0",
"type": "ipv4_rotating",
"threads": 100,
"expires_at": "2026-06-17T12:34:56.000Z",
"country": "mixed",
"rotation": "instant",
"auth": { "login": "abc...", "password": "def..." },
"whitelist": []
}
}/servicesList your services
Cursor pagination. ?status=active (default), expired, or all. ?type filter, ?limit up to 100.
typequerystringFilter by service type.
Enum:ipv4_rotatingipv6_rotatingstatusquerystringFilter by lifecycle state.
Default:activeEnum:activeexpiredalllimitqueryintegerPage size. Max 100.
Default:50cursorquerystringservice_id from the previous page's next_cursor.
curl "https://op-proxy.com/api/v1/services?status=active&limit=50" \
-H "Authorization: Bearer $OPX_TOKEN"/services/{id}Get a service by id
Returns credentials, whitelist, expiry, country, rotation.
idpathstringrequired24-char hex service id from POST /purchase or GET /services.
curl https://op-proxy.com/api/v1/services/65aa1100b2c3d4e5f6a7b8d0 \
-H "Authorization: Bearer $OPX_TOKEN"/services/{id}/proxiesDownload proxy list
IPv6 services span 3 country gateways (nl/de/at), IPv4 services use the nl gateway. If the service country is "mixed" you get lines from every available country. Use ?country=nl|de|at to filter. ?format=txt (default) returns text/plain. ?format=json returns JSON with a structured servers array. ?layout=user_pass_at_host_port for URL-style. ?auth=false to omit credentials.
idpathstringrequired24-char hex service id from POST /purchase or GET /services.
formatquerystringResponse format. txt returns text/plain. json returns the structured envelope.
Default:txtEnum:txtjsonlayoutquerystringProxy line layout. host_port_user_pass = host:port:login:password. user_pass_at_host_port = login:password@host:port.
Default:host_port_user_passEnum:host_port_user_passuser_pass_at_host_portauthquerybooleanInclude login/password in each line. Set to false for IP-whitelisted use.
Default:truecountryquerystringFilter to one country's gateway. IPv6 supports nl/de/at. IPv4 supports nl.
Enum:nldeat
curl "https://op-proxy.com/api/v1/services/65aa1100b2c3d4e5f6a7b8d0/proxies?format=txt" \
-H "Authorization: Bearer $OPX_TOKEN"/services/{id}/extendExtend service by 30 days
Charges plan price. Each call adds another period — do NOT blindly retry on network errors.
idpathstringrequired24-char hex service id from POST /purchase or GET /services.
curl -X POST https://op-proxy.com/api/v1/services/65aa1100b2c3d4e5f6a7b8d0/extend \
-H "Authorization: Bearer $OPX_TOKEN"/services/{id}/whitelistReplace whitelist IPs
Full replacement (PUT, not PATCH). Max 50 entries. Optional parallel labels[] array.
idpathstringrequired24-char hex service id from POST /purchase or GET /services.
{
"whitelisted_ips": ["203.0.113.10", "198.51.100.4"],
"labels": ["home", "office"]
}curl -X PUT https://op-proxy.com/api/v1/services/65aa1100b2c3d4e5f6a7b8d0/whitelist \
-H "Authorization: Bearer $OPX_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"whitelisted_ips": ["203.0.113.10", "198.51.100.4"],
"labels": ["home", "office"]
}'/services/{id}/credentialsRegenerate login and password
Rate-limited to 30/hour per API key. Old credentials stop working immediately. Use this to rotate proxy login/password if they leak.
idpathstringrequired24-char hex service id from POST /purchase or GET /services.
curl -X POST https://op-proxy.com/api/v1/services/65aa1100b2c3d4e5f6a7b8d0/credentials \
-H "Authorization: Bearer $OPX_TOKEN"/services/{id}/countryChange country/region
IPv6-Rotating only. IPv4-Rotating always routes through the nl gateway and returns 400 unsupported_for_type.
idpathstringrequired24-char hex service id from POST /purchase or GET /services.
{ "country": "us" }curl -X PUT https://op-proxy.com/api/v1/services/65aa1100b2c3d4e5f6a7b8d0/country \
-H "Authorization: Bearer $OPX_TOKEN" \
-H "Content-Type: application/json" \
-d '{"country": "us"}'/services/{id}/rotationChange rotation mode
IPv6-Rotating only. IPv4-Rotating rotation is instant by design and returns 400 unsupported_for_type.
idpathstringrequired24-char hex service id from POST /purchase or GET /services.
{ "rotation": "instant" }curl -X PUT https://op-proxy.com/api/v1/services/65aa1100b2c3d4e5f6a7b8d0/rotation \
-H "Authorization: Bearer $OPX_TOKEN" \
-H "Content-Type: application/json" \
-d '{"rotation": "instant"}'/logsRead API action logs
Cursor pagination. ?since= / ?until= ISO timestamps. Records every API request to your account.
sincequerystring (ISO 8601)ISO-8601 timestamp. Only logs at or after this point.
untilquerystring (ISO 8601)ISO-8601 timestamp. Only logs at or before this point.
limitqueryintegerPage size. Max 200.
Default:50cursorquerystringservice_id from the previous page's next_cursor.
curl "https://op-proxy.com/api/v1/logs?limit=20" \
-H "Authorization: Bearer $OPX_TOKEN"Error codes
All error responses use the shape { status: "error", error: { code, message } }. The code field is stable and machine-readable.
| Code | HTTP | Meaning |
|---|---|---|
| invalid_token | 401 | Missing, malformed, expired, or revoked API key. Or source IP outside allowlist. |
| invalid_request | 400 | Body is not valid JSON, or required fields are missing. |
| invalid_id | 400 | Path id parameter is not a valid 24-char hex id. |
| invalid_plan_id | 400 | plan_id does not exist or does not match the requested type. |
| invalid_type | 400 | type must be ipv4_rotating or ipv6_rotating. |
| invalid_country | 400 | country must be a 2-32 char alphanumeric string. |
| invalid_rotation | 400 | rotation must be a 2-32 char alphanumeric string. |
| invalid_ip | 400 | An entry in whitelisted_ips is not a valid IPv4 address. |
| too_many_ips | 400 | Whitelist exceeds the 50-entry limit. |
| insufficient_balance | 402 | Account balance is below the plan price. Top up via the dashboard. |
| not_found | 404 | Service id does not belong to your account, or doesn't exist. |
| method_not_allowed | 405 | Wrong HTTP verb for this endpoint. |
| rate_limited | 429 | Rate limit exceeded. Check Retry-After header. |
| server_error | 500 | Unexpected error. Retry after a short delay. |
| unsupported_for_type | 400 | Operation not available for this service type (e.g. country/rotation on IPv4-Rotating). |
| country_unavailable | 400 | Requested country is not available for this service type. |
OpenAPI spec
A strict OpenAPI 3.1 spec is published at /api/v1/openapi.json. Use it to generate clients automatically:
Generates typed `fetch` definitions using openapi-typescript.
npx openapi-typescript \
https://op-proxy.com/api/v1/openapi.json \
-o opx-types.tsGenerates a typed async client with openapi-python-client.
openapi-python-client generate \
--url https://op-proxy.com/api/v1/openapi.jsonPaste this into Cursor, Claude, ChatGPT, or any AI coding tool that can fetch URLs. Produces a production-ready typed client.
Build a typed TypeScript client for the OP-Proxy v1 REST API.
Spec: https://op-proxy.com/api/v1/openapi.json
Base: https://op-proxy.com/api/v1
Auth: every request needs the header Authorization: Bearer YOUR_TOKEN where YOUR_TOKEN is read from process.env.OPX_TOKEN at runtime.
Requirements:
1. Generate types from the OpenAPI schema (use openapi-typescript or equivalent).
2. Expose one async function per operationId, named in camelCase.
3. Read the token from process.env.OPX_TOKEN; throw if missing.
4. On 2xx, return only the parsed data field. On non-2xx, throw an ApiError carrying code, message, and httpStatus. The API uses a uniform envelope: status plus an error object containing code and message.
5. Map 429 to a RateLimitError that exposes the Retry-After header value in seconds.
6. Do NOT auto-retry POST /purchase or POST /services/:id/extend on network failure. Both are non-idempotent — each retry creates a new service or extends another period. If a retry is needed, the caller should first GET /services to check what happened.
7. For GET /services/:id/proxies?format=txt return the raw text body, not the JSON envelope.
8. All prices and balances are integers in RUB (Russian rubles).
9. Honor X-RateLimit-Remaining: if it reaches 0, surface that to the caller rather than silently retrying.
Deliverable: a single client file plus the generated types file. Include a short usage example at the bottom (account balance check, list rotating plans, purchase the cheapest plan, fetch the proxy list as plain text).FAQ
Can I pay by card or crypto via the API?▾
Can I buy IPv4-Static or Datacenter IPv4 via the API?▾
Why no webhooks?▾
GET /services if you need to confirm state.