NEWStandard createTask and in.php APIs. Change the address and you are connected.View API docs
GATESOLVER

Account and billing

How do I replace a leaked API key?

Sign in with your account token and create a new API key; the old key stops working immediately, so update every system that used it straight after.

The quick version

Each GateSolver account has exactly one API key at a time. Creating a new one from the API key menu in your account replaces the previous key on the spot: from that moment, requests with the old key get ERROR_KEY_DENIED_ACCESS. The new key is shown only once, when you create it, so copy it straight into your secret store. Your balance is not affected; it belongs to the account, not to the key.

If the key leaked: act first

When a key is exposed, for example committed to a public repository, pasted into a ticket or printed in shared logs, replace it right away. Someone holding it can create tasks that draw on your balance until it is replaced. A minute of downtime for your own jobs is a small price compared with that.

  1. Sign in with your account token.
  2. Create a new API key; the old one stops working.
  3. Store the new key in your secret manager.
  4. Update and restart every system that calls the API.
  5. Check the balance with getBalance and compare with what you expected.

If you are rotating on schedule: plan it

Routine rotation is good hygiene, and with a little planning it causes no errors at all. Tasks are tied to the key that created them: polling a task with a different key returns ERROR_TASKID_INVALID. So before rotating, pause new work and let running tasks finish, which takes at most two minutes because unsolved tasks close after 120 seconds. Then create the new key, deploy it, and resume.

import time

def rotate(pause_jobs, running_task_count, create_key_in_account, deploy_secret, resume_jobs):
    pause_jobs()                                   # stop creating new tasks
    waited = 0
    while running_task_count() and waited < 130:   # tasks close within 120 s
        time.sleep(5); waited += 5
    new_key = create_key_in_account()              # done by a person in the account pages
    deploy_secret("GATESOLVER_KEY", new_key)
    resume_jobs()

The function is a checklist in code form; the key itself is created by a person in the account pages, then pasted into the secret store.

Find every place the key lives

  • Servers and containers (environment variables, config files).
  • CI and scheduler secrets.
  • Workflow tools such as n8n, Make or Zapier credentials.
  • RPA credential vaults and AI agent environments.
  • Teammates' local setups.

Search logs and repositories for the last few characters of the old key to catch places you forgot. Anything you missed will start returning ERROR_KEY_DENIED_ACCESS, which is a clear signal of where to look; the page on that error lists the usual suspects.

Preventing the next leak

  • Keep the key in environment variables or a secret manager, not in source files.
  • Add the key's pattern to your repository's secret scanning, if your platform offers it.
  • Mask the key in logs; print only the last four characters.
  • Do not put the key into prompts for AI agents; read it inside the tool code instead, as described in giving an agent a CAPTCHA tool.

Key versus account token

The API key is replaceable; the account token is not. If you think the account token itself leaked, replace the API key at once and store the token more carefully, because the token gives full access to the account and cannot be changed or recovered. The page on losing the account token explains how the two differ.

Common questions

Can I keep the old key working while I switch?

No. An account has one key at a time, and creating a new key ends the old one immediately.

Will tasks created with the old key still return results?

Polling them with the new key returns ERROR_TASKID_INVALID, so let running tasks finish before rotating.

Does a new key change my balance?

No. The balance belongs to the account, and the new key draws on the same balance.

I lost the new key before saving it. What now?

Create another one; it replaces the lost key, and you can copy it this time.

How often should I rotate the key?

Whenever it may have leaked, when someone with access leaves, and on a regular schedule that suits your team.

Keep reading