Docs

Quickstart

Five steps to wire SuperThinking into your stack. Each example is copy-pasteable — swap the placeholder values for your own.

1. Create a source

A source represents an inbound event stream — GitHub webhooks, Stripe events, or any custom integration. Create one via the REST API using your session cookie or API key.

curl -X POST https://superthinking.ai/api/sources \
  -H "Content-Type: application/json" \
  -H "Cookie: session=YOUR_SESSION_TOKEN" \
  -d '{
    "name": "production-alerts",
    "kind": "webhook-generic"
  }'

Response includes the source object with its _id and a webhookSecret you will use in the next step.

2. Send an event

POST a JSON event to your source endpoint. Include the secret header so SuperThinking can authenticate the request.

curl -X POST https://superthinking.ai/api/ingest/SOURCE_ID \
  -H "Content-Type: application/json" \
  -H "x-superthinking-secret: YOUR_WEBHOOK_SECRET" \
  -d '{
    "type": "deploy.failed",
    "summary": "Deploy to prod failed on commit abc1234",
    "payload": {
      "service": "api-gateway",
      "commit": "abc1234",
      "error": "OOMKilled"
    }
  }'

3. Read the decision

The ingest endpoint responds synchronously with the thinking loop result. Use action and confidence to drive your automation logic.

{
  "ok": true,
  "thoughtId": "665f1a2b3c4d5e6f70891011",
  "action": "rollback",
  "confidence": 0.92
}

4. Receive dispatches

Configure a dispatch output (webhook) in the dashboard. When a thought fires, SuperThinking POSTs a payload to your endpoint. The message field is a clean, agent-ready instruction — the full Cortex trace lives under superthinking.

{
  "id": "665f1a2b3c4d5e6f70891011",
  "title": "Rollback api-gateway",
  "message": "Deploy abc1234 OOMKilled on api-gateway. Roll back to previous image and open an incident.",
  "superthinking": {
    "workspaceId": "663a0b1c2d3e4f5061728394",
    "createdAt": "2025-06-03T14:22:11.000Z",
    "cortex": {
      "action": "rollback",
      "confidence": 0.92
    },
    "synthesis": { "model": "gpt-4o", "tokens": 1284 },
    "triggeringEventIds": ["665f19fa3c4d5e6f70891010"],
    "dashboardUrl": "https://superthinking.ai/app/thoughts/665f1a2b3c4d5e6f70891011"
  }
}

Verify authenticity with the x-superthinking-signature header (HMAC-SHA256 of timestamp.body).

5. Connect to MCP

SuperThinking exposes an MCP-compatible endpoint so any agent or IDE can discover and call tools. Authenticate with a stak_* API key scoped to mcp:read.

curl -X POST https://superthinking.ai/api/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer stak_your_api_key_here" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list"
  }'

Returns the full tool schema array. Use tools/call with list_recent_thoughts or get_thought to query your workspace from inside any MCP client.