Perplexity Pro API + Super Automation Architecture


Part 1: Perplexity Pro API

Answer: Pro subscription does NOT include meaningful API access

  • Perplexity Pro ($20/month) = “unlimited” chat interface only
  • Pro subscribers get a $5/month API credit — that’s it
  • After $5, you must buy prepaid API credits separately
  • API has its own billing system, independent of the subscription

API Pricing

ModelInput ($/1M tokens)Output ($/1M tokens)Use Case
Sonar$1$1Lightweight search & summarization
Sonar Pro$3$15Deep context, broader retrieval
Sonar Reasoning Pro$2$8Chain-of-thought, complex analysis
Sonar Deep Research2 citation / $3 reasoning$8Long-form synthesis

Per-request pricing (per 1,000 requests):

ModelLowMediumHigh
Sonar$5$8$12
Sonar Pro$6$10$14

Verdict for Solanasis

Claude’s built-in web search is sufficient for our needs. Adding Perplexity means managing a second API, second billing, and second set of credentials with no meaningful value add for our research workflows. Only reconsider if building a product that needs search-as-a-service.


Part 2: Super Automation Architecture

The Vision

ClickUp task with enough context → webhook → orchestrator evaluates → Claude Code Agent executes → results posted back to ClickUp

Architecture Diagram

ClickUp Task (status → "Ready for AI")
    |
    | webhook POST
    v
Python FastAPI Server (or n8n)
    |
    | 1. Receive webhook payload
    | 2. Extract task context
    | 3. Run confidence scoring (Claude Haiku)
    |
    +--→ Score >= 7: Auto-execute
    |       | claude -p "[prompt]" --bare --allowedTools "Read,Edit,Bash"
    |       v
    |   Post results → ClickUp comment + status update
    |   Notify Slack: "Task X completed"
    |
    +--→ Score 4-6: Draft + pause
    |       | Agent creates draft
    |       v
    |   Slack: "Review draft for Task X" [Approve] [Reject]
    |       | (on approval) → finalize + post to ClickUp
    |
    +--→ Score < 4: Skip
            v
        Slack: "Task X needs more context"
        Add questions as ClickUp comment

Component Breakdown

1. ClickUp Webhooks

  • Triggers: Task created, status changed, assignee added, custom field changed, task moved
  • Payload: Structured JSON with full task data
  • Setup: Configure automation webhook firing on status change to “Ready for AI”

2. Middleware Options

OptionProsConsCost
n8n (self-hosted)Visual workflow, native ClickUp + AI nodes, HITL supportHosting + learning curveFree self-hosted
Python + FastAPIFull control, lightweightBuild everything yourselfHosting only
Make.comNo-code, quickLimited AI capabilities$9+/mo
AWS LambdaServerless, scales to zeroSetup complexityPay-per-use

Recommendation: n8n (visual debugging) or Python FastAPI (full control)

3. Claude Code Agent SDK (Execution Engine)

CLI headless mode:

claude -p "Fix the bug described in this task" \
  --allowedTools "Read,Edit,Bash" \
  --output-format json \
  --bare

Key flags:

  • -p / --print — Non-interactive (headless) mode
  • --bare — Skips auto-discovery, faster, deterministic
  • --allowedTools — Pre-approve tools (no human prompts)
  • --output-format json — Structured output with session ID
  • --continue / --resume — Multi-turn with session tracking
  • --mcp-config — Load MCP servers

Python SDK: claude-agent-sdk on PyPI (v0.1.48), full programmatic control with hooks system

4. Confidence Scoring Framework

DimensionPoints
Has acceptance criteria+2
References specific files/systems+2
Has clear deliverable definition+2
Read-only operation (research)+3
Creates new content (with spec)+1
Modifies existing systems-2
Touches production-5
Ambiguous language (“maybe,” “consider”)-2
Missing context (“as discussed,” “see Slack”)-3

Thresholds:

  • Score >= 7 → Auto-execute, notify on completion
  • Score 4-6 → Execute draft, require human approval
  • Score < 4 → Pause, request more context

Implementation: Lightweight Claude Haiku call to evaluate task description against scoring rubric. Fractions of a cent per task.

5. Human-in-the-Loop Patterns

  • Slack integration — Approve/Reject buttons with callback handling
  • State persistence — SQLite/Postgres for pause/resume (session ID + context)
  • Timeout — 24 hours, then auto-escalate or auto-cancel
  • Frameworks: HumanLayer SDK, n8n HITL nodes, ESCALATE.md protocol

Prior Art

ToolWhat It Does
Cyrus (Linear)Processes Linear issues, creates Git worktrees, runs Claude Code
Tembo (Linear)Analyzes codebase, writes implementation, runs tests, creates PR
n8n AI AgentMulti-agent orchestrator (GA Aug 2025), visual canvas, native ClickUp node

Gap: No production-grade open-source “ClickUp → AI agent” connector exists. Linear is ahead here. This needs custom building.

Implementation Phases

Phase 1 — Proof of Concept (1-2 days)

  • ClickUp webhook on test list (status change trigger)
  • Minimal Python FastAPI endpoint receives webhook
  • Hardcoded Claude Agent SDK call with task description
  • Post result back to ClickUp as comment

Phase 2 — Confidence Scoring + HITL (3-5 days)

  • Pre-flight Haiku scoring call
  • Slack notifications with approve/reject buttons
  • State persistence (SQLite) for pause/resume

Phase 3 — Production Hardening (1-2 weeks)

  • Error handling, retries, logging
  • Task type routing (research vs code vs content → different system prompts)
  • Cost tracking per task
  • Monitoring dashboard (Coda page)

Caveats

  • ClickUp webhooks occasionally miss events — implement idempotency + polling fallback
  • Claude Agent SDK is pre-1.0 (v0.1.48) — pin version
  • Agent needs file system access — sandbox with --allowedTools for least privilege
  • No built-in per-task cost tracking — parse JSON output for token usage