HackerGPT API

Send prompts to HackerGPT from your own scripts and tools. The API is plain HTTPS and JSON: you send a message, then poll until the answer is ready.

Base URL: https://hackergpt.app/api/v1

Authentication

Your account token is your API key. You get it once, when you create an anonymous account at hackergpt.app. Save it then: we store only a hash, so we cannot look it up or recover it for you.

Send it on every request:

Authorization: Anon 3f9a7c1e-5b2d-4086-a9e1-c7f2b8d05e64

Treat the token like a password. If it leaks, replace it with POST /account/rotate/.

Quick start

The token and IDs in the examples are fake. Replace them with your own.

1. Send a message

curl -X POST https://hackergpt.app/api/v1/messages/ \
  -H "Authorization: Anon 3f9a7c1e-5b2d-4086-a9e1-c7f2b8d05e64" \
  -H "Content-Type: application/json" \
  -d '{"message": "check cybergym.hackergpt.app", "tool": "ctf"}'

It returns at once, with 202 Accepted:

Response

{
  "message_id": 48213,
  "session_id": 7350,
  "status": "pending",
  "poll_url": "/api/v1/messages/48213/",
  "prompt": "check cybergym.hackergpt.app",
  "response": null,
  "created_at": "2026-11-21T14:05:32.418204Z"
}

Keep message_id to get the answer, and session_id to continue the conversation.

2. Poll until the status is no longer pending

curl https://hackergpt.app/api/v1/messages/48213/ \
  -H "Authorization: Anon 3f9a7c1e-5b2d-4086-a9e1-c7f2b8d05e64"

A ready-made loop is in Examples.

3. Continue the conversation

curl -X POST https://hackergpt.app/api/v1/messages/ \
  -H "Authorization: Anon 3f9a7c1e-5b2d-4086-a9e1-c7f2b8d05e64" \
  -H "Content-Type: application/json" \
  -d '{"message": "now list its open ports", "session_id": 7350}'

Leave session_id out to start a new session.

Agents

The tool field picks the agent for a session. It is read only on the session's first message; later messages keep the same agent. Without tool, the default agent answers. The API never picks an agent for you.

toolWhat the agent does
ctfSolves CTF challenges on a web app: maps the app and tests it for SQL injection, XSS, broken access control and similar bugs. Field guide
osintGathers information from open sources: domains, subdomains, IP addresses, WHOIS, CVEs, the dark web, image metadata, crypto wallets.
browserOpens a URL in a browser and collects its network logs.

Prompts to try with each agent are in the documentation.

Endpoints

MethodPathWhat it does
POST/messages/Send a message. Opens a new session if session_id is left out.
GET/messages/{message_id}/Status and result of one message.
GET/sessions/Your 100 most recent sessions.
GET/sessions/{session_id}/messages/Every message in a session, oldest first.
GET/account/Credits, entitlements and account state.
POST/account/rotate/Replace your token. The old one stops working at once.
DELETE/account/Delete the account and all its data.

Request body: POST /messages/

FieldTypeRequiredNotes
messagestringyesYour prompt. Up to 32,000 characters.
session_idintegernoContinue this session. Unknown or not yours: 404.
toolstringnoctf, osint or browser. See Agents.
targetstringnoTarget for the run, up to 255 characters. Read only when the session is created.

Message object

Returned when you send a message, when you poll it, and in a session's message list.

FieldMeaning
message_idID of the message. Use it to poll.
session_idID of the session. Send it back to continue the conversation.
statuspending, done or failed.
responseThe answer when done, the error text when failed, otherwise null.
poll_urlPath to poll, relative to https://hackergpt.app.
promptWhat you sent.
created_atWhen you sent it, in UTC.

A finished message

{
  "message_id": 48213,
  "session_id": 7350,
  "status": "done",
  "poll_url": "/api/v1/messages/48213/",
  "prompt": "check cybergym.hackergpt.app",
  "response": "…the agent's answer…",
  "created_at": "2026-11-21T14:05:32.418204Z"
}

Rotate the token: POST /account/rotate/

curl -X POST https://hackergpt.app/api/v1/account/rotate/ \
  -H "Authorization: Anon 3f9a7c1e-5b2d-4086-a9e1-c7f2b8d05e64"

Response

{"uuid": "NEW_TOKEN", "account": {...}}

This is the only time the new token is shown. Save it before you do anything else.

Credits

Each message costs one credit, taken when the run starts. A run that dies without producing an answer is refunded.

Check your balance in credits, and whether you can send right now in can_send:

curl https://hackergpt.app/api/v1/account/ \
  -H "Authorization: Anon 3f9a7c1e-5b2d-4086-a9e1-c7f2b8d05e64"

Buy more credits in the web app.

Limits

Errors

Errors are JSON with a human-readable detail and, where useful, a machine-readable reason.

StatusWhenreason
400Invalid body. Field errors are keyed by field name.—
401Missing or invalid token.—
402Can't send: out of credits or over a plan limit. Also returns credits_remaining.no_credits, free_limit, ctf_limit, sub_expired
403DELETE /account/ is not allowed for this account.see detail
404The message or session doesn't exist or isn't yours.—
429Too many runs in flight.too_many_inflight
429Over the per-minute rate limit. Back off and retry.—

Examples

Wait for the answer (shell)

Polls every 10 seconds until the run is over, then prints the result. Needs jq.

TOKEN="3f9a7c1e-5b2d-4086-a9e1-c7f2b8d05e64"
URL="https://hackergpt.app/api/v1/messages/48213/"

while true; do
  RESULT=$(curl -s "$URL" -H "Authorization: Anon $TOKEN")
  [ "$(echo "$RESULT" | jq -r .status)" != "pending" ] && break
  sleep 10
done

echo "$RESULT" | jq -r .status     # done or failed
echo "$RESULT" | jq -r .response   # the answer, or the error text

Send and wait (Python)

Needs requests (pip install requests).

import time
import requests

BASE = "https://hackergpt.app/api/v1"
HEADERS = {"Authorization": "Anon 3f9a7c1e-5b2d-4086-a9e1-c7f2b8d05e64"}


def ask(message, session_id=None, tool=None):
    body = {"message": message}
    if session_id:
        body["session_id"] = session_id
    if tool:
        body["tool"] = tool

    r = requests.post(f"{BASE}/messages/", json=body, headers=HEADERS)
    r.raise_for_status()
    msg = r.json()

    while msg["status"] == "pending":
        time.sleep(10)
        r = requests.get(f"{BASE}/messages/{msg['message_id']}/", headers=HEADERS)
        r.raise_for_status()
        msg = r.json()

    if msg["status"] == "failed":
        raise RuntimeError(msg["response"])
    return msg


first = ask("whois hackergpt.app", tool="osint")
print(first["response"])

follow = ask("what about its SSL config?", session_id=first["session_id"])
print(follow["response"])

Support

support@hackergpt.app. Never email your token: we can't use it to help you, and anyone who reads it can use your account.