Authentication
How to authenticate requests to the NoCaptchaAI API.
Loading…
How to authenticate requests to the NoCaptchaAI API.
Loading…
Every request to the NoCaptchaAI API must be authenticated with your API key. This page covers where to find your key and the two ways to send it.
Sign in to the NoCaptchaAI dashboard and copy your API key from the account page. The same key works across the async (/createTask), sync (/solve), and /balance endpoints.
The API base URL is:
https://api.nocaptchaai.com
Treat your API key like a password. Never embed it in client-side code, browser extensions, mobile apps, or public repositories. Always call the API from a server you control, and rotate the key immediately if it leaks.
There are two methods, depending on the endpoint you call.
| Method | Where the key goes | Endpoints |
|---|---|---|
clientKey | JSON request body | POST /createTask, POST /getTaskResult |
apikey | Request header | POST /solve |
clientKey in the JSON bodyThe async flow passes the key as a clientKey field inside the request body.
curl -X POST https://api.nocaptchaai.com/createTask \
-H "Content-Type: application/json" \
-d '{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "ImageToTextTask",
"body": "BASE64_IMAGE"
}
}'
The same clientKey is required when you poll for the result:
curl -X POST https://api.nocaptchaai.com/getTaskResult \
-H "Content-Type: application/json" \
-d '{ "clientKey": "YOUR_API_KEY", "taskId": "TASK_ID" }'
apikey request headerThe synchronous /solve endpoint reads the key from an apikey header instead of the body.
curl -X POST https://api.nocaptchaai.com/solve \
-H "apikey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "ImageToTextTask",
"body": "BASE64_IMAGE"
}'
You can verify a key and see remaining credits with the /balance endpoint, which takes the key as the apiKey query parameter:
curl "https://api.nocaptchaai.com/balance?apiKey=YOUR_API_KEY"
A KEY_DOES_NOT_EXIST error (code 1) means the key is missing or malformed. See Error Handling for the full list of error codes.