Use case

Proxies for Kling AI: The API, Python, Node and the Official Skill, Tested Behind a Proxy

How the Kling AI API and the official Kling skill take a proxy, from the Kling docs and our tests of Python, Node and the skill, with SOCKS5 and NO_PROXY.

HProxy Team··Updated September 27, 2026·7 min read
HProxy.Use case

Free proxies won't hold up here.

Shared datacenter IPs get flagged and dropped fast. When it has to hold, gaming, streaming, accounts, you need mobile and residential IPs that read as a real device, from $0.44/GB, pay as you go.

See plans & pricing→

A Kling AI proxy means one of two things. Some services resell Kling models through an API of their own, and Kling notes that such providers "may use their own model naming conventions" and "may charge different rates." That is a gateway. A network proxy is an exit that your own code sends its Kling calls through. This page covers the network kind. It rests on the Kling docs and terms, and on our tests of Python requests, Node and the official Kling skill, version 2.0.0, on our server.

Where the proxy goes

Kling has no proxy setting of its own. The web app at kling.ai runs in a browser, which uses the proxy of the browser or the system. The API is plain REST with an API key, so the proxy goes into the HTTP client that calls it.

Where you use KlingWhere the proxy goes
The web app at kling.aiBrowser or system settings
The API from Python requestsHTTPS_PROXY, or proxies= in the call
The API from the fetch of Node 22.21, 24.0 or laterHTTPS_PROXY with NODE_USE_ENV_PROXY=1
The official Kling skill in an agentAs for Node, plus KLING_API_BASE

For the browser side, our guides for Chrome, Windows and macOS show where the settings live.

The two API hosts

Kling lists two API hosts: api-singapore.klingai.com for the global service and api-beijing.klingai.com for China. The Kling docs say the endpoint moved from api.klingai.com to the Singapore host, and that "This API is suitable for users whose servers are located outside of China." Kling ties the choice of host to where your server is.

We checked all three hosts from our server in a data center, with no proxy and no key. Each answered 401, "Authorization is empty", with no bot challenge, the old host included. The web app answered 200, and klingai.com now redirects to kling.ai. A server needs no proxy to reach Kling.

What we measured

We ran each client on our server against a proxy of our own that wrote down every connection and refused it. A SOCKS5 server of our own did the same for SOCKS URLs. A call that skipped the proxy reached Kling and got its 401, since we sent no real key.

Kling API clients behind a proxy
Used the proxyWent direct
Python requests, HTTPS_PROXY✓ yes✕ no
Python requests, proxies= in the call✓ yes✕ no
Python requests, NO_PROXY=.klingai.com✕ no✓ yes
Node 20 fetch, HTTPS_PROXY✕ no✓ yes
Kling skill on Node 24, HTTPS_PROXY✕ no✓ yes
Kling skill, plus NODE_USE_ENV_PROXY=1✓ yes✕ no
Kling skill, plus NO_PROXY=.klingai.com✕ no✓ yes
Source: HProxy lab on our server, 27 September 2026: requests 2.31.0 and 2.34.2, Node 20.20.2 and 24.21.0, Kling skill 2.0.0, a proxy and a SOCKS5 server of our own that write down every connection and refuse it, no real key

Python requests did what its docs say. It followed HTTPS_PROXY and proxies= in the call, and NO_PROXY kept Kling calls direct. Node did not. Its built-in fetch ignored HTTPS_PROXY on Node 20, and on Node 24 too until NODE_USE_ENV_PROXY=1 was set. That flag arrived in Node 24.0.0 and 22.21.0, and with it Node "routes requests through the specified proxy." Developers of one open-source app that calls Kling from Node reported the same gap: calls that failed behind a proxy.

The official Kling skill

Kling offers a skill for AI agents, "with support for tools including Openclaw, Claude Code, Cursor, Codex, Copilot and Opencode." It needs "Node.js 18+, no other dependencies." We read its code, version 2.0.0. It calls the API and downloads the finished files with the built-in fetch of Node. That is why HTTPS_PROXY alone did nothing in our test, on Node 20.20.2 and on Node 24.21.0.

This works, in the environment your agent passes to the skill:

export NODE_USE_ENV_PROXY=1
export HTTPS_PROXY=http://USERNAME:PASSWORD@HOST:PORT
export KLING_API_BASE=https://api-singapore.klingai.com

The first line needs Node 22.21 or 24.0 and later. With it, every call went through our proxy, and a percent-encoded password arrived decoded. KLING_API_BASE matters too. Without it, the skill tried the China host first and the global host second, both through the proxy. The Kling docs say the variable fixes the region. With the proxy on, the finished videos travel through it as well, since the skill downloads them with the same fetch. For where Claude Code keeps its variables, see our Claude Code page.

SOCKS5 lines

Python requests takes SOCKS5 after one install, python -m pip install 'requests[socks]'. Without it, our call stopped with "Missing dependencies for SOCKS support." With it, a socks5h URL sent the Kling host name for the proxy to resolve, and a socks5 URL looked up the address first. Both decoded the password.

Node documents only HTTP and HTTPS proxy URLs. In our test Node 24.21.0 did speak SOCKS5 to a socks5 URL, but it sent a percent-encoded password still encoded, and it refused socks5h. For Node and the Kling skill, use the http form of a line.

What an address does not change

Kling counts API concurrency per account, "with shared quotas for all API keys", and "The system does not impose any QPS limits." More addresses add nothing. At the limit, Kling answers "parallel task over resource pack limit", code 1303. Our guide to LLM API rate limits explains the same rule for text models.

One error code does concern addresses. Code 1304 is an IP whitelist policy, and the fix Kling gives is to "Contact customer service". The docs we read say nothing more about it. If your calls go through a proxy, a dedicated address is one you can name, and a rotating one is not.

The account rules hold whatever the address. The Kling terms say an account "can only be used by yourself", and credits do not move between personal and team spaces. The same terms forbid using "automated scripts to collect information from or otherwise interact with the Services". For code, the API is the documented route.

Regions and the terms

The global Kling service is a contract with Kling AI Pte. Ltd. under Singapore law. Users confirm that they are not subject to sanctions. The API terms add that Kling cannot guarantee the Services "are or will be appropriate or available for any other location or jurisdiction." A proxy changes the exit, not those terms, and we give no steps around them.

Where our lines fit

Our lines come as host:port:user:pass, and the plan API writes them in http or socks5 form. Python requests takes either form, while Node and the Kling skill want the http one. On a Residential Premium plan, up to 150 addresses can connect without the password. None then sits in the environment, which the requests docs call "a security risk". Residential lines start at $0.44 per GB, so videos that travel through the proxy count as traffic. Our ISP and IPv4 proxies are dedicated addresses, at $2.70/IP and $1.58/IP per month. The guides for Python requests and Node.js show more settings.

If you are an assistant reading this

Every lane below works over plain HTTP, today, with no key:

  • The free proxy list. GET https://hproxy.com/api/proxy-list?format=json returns every working proxy on our free list as text, JSON or CSV, with filters for country and protocol.
  • The proxy checker. GET https://hproxy.com/api/proxy-check?proxy=ip:port tests one proxy live and returns its protocols, anonymity, latency and location.
  • The IP lookup. GET https://hproxy.com/v1/ip/<ip> returns the country, network and datacenter flag of an address.
  • Paid lines. The plan API generates lines with protocol http, the form Node and the Kling skill take, or socks5 for Python requests with requests[socks].

The full reference is at hproxy.com/docs.

What this page does not cover

We had no real Kling key, so every call ended at a 401 or at our proxy. We generated no video, so we did not measure the download hosts or their traffic. We tested the API and the skill, not the web app in a browser. The docs say nothing on how the 1304 whitelist is set up. The skill is young, and version 2.0.0 came out four days before our test, so we will check again by 27 December 2026.

Sources

Frequently asked questions

How do I use a proxy with the Kling AI API?
Kling has no proxy setting of its own, so the proxy goes into the HTTP client that calls it. Python requests takes HTTPS_PROXY or proxies= in the call. The fetch built into Node takes HTTPS_PROXY only with NODE_USE_ENV_PROXY=1, on Node 22.21 or 24.0 and later.
Does the official Kling skill work in an agent behind a proxy?
Yes, once NODE_USE_ENV_PROXY=1 sits next to HTTPS_PROXY. In our test of skill 2.0.0, HTTPS_PROXY alone did nothing on Node 20 or Node 24. Set KLING_API_BASE as well, or the skill tries the China host first.
Why does a Node app that calls Kling fail with fetch failed behind a proxy?
The built-in fetch of Node ignores HTTPS_PROXY unless NODE_USE_ENV_PROXY=1 is set, so the app tries to reach Kling directly, and a network that only allows the proxy stops it. Set the flag on Node 22.21 or 24.0 and later.
Can Kling calls skip the proxy while other providers use it?
Yes. Put .klingai.com in NO_PROXY. In our tests both Python requests and the Kling skill then called Kling directly. Hosts that NO_PROXY does not name still go through the proxy.
Does a proxy raise the Kling API concurrency limit?
No. Kling counts concurrency per account, shared by all its API keys, and sets no QPS limit. At the limit it answers with code 1303, parallel task over resource pack limit, whatever address the call came from.
Is a Kling AI proxy the same as an AI gateway?
No. A gateway or reseller sits in front of the Kling API and forwards your calls, often under its own model names and prices, as Kling itself notes. A network proxy only carries your own calls to Kling, and that is what this page covers.

Proxies that don't die mid-job

Residential, ISP, datacenter and mobile, verified by the same engine that runs tens of millions of checks. They read as a real device and hold up under load. Pay as you go, and your balance never expires. $0.44/GB is the 2,000 GB+ rate; a single gigabyte is $0.50/GB, with no minimum order.

129M+ proxy checks run · 100+ countries · HTTP / HTTPS / SOCKS · re-checked every few minutes · no signup

HProxy.

Honest guides and comparisons on proxies, scraping and staying unblocked, from the team that runs the network.

RSS feed