HTTP API

All 9 MCP tools, as REST endpoints.

If you can't use the MCP server directly, every MarketPrior tool is also available as a standard JSON REST endpoint. Authenticate with your API key; same tier rules apply.

BASE_URL = https://marketprior.com/api/scale4/v1

Authentication

All endpoints require Authorization: Bearer sk_... header. Get your API key at dashboard → API keys.

curl -H "Authorization: Bearer sk_your_key_here" \
     -H "Content-Type: application/json" \
     -d '{"pitch":"Your startup pitch..."}' \
     https://marketprior.com/api/scale4/v1/start

Quick start

Three curl calls: start a session, submit a signal, score.

# 1. Start a session
curl -X POST https://marketprior.com/api/scale4/v1/start \
  -H "Authorization: Bearer sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"pitch":"AI-native contract review for mid-market legal teams","category":"b2b_saas_smb"}'

# Response:
# { "session_id": "01HY...", "token": "srv1.eyJ...", "protocol": { ... } }

# 2. Submit a signal (use token from step 1)
curl -X POST https://marketprior.com/api/scale4/v1/submit_signal \
  -H "Authorization: Bearer sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "session": "srv1...<token from step 1>...",
    "axis":    "problem",
    "kind":    "user_quote",
    "value": {
      "verbatim":    "We spend 40 hours a week on first-pass contract review.",
      "source_url":  "https://news.ycombinator.com/item?id=38291234",
      "source_date": "2024-11-12",
      "speaker_role": "General Counsel"
    }
  }'

# 3. Score (after all axes are complete)
curl -X POST https://marketprior.com/api/scale4/v1/score \
  -H "Authorization: Bearer sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"session":"srv1...<token>..."}'

Endpoints

All paths are relative to https://marketprior.com/api/scale4/v1.

POST/start
free

Opens a new MarketPrior assessment session. Returns the 7-axis protocol spec and a signed session token the agent round-trips on every subsequent call. Free tier: 3 assessments per calendar month.

Request body

{
  "pitch": "AI-native contract review for mid-market legal teams...",
  "category": "b2b_saas_smb"   // optional — anchors Bayesian prior
}

Response

{
  "session_id": "01HY8KZ3VFNXQJA0GWTB5PDMRC",
  "token":      "srv1.<payload>.<hmac>",
  "protocol":   { "id": "7-axis@2026.06", "axes": [...] }
}
POST/submit_signal
free

Submits a signal for an axis. Validates shape: URL HEAD-check (3s timeout), min-char on verbatim fields, regex-block on placeholder text. Returns a refreshed session token.

Request body

{
  "session":  "srv1...",
  "axis":     "problem",
  "kind":     "user_quote",
  "value":    {
    "verbatim":    "We spend 40 hours/week on contract review...",
    "source_url":  "https://news.ycombinator.com/item?id=...",
    "source_date": "2024-11-12",
    "speaker_role": "General Counsel"
  }
}

Response

{
  "session_token": "srv1.<refreshed-payload>.<hmac>",
  "accepted": true
}
GET/check_progress
free

Returns the per-axis completeness map. Shows exactly which signal kinds are still missing before score can be called.

Query parameter

?session=srv1...

Response

{
  "session_id": "01HY...",
  "protocol": "7-axis@2026.06",
  "ready_to_score": false,
  "missing_signals": ["problem.counterfactual_quote: need 1, have 0"],
  "axes": {
    "problem": {
      "status": "incomplete",
      "requirements": {
        "user_quote":           { "need": 3, "have": 3, "complete": true },
        "counterfactual_quote": { "need": 1, "have": 0, "complete": false }
      }
    }
  }
}
POST/score
free

Returns the 70-point scorecard once all axes have minimum signals. Returns HTTP 412 with the missing signal list if called early. Includes a Bayesian posterior estimate anchored to the reference class.

Request body

{
  "session":  "srv1...",
  "category": "b2b_saas_smb"  // optional override
}

Response

{
  "scorecard": {
    "protocol": "7-axis@2026.06",
    "axes": [
      { "id": "problem", "score": 7, "max": 10, "label": "Problem hypothesis" },
      ...
    ],
    "total": 47,
    "max_total": 70,
    "verdict": "iterate",
    "estimate": {
      "posterior_p": 0.21,
      "ci_95": [0.09, 0.41],
      "reference": { "category": "b2b_saas_smb", "base_rate_pmf_24mo": 0.08 }
    }
  },
  "session_token": "srv1.<refreshed-with-scores>"
}
POST/generate_roadmap
free

Generates milestones from scored axes. Score 8–10 = no milestone (validated). Score 5–7 = Strengthen. Score 0–4 = Validate or kill. Requires score() first.

Request body

{ "session": "srv1..." }

Response

{
  "session_id": "01HY...",
  "verdict": "iterate",
  "milestones": [
    { "range": "Week 1–2", "kind": "strengthen", "axis": "distribution",
      "title": "Strengthen: Distribution (5/10)",
      "body": "Run a $500 paid-channel experiment. Measure real CPA..." }
  ]
}
POST/export
free (md) / Pro (pdf)

Markdown export is free. PDF export requires Pro tier (returns 402 for free callers). Includes pitch context, scorecard, evidence ledger, roadmap, and counsel-validated disclaimer.

Request body

{
  "session": "srv1...",
  "format":  "markdown"  // or "pdf" (Pro+)
}

Response

{
  "format": "markdown",
  "content": "# MarketPrior Assessment Export\n..."
}
POST/stackforge_handoff
free (build verdict)

Gated by build verdict. Translates the scored assessment into a Stackforge compose_stack intent string + profile. The next agent call chains directly to Stackforge.

Request body

{ "session": "srv1..." }

Response

{
  "intent":      "B2B SaaS, channel: outbound SDR",
  "profile":     "default",
  "attribution": "scale4@01HY...",
  "compose_call": "stackforge.compose_stack({ intent: ..., profile: ... })"
}
POST/pitchforge_handoff
Pro+

Pro+ only. Extracts the headline evidence (top problem quote, ICP, wedge statement, verdict, per-axis signal counts, attribution) and returns it as a stable seed JSON. The Pitchforge MCP server itself is not yet published; feed the seed to any deck-generation tool (LLM prompt, slide-template script) — the format will remain importable once the Pitchforge integration ships.

Request body

{ "session": "srv1..." }

Response

{
  "seed": {
    "session_id":      "01HY...",
    "protocol":        "7-axis@2026.06",
    "verdict":         "build",
    "problem_quote":   "We spend 40h/week on contract review...",
    "icp_definition":  "Mid-market tech companies...",
    "wedge_statement": "We fine-tune on the customer's own contracts...",
    "signal_summary":  { "problem": 4, "market": 5, ... },
    "__attribution":   "scale4@01HY..."
  }
}
POST/deep_research_mode
Pro+

Pro+ only. Two request shapes. (A) { session, axis } returns the optional-signal spec for an axis (competitor pricing scrape, founder background lookup, search-volume snapshot) that can boost the axis score 1–2 points. (B) { citations: [{verbatim, source_url}, ...] } calls @scale4/engine-deep verifyCitations(): re-fetches each source through the SSRF-allowlisted fetcher and uses an LLM to confirm the quote actually appears with the same meaning. Max 25 citations per call (400 too_many_citations otherwise). The session token is kid-bound to the API key making the request; replays from a different key return 401.

Request body

// Mode A — axis optional-signal discovery
{
  "session": "srv1...",
  "axis":    "solutions"
}

// Mode B — citation verification (max 25 per request)
{
  "citations": [
    { "verbatim": "We spend 40h/week on contract review",
      "source_url": "https://news.ycombinator.com/item?id=..." }
  ]
}

Response

// Mode A
{
  "axis": "solutions",
  "label": "Existing solutions",
  "optional_signals": [
    { "kind": "competitor_pricing_scrape", "schema": { ... } }
  ],
  "note": "Collect with WebSearch/WebFetch, then submit via submit_signal."
}

// Mode B
{
  "citations": [
    { "valid": true },
    { "valid": false, "reason": "Quote not found at source_url." }
  ]
}

Telemetry endpoint

The MCP server posts to this endpoint after each tool call. You can also call it directly if you're building a custom integration.

POST/api/telemetry/event

Writes one assessment event to the dashboard. Returns HTTP 204 on success. Rate limit: 100 events/min per API key.

Request body

{
  "session_id": "01HY...",
  "event_kind": "score",          // start | submit_signal | score | roadmap | handoff | export
  "payload":    { ... },
  "verdict":    "iterate",        // for score events
  "total_score": 47               // for score events
}

Response

// HTTP 204 No Content

Error codes

All error responses are JSON: { "error": "code", "message": "..." }

400

Invalid request body or missing required field.

401

Invalid or missing Bearer API key, invalid/expired session token, or session_key_mismatch (token was issued under a different API key — sessions are kid-bound to the key that opened them). Middleware also returns 401 for any /api/scale4/v1/** request with neither a Bearer key nor an authenticated dashboard session.

402

Feature requires a higher tier. Response includes current_tier, required_tier, upgrade_url.

409

Conflict — stackforge_handoff when verdict is not build.

412

Precondition failed — score called before all signals submitted, or roadmap called before scoring.

422

Signal validation failed — URL HEAD check, min-char, or placeholder regex.

429

Rate limit exceeded (free tier: 3 assessments/month; telemetry: 100 events/min).

500

Server error — SCALE4_SESSION_SECRET misconfigured or internal bug.