Errors and troubleshooting
What does ERROR_KEY_DENIED_ACCESS mean?
The API did not accept the clientKey in your request: it is missing, mistyped, or no longer valid because a newer key replaced it.
The meaning
ERROR_KEY_DENIED_ACCESS means the request reached GateSolver but carried no usable API key. Every JSON call (createTask, getTaskResult, getBalance) needs the key in the clientKey field of the body. The response is free, and nothing else happens until the key is fixed. In the in.php interface, the same problem returns ERROR_WRONG_USER_KEY.
The usual causes
- The key was replaced. An account has one API key at a time. Creating a new key in your account makes the old one stop working immediately. A forgotten server, a CI secret or a teammate's script still using the old key will get this error.
- Whitespace or quotes. A trailing newline from a file, a leading space from copy and paste, or quotes included in an environment variable.
- Wrong field. The key sent as a header or query parameter instead of
clientKeyin the JSON body. - Wrong variable. A placeholder such as
YOUR_API_KEYleft in code, or an empty environment variable in production. - Wrong account. A key from a different account than the one you topped up; the request works but the balance is not where you expect.
Check what you actually send
import os
import requests as rq
raw = os.environ.get("GATESOLVER_KEY", "")
key = raw.strip().strip('"').strip("'")
if key != raw:
print("warning: key had surrounding whitespace or quotes")
if not key or key == "YOUR_API_KEY":
raise SystemExit("no real key configured")
check = rq.post("https://gatesolver.com/getBalance", json={"clientKey": key}, timeout=15).json()
print(check.get("errorCode") or f"key ok, balance {check['balance']}")
getBalance is the cheapest way to test a key: it is free and touches nothing else.
If you replaced the key
Update every place that holds it: servers, scheduled jobs, CI secrets, no-code tools, teammates' environments. The key is shown only once, when you create it, so copy it straight into your secret store. If you lost it before saving, create another one; that replaces the one you lost. The page on replacing a leaked API key walks through a clean switch.
Not the same as a suspended account
A valid key on an account that has been suspended returns ERROR_ACCOUNT_SUSPENDED instead. That is rare and tied to the acceptable use rules: fraud, account takeover, credential stuffing and spam are not allowed. If you see that code, the key itself is fine, and the account, not your code, is what needs attention.
Keeping keys healthy
- Store the key in an environment variable or secret manager, never in code you commit.
- Load it in one place and pass it around, so a change touches one line.
- Mask it in logs; print only the last four characters when you need to tell keys apart.
- When you replace a key, search your infrastructure for the old one's last characters to find stragglers.
The API docs show the exact request shape for each call, and the glossary entry on API endpoints explains how the three calls fit together.
When several systems share one key
Because the account has a single key, every system that solves through it shares that key, its balance and its 600 requests per minute. Keep a short list of where the key lives: which servers, which CI pipelines, which workflow tools. That list turns a key replacement from a hunt into a checklist, and it is the first thing to consult when this error appears after a change. If two teams need clearly separate budgets and limits, give each its own account.
Common questions
Why did my old key stop working?
Creating a new API key replaces the previous one, which stops working at once.
Where does the key go in a request?
In the clientKey field of the JSON body for createTask, getTaskResult and getBalance.
Can I have two keys for two projects?
No. Each account has one API key at a time; separate accounts keep separate keys and balances.
What is the in.php version of this error?
ERROR_WRONG_USER_KEY, returned when the key parameter is missing or invalid.
Is a request with a bad key charged?
No. A refused request costs nothing, whatever the error code.
Keep reading
- How do I replace a leaked API key?Create a new key in your account; it replaces the old one at once, so update every system using it.
- API keyA secret string that authorizes your calls to a service, and the habits that keep it out of code and logs.
- API docscreateTask, getTaskResult, getBalance, error codes and the in.php format.
- What happens if I lose my account token?The account token is the only way into an account and cannot be recovered, so store it safely from the first day.