Skip to content
Ghostdesk

Advanced

API reference

Ghostdesk exposes a REST API for programmatic access. All endpoints require authentication.

Authentication

The web app authenticates via the sign-in flow. The server sets an auth_token cookie that’s automatically included in subsequent requests.

IDEs use personal API keys. Create one in Settings, then send Authorization: Bearer sak_… to the MCP endpoint. See Connect to Cursor.

POST/api/mcp

Remote MCP server (Streamable HTTP). Bearer API key required. Tools: list_agents, create_agent, run_task, get_task, get_screenshot, send_message, stop_task, get_balance. Usage bills the wallet like the web app.

Endpoints

POST/api/auth/nonce

Get a nonce for wallet sign-in.

request.json
{ "walletAddress": "..." }
POST/api/auth/signin

Sign in with a signed message.

request.json
{ "walletAddress": "...", "signature": "...", "message": "..." }
GET/api/account/keys

List personal API keys (hash metadata only). Cookie auth.

POST/api/account/keys

Create a named key with an optional spend cap. The secret is returned once.

request.json
{ "name": "Cursor", "spendLimitSol": 0.05 }
DELETE/api/account/keys/:id

Revoke a key. Existing hashes stay; the secret stops working.

GET/api/account

Get account info and balance.

POST/api/account/deposit

Verify a deposit transaction.

request.json
{ "signature": "..." }
GET/api/account/withdraw

Withdrawable balance, reserved running-agent cost, limits and withdrawal history.

POST/api/account/withdraw

Debit unused balance and pay it to the signed-in wallet. requestId is a client UUID; retries with the same id return the original withdrawal.

request.json
{ "requestId": "2c7e0b1a-4d3f-4b8e-9a11-0f3d2c1b0a99", "amount": "1000000" }
POST/api/admin/withdrawals/:id

Approve or reject a held withdrawal. Header Authorization: Bearer WITHDRAW_ADMIN_SECRET.

request.json
{ "action": "approve" }
GET/api/sessions

List active sessions.

POST/api/sessions

Create a new session.

DELETE/api/sessions/:id

Destroy a session.

PATCH/api/sessions/:id

Rename an agent or change its default model. Body: { "name", "model" }.

POST/api/sessions/:id/chat

Enqueue a background task. Returns 202 with the job. The loop keeps running if the client disconnects.

request.json
{ "message": "..." }
GET/api/sessions/:id/live

Poll chat, tool events and job status. Use full=1 for the transcript or after=n for new events.

GET/api/sessions/:id/memory

List durable notes the agent saved for this session.

DELETE/api/sessions/:id/memory

Clear that agent’s memory.

GET/api/account/notifications

Recent completion notices. Add unread=1 to list only unseen ones.

Search documentation

Jump to a docs page