API Documentation

Integrate Cogita assessments into your application.

Quick start

# 1. Sign up (get API key + $5 free credits)
curl -X POST https://cogita.app/api/signup \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]"}'

# 2. Run an assessment
curl -X POST https://cogita.app/api/predict \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cog_your_key" \
  -d '{"question":"Will inflation stay above 3% through 2027?","depth":"quick"}'

# 3. Check balance
curl https://cogita.app/api/balance \
  -H "Authorization: Bearer cog_your_key"

Authentication

All assessment requests require authentication. Two options:

API KeyHeader: Authorization: Bearer cog_...
x402Header: X-Payment-Response: <signed> (USDC on Base)

Sign up at /account or POST to /api/signup to get an API key with $5 free credits.

Pricing

Quick (3 reasoning models, no debate)$1
Standard (3 models, 2 debate rounds)$5
Deep (5 models, 3 debate rounds)$15
Follow-up assessment$0.50

Automatic loyalty discounts: 10% off after $50 spent, 20% off after $200 spent.

Endpoints

POST/api/predict
Run an assessment. Returns SSE stream. Body: {"question", "depth", "seed?"}
GET/api/predict/{id}
Retrieve a completed assessment by ID.
POST/api/signup
Create account. Body: {"email"}. Returns API key + $5 credits.
GET/api/balance
Check remaining credits. Requires auth.
GET/api/account
Full account details: credits, usage, member since. Requires auth.
POST/api/stripe/checkout
Buy credits. Body: {"credits_usd": 10}. Returns Stripe checkout URL.
GET/api/predictions
List public assessments. Params: limit, offset.
GET/api/match?q=...
Check if a similar assessment already exists (free, no credits used).
GET/api/context?q=...
Search the web for current context on a topic (free).
GET/api/constraints?q=...
Generate suggested constraints for a question (free).
GET/api/pricing
Current pricing tiers.
GET/api/explore
Trending topics, active markets, and recent assessments.
GET/api/health
Service status and assessment count.

Response format

The /api/predict endpoint returns an SSE stream. The final event contains the full result:

{
  "phase": "complete",
  "result": {
    "prediction": "The assessment conclusion...",
    "probability": 65.0,
    "confidence": "medium",
    "factors_for": ["Supporting argument 1", "Supporting argument 2"],
    "factors_against": ["Counterargument 1"],
    "dissent": [{"agent": "Contrarian", "probability": 30, "reasoning": "..."}],
    "consensus_pct": 82.0,
    "sources": [{"title": "...", "snippet": "...", "url": "..."}],
    "follow_ups": ["Follow-up question 1?", "Follow-up question 2?"],
    "agents": [...],
    "duration_ms": 35000
  }
}

Machine-readable specs

For automated integration:

OpenAPI 3.1 specFull schema for all endpoints
AI Plugin manifestOpenAI plugin format
x402 payment infoCrypto payment discovery