Skip to content
Guide

Decodo (Smartproxy) Residential Proxies with NSLSolver: Kasada Headers, Akamai Cookies and cf_clearance in Python and Node.js

NSLSolver TeamPublished 9 min read

Decodo, the proxy provider called Smartproxy until April 2025, serves its residential proxies through one gateway, gate.decodo.com:7000. This guide shows how to hand a Decodo residential proxy to NSLSolver so that Kasada x-kpsdk headers, Akamai _abck cookies and Cloudflare cf_clearance cookies are minted on the same exit IP you then send your own requests from, with complete Python and Node.js code.

NSLSolver solves on its servers, without a browser, and bills only successful solves. Cloudflare Challenge, reCAPTCHA v3 and Akamai require a proxy, because the result is bound to the IP it was earned on. Decodo's session parameters decide whether that IP stays the same for long enough to use it.

Decodo residential proxy format at a glance

Gateway
gate.decodo.com:7000 (HTTP, HTTPS, SOCKS5)
Authentication
user-USERNAME-<parameters>:PASSWORD
Sticky session
-session-<any string> (10 minutes by default)
Session length
-sessionduration-<1 to 1440 minutes>
Geo-targeting
-country-us -state-us_california -city-new_york -zip-10001
Full example
http://user-USERNAME-country-us-session-a1b2c3d4-sessionduration-30:PASSWORD@gate.decodo.com:7000

From Decodo's residential proxy documentation (help.decodo.com), checked 1 December 2026. USERNAME and PASSWORD are your proxy credentials from the Decodo dashboard.

Which NSLSolver solves need a Decodo proxy?

Whatever IP NSLSolver solves through is the IP that has to send the follow-up requests. Pass the Decodo proxy URL in the proxy field of POST https://api.nslsolver.com/solve, then route your own requests through the identical URL, with the same session ID.

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. Decodo bills its own proxy traffic separately, under your Decodo plan.

How Decodo builds a residential proxy URL

Decodo puts every targeting option in the username. A plain username:password pair on gate.decodo.com:7000 gives a random IP that changes on every request. As soon as you add a parameter, the username has to start with user-, followed by your proxy username and the key-value pairs, all joined with hyphens. The password stays as it is.

Decodo also supports port-based targeting: on gate.decodo.com, ports 10001 to 49999 are sticky and ports 7000 and 10000 rotate, while country hosts such as us.decodo.com use 10001 to 29999 for sticky and 10000 for rotating. The code below uses username parameters instead, because they put the session ID and its lifetime in plain sight.

ParameterExampleNotes from Decodo's docs
countrycountry-usTwo-letter country code, lowercase in Decodo's examples.
statestate-us_californiaUS states, written with the us_ prefix.
citycity-new_yorkUsed together with country; spaces become underscores.
zipzip-10001US only.
sessionsession-a1b2c3d4Any string. Keeps the same IP, for 10 minutes by default.
sessiondurationsessionduration-30Sticky time in minutes, from 1 to 1440.

Decodo also documents asn, continent and geohash parameters; city and ASN cannot be combined. SOCKS5 works only on gate.decodo.com, not on the country hosts. Decodo states that the old Smartproxy endpoints keep working, but its current docs use gate.decodo.com.

Sticky or rotating sessions for cf_clearance, _abck and Kasada

cf_clearance is accepted only from the IP that earned it, and only for the site's Challenge Passage window, 30 minutes by default. A Decodo URL without a session parameter sends each request from a new IP, so the cookie is useless on the very next request. Add session-<id> and set sessionduration at least as long as you plan to reuse the cookie; sessionduration-30 matches the default Challenge Passage.

Akamai works the same way: _abck is earned by one client on one IP, and a new exit IP looks like a different visitor holding someone else's cookie. For Kasada, keep the solve and the protected API calls on one IP, and still send a fresh x-kpsdk-cd with every call.

Rotation still has a place, one level up: give every worker its own session ID, and when a site starts blocking an IP, switch that worker to a new session ID and solve again. If Decodo has to move a session to another IP before it expires, the cookies stop working in the same way; detect the challenge or 403 and re-solve.

Geo-matching matters too. Sites often serve different content or stricter rules per country, and a cookie earned through a German IP but replayed from a US IP is a different visitor. Pick the country once, keep it in the Decodo username for the solve and the replay, and for Cloudflare Challenge pass accept_language so the solver's Accept-Language matches that country.

Python: Cloudflare Challenge through a Decodo sticky session

The helper builds the Decodo URL. The same string goes to NSLSolver and to curl_cffi, which sends your requests with a Chrome-like TLS fingerprint. Replay cf_clearance together with the user_agent the API returns.

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

NSL_API_KEY = "nsl_YOUR_API_KEY"
DECODO_USERNAME = "YOUR_DECODO_USERNAME"  # proxy user from the Decodo dashboard
DECODO_PASSWORD = "YOUR_DECODO_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 decodo_proxy(country="us", session=None, minutes=30):
    """Decodo residential gateway. Targeting goes in the username, which must
    start with "user-" once any parameter is present. No session = new IP
    on every request."""
    user = f"user-{DECODO_USERNAME}-country-{country}"
    if session:
        user += f"-session-{session}-sessionduration-{minutes}"
    return f"http://{user}:{DECODO_PASSWORD}@gate.decodo.com:7000"


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, 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
    return s


# One sticky US IP for 30 minutes: the solve and every replayed request use it.
cf_proxy = decodo_proxy("us", session=secrets.token_hex(4), minutes=30)

cf = solve({
    "type": "challenge",
    "url": "https://cf-protected.example.com/",
    "site_key": "0x4AAAAAAA...",          # challenge widget id of the target
    "proxy": cf_proxy,
    "accept_language": "en-US,en;q=0.9",  # match the proxy country
})
site = browser_session(cf_proxy, cf["user_agent"], impersonate="safari_ios")  # replay the returned UA
site.headers["Accept-Language"] = "en-US,en;q=0.9"
for name, value in cf["cookies"].items():  # cf_clearance
    site.cookies.set(name, value)

r = site.get("https://cf-protected.example.com/catalog")
print(r.status_code, r.headers.get("cf-mitigated"))  # 200 None when accepted

Python: Kasada x-kpsdk headers through Decodo

Find p_js_path, fp_host and tl_host in the browser's Network tab: the p.js script, the host serving /fp and the host receiving POST /tl. The response holds x-kpsdk-ct, x-kpsdk-cd, x-kpsdk-v and x-kpsdk-h; x-kpsdk-cd is single-use on most sites, so solve again for every protected call.

decodo_nslsolver.py
# Same file: Kasada headers minted on the IP that calls the protected API.
kasada_proxy = decodo_proxy("us", session=secrets.token_hex(4), minutes=30)

k = solve({
    "type": "kasada",
    "url": "https://www.kasada-site.example.com/login",
    "user_agent": UA,
    "ua_version": 145,  # Chrome major version of UA
    "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, x-kpsdk-cd, x-kpsdk-v, x-kpsdk-h
    json={"q": "..."},
)
print(r.status_code)  # 429 = a header was rejected; x-kpsdk-cd is single-use

Python: Akamai _abck cookies through Decodo

Akamai needs both a proxy and a user_agent. Send all returned cookies, not only _abck, from the same Decodo session and with the same User-Agent. Akamai is in beta on NSLSolver.

decodo_nslsolver.py
# Same file: Akamai cookies earned and replayed on one Decodo session.
akamai_proxy = decodo_proxy("us", session=secrets.token_hex(4), minutes=30)

ak = solve({
    "type": "akamai",
    "url": "https://akamai-site.example.com/login",  # a page that loads the sensor
    "user_agent": UA,                                # replay this exact UA
    "proxy": akamai_proxy,                           # required for akamai
})

shop = browser_session(akamai_proxy, UA)
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 with "Reference #" = blocked again: solve again

Node.js: the same three flows with undici

undici's ProxyAgent reads the credentials from the proxy URL, so the Decodo string works as is. Encode the password with encodeURIComponent if it contains characters such as @ or :.

decodo-nslsolver.mjs
// decodo-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 DECODO_USERNAME = "YOUR_DECODO_USERNAME";
const DECODO_PASSWORD = "YOUR_DECODO_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";

// user- prefix + hyphen-joined parameters; a new session id = a new sticky IP
function decodoProxy(country, minutes) {
  const session = randomBytes(4).toString("hex");
  const user = "user-" + DECODO_USERNAME + "-country-" + country +
    "-session-" + session + "-sessionduration-" + minutes;
  return "http://" + user + ":" + encodeURIComponent(DECODO_PASSWORD) + "@gate.decodo.com:7000";
}

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: cf_clearance + user_agent, replayed on the same IP
const cfProxy = decodoProxy("us", 30);
const cf = await solve({
  type: "challenge",
  url: "https://cf-protected.example.com/",
  site_key: "0x4AAAAAAA...",
  proxy: cfProxy,
  accept_language: "en-US,en;q=0.9",
});
const page = await fetch("https://cf-protected.example.com/catalog", {
  dispatcher: new ProxyAgent(cfProxy),
  headers: { "User-Agent": cf.user_agent, "Accept-Language": "en-US,en;q=0.9", Cookie: cookieHeader(cf.cookies) },
});
console.log("challenge", page.status);

// 2) Kasada: x-kpsdk-* headers for one protected call
const kProxy = decodoProxy("us", 30);
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: _abck and friends, replayed with the same UA and IP
const akProxy = decodoProxy("us", 30);
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 Kasada or
// Akamai site still blocks it, send the follow-up requests with curl_cffi.

Full NSLSolver API reference

Troubleshooting Decodo with NSLSolver

Every NSLSolver status code, and the Cloudflare, Kasada and Akamai errors these flows can hit, is explained in the anti-bot error-code reference.

SymptomLikely causeFix
407 Proxy Authentication RequiredParameters added without the user- prefix, or a typo in the credentials.Start the username with user-, then your proxy username, then the parameters.
SOCKS5 fails on us.decodo.comDecodo supports SOCKS5 only on gate.decodo.com.Use socks5h://...@gate.decodo.com:7000, or HTTP on the country host.
cf_clearance accepted, then 403 about 10 minutes laterNo sessionduration: Decodo sticky sessions last 10 minutes by default.Add sessionduration-30 (up to 1440).
Every request gets a new challengeNo session parameter, so each request leaves from a new IP.Add session-<id> and use the identical proxy URL for the solve and the replay.
NSLSolver 400 Validation failedThe proxy string has no scheme, or a required field is missing.Send the full URL, http://user-...:PASSWORD@gate.decodo.com:7000, and read the field named in the error.
NSLSolver 503 Solve failedThe solve did not complete; it is not billed.Retry with backoff; if it repeats on one session, start a new session ID.

Related

Frequently asked questions

Does NSLSolver work with Decodo residential proxies?

Yes. Put the full Decodo proxy URL, for example http://user-USERNAME-country-us-session-a1b2c3d4-sessionduration-30:PASSWORD@gate.decodo.com:7000, in the proxy field of POST /solve. NSLSolver solves through that IP on its servers, without a browser, and you send your follow-up requests through the same URL.

Should I use a sticky or a rotating Decodo session for cf_clearance?

Sticky. cf_clearance only works from the IP that earned it, so add session-<id> with a sessionduration at least as long as you will reuse the cookie. 30 minutes matches Cloudflare's default Challenge Passage.

Does gate.smartproxy.com still work after the Decodo rebrand?

Decodo says the Smartproxy endpoints and URLs keep working after the April 2025 rebrand. Its current documentation uses gate.decodo.com, which is what this guide uses.

Do I need a proxy for Kasada?

The proxy field is optional for Kasada, but passing the same Decodo session you call the protected API from keeps the whole Kasada session on one IP, which avoids 429s caused by an IP change.

What does NSLSolver cost with Decodo 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. Decodo bills its proxy traffic separately under your Decodo plan.

Plug your Decodo 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.