Skip to content
Guide

Oxylabs Residential Proxies with NSLSolver: Kasada Headers, Akamai Cookies and cf_clearance in Python and Node.js

NSLSolver TeamPublished 9 min read

Oxylabs serves its residential proxies through the entry point pr.oxylabs.io:7777 and controls targeting with parameters in the username: cc for the country, city, st for US states, and sessid with sesstime for sticky sessions. This guide passes such a proxy to NSLSolver so that Kasada x-kpsdk headers, Akamai _abck cookies and Cloudflare cf_clearance cookies are earned on the same exit IP your scraper then uses, in Python and Node.js.

NSLSolver solves on its servers without a browser and bills only successful solves. Cloudflare Challenge, reCAPTCHA v3 and Akamai require a proxy because the token or cookie is bound to the IP that earned it, which makes the choice between sticky and rotating sessions the part that decides whether the result still works on your next request.

Oxylabs residential proxy format at a glance

Entry point
pr.oxylabs.io:7777 (HTTP, HTTPS, SOCKS5)
Authentication
customer-USERNAME-<parameters>:PASSWORD
Sticky session
-sessid-<id> (10 minutes by default)
Session length
-sesstime-<minutes, up to 1440>
Geo-targeting
-cc-DE -city-munich -st-us_california -postalcode-90210 (with cc-US)
Full example
http://customer-USERNAME-cc-DE-sessid-a1b2c3d4-sesstime-30:PASSWORD@pr.oxylabs.io:7777

From the Oxylabs residential proxy documentation (developers.oxylabs.io), checked 1 December 2026. USERNAME and PASSWORD are the credentials of your residential proxy user.

Which NSLSolver solves need an Oxylabs proxy?

Send the Oxylabs proxy URL in the proxy field of POST https://api.nslsolver.com/solve, then route your own requests through exactly the same URL. The sessid in that URL is what keeps both on one IP.

Solve typeProxyWhat is bound to the IPNSLSolver price per 1,000
Cloudflare ChallengeRequiredcf_clearance cookie$1.00
Akamai Bot Manager (beta)Required_abck and bm_sz cookies$2.00
reCAPTCHA v3RequiredThe score depends on the IP$1.00
KasadaOptional, recommendedThe x-kpsdk-ct session$1.50
Cloudflare TurnstileOptional (proxyless by default)Nothing by default$0.80

Only successful solves are billed. Oxylabs bills its proxy traffic separately, under your Oxylabs plan.

How Oxylabs builds a residential proxy username

Every Oxylabs residential username starts with customer-, even with no other parameter. Parameters follow as key-value pairs joined with hyphens: customer-USERNAME-cc-DE-sessid-a1b2c3d4-sesstime-30. Without sessid, Oxylabs gives each request a new IP.

Oxylabs offers two ways to stay on one IP. The sessid parameter keeps an IP for 10 minutes by default and for up to 1,440 minutes with sesstime. Alternatively, sticky ports on the entry nodes (for example pr.oxylabs.io:10000 to 49999, or de-pr.oxylabs.io:30001 to 39999) keep an IP for up to 10 minutes but do not support city or state targeting. For cookie replay, sessid with sesstime gives you longer and more explicit control.

ParameterExampleNotes from Oxylabs' docs
cccc-DEISO 3166-1 alpha-2 country code; written in uppercase in the examples.
citycity-munichNeeds cc; spaces become underscores (city-los_angeles).
stst-us_californiaUS states, with the us_ prefix.
postalcodepostalcode-90210Used with cc-US.
sessidsessid-a1b2c3d4Sticky session; moves to a new IP if the current one goes offline.
sesstimesesstime-30Session length in minutes, up to 1440 (24 hours).
sessid_oneipsessid_oneip-a1b2c3d4Binds the session to a single IP and returns HTTP 502 if that IP drops.

With IP whitelisting instead of credentials, the same parameters go in the hostname, for example cc-de-sessid-a1b2c3d4.bc.pr.oxylabs.io:7777; Oxylabs says not to mix the two authentication methods.

sessid or sessid_oneip for cf_clearance and _abck?

cf_clearance only works from the IP that earned it, for the site's Challenge Passage window (30 minutes by default). Akamai's _abck is also tied to the client and IP that ran the sensor. Both therefore need a sticky session that lasts at least as long as you reuse the cookie: sesstime-30 covers the default Challenge Passage.

The difference between the two sticky modes matters here. With sessid, Oxylabs quietly moves the session to another IP when the current one goes offline; your cookies then stop working and the next response is a challenge or a 403, which the code below detects and answers with a new solve. With sessid_oneip, the gateway returns HTTP 502 instead, so you notice the IP change before sending a request with a cookie that can no longer work.

For Kasada, solve with the same session you call the protected API from, and remember that x-kpsdk-cd is single-use: one solve per protected call.

Keep the geography consistent as well. Use the same cc (and city, if you set one) for the solve and the replay, and pass an accept_language that fits the country so the Challenge solve looks like a local visitor; the examples use Germany with de-DE.

Python: cf_clearance with automatic session rotation

clearance_session() solves on a fresh Oxylabs sessid, checks that the page now loads, and moves to a new sessid (a new IP) if it is still challenged. The returned curl_cffi session keeps the same IP, cookie and User-Agent for the rest of the 30 minutes.

oxylabs_nslsolver.py
# oxylabs_nslsolver.py  (pip install curl_cffi)
import secrets
from curl_cffi import requests

NSL_API_KEY = "nsl_YOUR_API_KEY"
OXYLABS_USERNAME = "YOUR_OXYLABS_USERNAME"  # residential proxy user, not your account email
OXYLABS_PASSWORD = "YOUR_OXYLABS_PASSWORD"
UA = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
      "(KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36")


def oxylabs_proxy(cc="DE", sessid=None, sesstime=30, city=None):
    """Oxylabs residential entry point. The username always starts with
    "customer-", then hyphen-joined parameters. No sessid = new IP per request."""
    user = f"customer-{OXYLABS_USERNAME}-cc-{cc}"
    if city:
        user += f"-city-{city}"  # e.g. "munich"; spaces become underscores
    if sessid:
        user += f"-sessid-{sessid}-sesstime-{sesstime}"  # minutes, up to 1440
    return f"http://{user}:{OXYLABS_PASSWORD}@pr.oxylabs.io:7777"


def solve(payload):
    r = requests.post("https://api.nslsolver.com/solve",
                      headers={"X-API-Key": NSL_API_KEY}, json=payload, timeout=180)
    data = r.json()
    if r.status_code != 200 or not data.get("success"):
        raise RuntimeError(f"NSLSolver {r.status_code}: {data.get('error', data)}")
    return data


def browser_session(proxy, user_agent, accept_language=None, impersonate="chrome"):
    # TLS fingerprint must match the UA: "chrome" for a Chrome UA, "safari_ios"
    # for the iPhone Safari UA that a Challenge solve returns
    s = requests.Session(impersonate=impersonate)
    s.proxies = {"http": proxy, "https": proxy}
    s.headers["User-Agent"] = user_agent
    if accept_language:
        s.headers["Accept-Language"] = accept_language
    return s


def is_challenge(resp):
    return resp.headers.get("cf-mitigated") == "challenge" or (
        resp.status_code in (403, 503) and "Just a moment..." in resp.text[:5000])


def clearance_session(url, site_key, cc="DE", lang="de-DE,de;q=0.9", tries=3):
    """Solve on a fresh Oxylabs session; if the IP is still challenged, move to
    a new sessid (= new IP) and solve again. Returns a session to keep using."""
    for _ in range(tries):
        proxy = oxylabs_proxy(cc, sessid=secrets.token_hex(4), sesstime=30)
        cf = solve({"type": "challenge", "url": url, "site_key": site_key,
                    "proxy": proxy, "accept_language": lang})
        s = browser_session(proxy, cf["user_agent"], lang, impersonate="safari_ios")
        for name, value in cf["cookies"].items():  # cf_clearance
            s.cookies.set(name, value)
        if not is_challenge(s.get(url)):
            return s
    raise RuntimeError(f"still challenged after {tries} Oxylabs sessions")


site = clearance_session("https://cf-protected.example.com/", "0x4AAAAAAA...")
for page in range(1, 6):  # same sessid, same IP, same cf_clearance
    r = site.get(f"https://cf-protected.example.com/catalog?page={page}")
    print(page, r.status_code)

Python: Kasada x-kpsdk headers through Oxylabs

p_js_path, fp_host and tl_host come from the browser's Network tab: the p.js script, the host serving /fp and the host receiving POST /tl. Send the returned headers with the same User-Agent and through the same sessid.

oxylabs_nslsolver.py
# Same file: Kasada headers minted on the Oxylabs IP that calls the API.
kasada_proxy = oxylabs_proxy("DE", sessid=secrets.token_hex(4), sesstime=30)

k = solve({
    "type": "kasada",
    "url": "https://www.kasada-site.example.com/login",
    "user_agent": UA,
    "ua_version": 145,
    "kasada_config": {
        "p_js_path": "/<uuid-1>/<uuid-2>/p.js",       # the target's real p.js path (DevTools > Network)
        "fp_host": "www.kasada-site.example.com",     # host serving /fp
        "tl_host": "api.kasada-site.example.com",     # host receiving POST /tl
    },
    "proxy": kasada_proxy,
})

api = browser_session(kasada_proxy, UA)
r = api.post("https://api.kasada-site.example.com/v1/search",
             headers=k["headers"],  # x-kpsdk-ct, -cd, -v, -h
             json={"q": "..."})
print(r.status_code)  # solve again before the next protected call

Python: Akamai _abck cookies through Oxylabs

This example adds city targeting, which works with sessid but not with Oxylabs' sticky ports. Replay every returned cookie with the same User-Agent. Akamai is in beta on NSLSolver.

oxylabs_nslsolver.py
# Same file: Akamai cookies on a city-targeted Oxylabs session.
akamai_proxy = oxylabs_proxy("DE", sessid=secrets.token_hex(4), sesstime=30, city="munich")

ak = solve({
    "type": "akamai",
    "url": "https://akamai-site.example.com/login",
    "user_agent": UA,
    "proxy": akamai_proxy,  # required for akamai
})

shop = browser_session(akamai_proxy, UA, "de-DE,de;q=0.9")
for name, value in ak["cookies"].items():  # _abck, bm_sz, ...
    shop.cookies.set(name, value)
r = shop.get("https://akamai-site.example.com/api/products")
print(r.status_code)  # 403 "Access Denied" = solve again on this or a new sessid

Node.js: the same flows with undici

undici's ProxyAgent takes the credentials from the URL. Each call to oxylabsProxy() creates a new sessid, so reuse the returned string for everything that must share an IP.

oxylabs-nslsolver.mjs
// oxylabs-nslsolver.mjs  (Node 18+, npm i undici)
import { randomBytes } from "node:crypto";
import { fetch, ProxyAgent } from "undici";

const NSL_API_KEY = "nsl_YOUR_API_KEY";
const OXYLABS_USERNAME = "YOUR_OXYLABS_USERNAME";
const OXYLABS_PASSWORD = "YOUR_OXYLABS_PASSWORD";
const UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " +
  "(KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36";

// customer- prefix is mandatory; cc is an ISO code (uppercase in Oxylabs' examples)
function oxylabsProxy({ cc = "DE", sesstime = 30, city } = {}) {
  let user = "customer-" + OXYLABS_USERNAME + "-cc-" + cc;
  if (city) user += "-city-" + city;
  user += "-sessid-" + randomBytes(4).toString("hex") + "-sesstime-" + sesstime;
  return "http://" + user + ":" + encodeURIComponent(OXYLABS_PASSWORD) + "@pr.oxylabs.io:7777";
}

async function solve(payload) {
  const res = await fetch("https://api.nslsolver.com/solve", {
    method: "POST",
    headers: { "X-API-Key": NSL_API_KEY, "Content-Type": "application/json" },
    body: JSON.stringify(payload),
  });
  const data = await res.json();
  if (!res.ok || !data.success) {
    throw new Error("NSLSolver " + res.status + ": " + (data.error || JSON.stringify(data)));
  }
  return data;
}

const cookieHeader = (cookies) =>
  Object.entries(cookies).map(([k, v]) => k + "=" + v).join("; ");

// 1) Cloudflare Challenge on one German sticky session
const cfProxy = oxylabsProxy({ cc: "DE" });
const cf = await solve({
  type: "challenge",
  url: "https://cf-protected.example.com/",
  site_key: "0x4AAAAAAA...",
  proxy: cfProxy,
  accept_language: "de-DE,de;q=0.9",
});
const cfAgent = new ProxyAgent(cfProxy);
const page = await fetch("https://cf-protected.example.com/catalog", {
  dispatcher: cfAgent,
  headers: { "User-Agent": cf.user_agent, "Accept-Language": "de-DE,de;q=0.9", Cookie: cookieHeader(cf.cookies) },
});
console.log("challenge", page.status, page.headers.get("cf-mitigated"));

// 2) Kasada
const kProxy = oxylabsProxy({ cc: "DE" });
const k = await solve({
  type: "kasada",
  url: "https://www.kasada-site.example.com/login",
  user_agent: UA,
  ua_version: 145,
  kasada_config: {
    p_js_path: "/<uuid-1>/<uuid-2>/p.js",     // the target's real p.js path (DevTools > Network)
    fp_host: "www.kasada-site.example.com",   // host serving /fp
    tl_host: "api.kasada-site.example.com",   // host receiving POST /tl
  },
  proxy: kProxy,
});
const api = await fetch("https://api.kasada-site.example.com/v1/search", {
  method: "POST",
  dispatcher: new ProxyAgent(kProxy),
  headers: { ...k.headers, "User-Agent": UA, "Content-Type": "application/json" },
  body: JSON.stringify({ q: "..." }),
});
console.log("kasada", api.status);

// 3) Akamai, city-targeted
const akProxy = oxylabsProxy({ cc: "DE", city: "munich" });
const ak = await solve({ type: "akamai", url: "https://akamai-site.example.com/login", user_agent: UA, proxy: akProxy });
const products = await fetch("https://akamai-site.example.com/api/products", {
  dispatcher: new ProxyAgent(akProxy),
  headers: { "User-Agent": UA, Cookie: cookieHeader(ak.cookies) },
});
console.log("akamai", products.status);
// Node's fetch does not copy Chrome's TLS fingerprint; if a strict site still
// blocks it, send the follow-up requests from Python with curl_cffi.

Full NSLSolver API reference

Troubleshooting Oxylabs with NSLSolver

For the meaning of each NSLSolver status code and of the Cloudflare, Kasada and Akamai errors, see the anti-bot error-code reference.

SymptomLikely causeFix
407 Proxy Authentication RequiredUsername without the customer- prefix, or account login used instead of the proxy user.Use customer-<proxy username>, with the proxy user's password.
502 from the gatewaysessid_oneip is set and its IP went offline.Start a new session id and solve again.
cf_clearance rejected after about 10 minutesNo sesstime (10-minute default), or a sticky port, which holds an IP for up to 10 minutes.Use sessid with sesstime-30 or longer.
City targeting ignoredCity and state parameters are not supported on sticky ports.Use pr.oxylabs.io:7777 with cc, city and sessid in the username.
NSLSolver 400 Validation failedProxy without a scheme, or a missing required field.Send the full http:// URL and check the field named in the error.
NSLSolver 503 Solve failedThe solve did not complete; it is not billed.Retry with backoff; if one sessid keeps failing, move to a new one.

Related

Frequently asked questions

How do I use Oxylabs residential proxies with NSLSolver?

Build the URL as http://customer-USERNAME-cc-DE-sessid-a1b2c3d4-sesstime-30:PASSWORD@pr.oxylabs.io:7777 and pass it in the proxy field of POST /solve. Then send your own requests through the identical URL so they leave from the same IP that earned the cookie or headers.

Why does Oxylabs return 407 with my credentials?

The residential username must start with customer-, and it must be the proxy user created for residential proxies, not your dashboard login. Check both, and URL-encode the password if it contains special characters.

How long can an Oxylabs sticky session last?

With sessid, 10 minutes by default and up to 1,440 minutes (24 hours) with sesstime. Sticky ports keep an IP for up to 10 minutes. For cf_clearance, sesstime-30 matches Cloudflare's default Challenge Passage.

Should I use sessid or sessid_oneip?

sessid silently moves to a new IP if the old one goes offline, which invalidates IP-bound cookies without warning. sessid_oneip returns HTTP 502 instead, so your code can start a new session and solve again before it sends a request that would fail.

What does NSLSolver cost with Oxylabs proxies?

NSLSolver charges per successful solve: $1.00 per 1,000 for Cloudflare Challenge, $1.50 for Kasada and $2.00 for Akamai (beta). Failed solves are not billed. Oxylabs bills its proxy traffic separately under your Oxylabs plan.

Plug your Oxylabs proxies into NSLSolver

Kasada headers, Akamai cookies and cf_clearance through your own residential IPs, solved server-side without a browser. Only successful solves are billed, and you get free credit when you sign up with Google, Gmail or Proton.