πŸ’‘ Try this endpoint in the Playground β†’

Deep Research

Turn any question into a comprehensive, cited research report. WebPeel's deep research agent automatically decomposes your question, searches multiple sources across multiple rounds, and synthesizes a verified report β€” all in one API call.

BYOK (Bring Your Own Key): Deep research requires an LLM for synthesis. Pass your key in the llm field. Supported providers: openai, anthropic, google, ollama, cerebras, cloudflare. If your server has a default LLM configured, the llm field is optional.

How It Works

Endpoint

POST/v1/deep-researchAuth Required

Multi-step research agent. Returns a comprehensive cited report. Supports SSE streaming for real-time progress.

Request Body

ParameterTypeRequiredDescription
question string Required The research question (max 5000 characters).
llm object BYOK LLM configuration object. Required if no server-side default is configured. See BYOK Setup below.
maxRounds number Optional Research rounds (1–5). Default: 3. More rounds = deeper coverage, more time.
maxSources number Optional Maximum sources to consider (5–30). Default: 20.
stream boolean Optional Enable SSE streaming for real-time progress and incremental report text. Default: false.

LLM Object (llm)

FieldTypeDescription
provider string LLM provider: openai, anthropic, google, ollama, cerebras, cloudflare. Default: openai.
apiKey string Your API key for the selected provider. Not required for ollama (local).
model string Model name override (e.g. gpt-4o-mini, claude-3-5-haiku-20241022, gemini-2.0-flash).
endpoint string Custom API endpoint URL. Useful for Ollama (http://localhost:11434) or OpenAI-compatible proxies.

Response (Non-Streaming)

{
  "success": true,
  "report": "## Executive Summary\n\nBased on 14 sources across 3 research rounds, quantum computing has achieved significant milestones in 2024–2025...\n\n## Key Findings\n\n1. **Error correction breakthroughs** β€” Google's Willow chip demonstrated below-threshold error correction for the first time [1][3]\n2. **Commercial availability** β€” IBM, Google, and IonQ now offer cloud access to 100+ qubit processors [2]\n3. **Timeline revised** β€” Most experts now project fault-tolerant quantum computers by 2030–2035 [5][7]\n\n## Detailed Analysis\n\n### Hardware Progress\nThe past 18 months saw rapid progress in qubit fidelity...\n\n## Conclusion\n\nQuantum computing is transitioning from research to early commercial use, but broad practical advantage remains 5–10 years away.\n\n**Confidence: HIGH**",
  "citations": [
    {
      "index": 1,
      "title": "Google Willow: Our New Quantum Chip",
      "url": "https://blog.google/technology/research/google-willow-quantum-chip/",
      "snippet": "Willow can perform a computation in under five minutes that would take today's fastest supercomputers 10 septillion years.",
      "relevanceScore": 0.94
    },
    {
      "index": 2,
      "title": "IBM Quantum Network",
      "url": "https://www.ibm.com/quantum/network",
      "snippet": "Access IBM quantum systems with 127–1000+ qubits through the IBM Quantum Network.",
      "relevanceScore": 0.87
    }
  ],
  "sourcesUsed": 14,
  "roundsCompleted": 3,
  "totalSearchQueries": 9,
  "llmProvider": "openai",
  "tokensUsed": { "input": 18420, "output": 2341 },
  "elapsed": 34201
}

Response Fields

FieldTypeDescription
reportstringFull Markdown research report with inline citations.
citationsarrayAll cited sources with index, title, URL, snippet, and relevance score.
sourcesUsednumberTotal sources fetched and analyzed.
roundsCompletednumberResearch rounds completed (≀ maxRounds).
totalSearchQueriesnumberTotal search queries run across all rounds.
llmProviderstringThe LLM provider that was used.
tokensUsedobject{ input: number, output: number } β€” LLM tokens consumed.
elapsednumberTotal time in milliseconds.

SSE Streaming

Set "stream": true to receive real-time progress events via Server-Sent Events. The connection stays open while research runs; events stream as they occur.

Each event is a JSON object on a data: SSE line:

type: "progress"

Progress updates during research. Fields: type, message, round, data (optional extra info).

data: {"eventType":"progress","type":"decomposing","message":"Decomposing question into sub-queries…","round":0}
data: {"eventType":"progress","type":"searching","message":"Searching: quantum error correction 2024","round":0}
data: {"eventType":"progress","type":"fetching","message":"Fetching 8 sources…","round":0}
data: {"eventType":"progress","type":"synthesizing","message":"Synthesizing report from 14 sources…"}
type: "chunk"

Incremental report text as the LLM generates it. Concatenate all chunks to build the full report.

data: {"type":"chunk","text":"## Executive Summary\n\n"}
data: {"type":"chunk","text":"Based on 14 sources across 3 research rounds"}
type: "done"

Final event with metadata. The full report is assembled from all chunk events.

data: {"type":"done","citations":[...],"sourcesUsed":14,"roundsCompleted":3,"totalSearchQueries":9,"llmProvider":"openai","tokensUsed":{"input":18420,"output":2341},"elapsed":34201}
type: "error"

Emitted if research fails. Check message for details.

data: {"type":"error","message":"LLM API key rejected by provider"}

BYOK β€” Bring Your Own LLM Key

Deep research uses LLMs for query decomposition, gap detection, and report synthesis. You provide your own key β€” WebPeel never stores it.

OpenAI

"provider": "openai"
Default model: gpt-4o-mini
Best for: speed + quality balance

Anthropic

"provider": "anthropic"
Default model: claude-3-5-haiku-20241022
Best for: long-context synthesis

Google

"provider": "google"
Default model: gemini-2.0-flash
Best for: cost efficiency

Ollama (local)

"provider": "ollama"
No API key needed
Best for: privacy / self-hosted

Cerebras

"provider": "cerebras"
Default model: llama3.1-70b
Best for: ultra-fast inference

Code Examples

curl -X POST https://api.webpeel.dev/v1/deep-research \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "What are the current state and limitations of quantum computing?",
    "llm": {
      "provider": "openai",
      "apiKey": "sk-...",
      "model": "gpt-4o-mini"
    },
    "maxRounds": 3,
    "maxSources": 20
  }'
# Stream progress and report text in real-time
curl -X POST https://api.webpeel.dev/v1/deep-research \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "question": "What are the current state and limitations of quantum computing?",
    "llm": { "provider": "openai", "apiKey": "sk-..." },
    "stream": true
  }'

# Example SSE output:
# data: {"eventType":"progress","type":"decomposing","message":"Decomposing question...","round":0}
# data: {"eventType":"progress","type":"searching","message":"Searching: quantum computing 2025","round":0}
# data: {"type":"chunk","text":"## Executive Summary\n\n"}
# data: {"type":"done","sourcesUsed":12,"roundsCompleted":3,...}
const response = await fetch('https://api.webpeel.dev/v1/deep-research', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.WEBPEEL_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    question: 'What are the current state and limitations of quantum computing?',
    llm: {
      provider: 'openai',
      apiKey: process.env.OPENAI_API_KEY,
      model: 'gpt-4o-mini',
    },
    maxRounds: 3,
    maxSources: 20,
  }),
});

const data = await response.json();

console.log(data.report);            // Full markdown report
console.log(data.citations.length);  // Number of cited sources
console.log(`${data.sourcesUsed} sources, ${data.roundsCompleted} rounds, ${data.elapsed}ms`);
import { createParser } from 'eventsource-parser';

const response = await fetch('https://api.webpeel.dev/v1/deep-research', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.WEBPEEL_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    question: 'What is the current state of quantum computing?',
    llm: { provider: 'openai', apiKey: process.env.OPENAI_API_KEY },
    stream: true,
  }),
});

let report = '';
const parser = createParser((event) => {
  if (event.type !== 'event') return;
  const data = JSON.parse(event.data);

  if (data.eventType === 'progress') {
    process.stdout.write(`[${data.type}] ${data.message}\n`);
  } else if (data.type === 'chunk') {
    process.stdout.write(data.text);
    report += data.text;
  } else if (data.type === 'done') {
    console.log(`\n\nDone: ${data.sourcesUsed} sources, ${data.elapsed}ms`);
    console.log('Citations:', data.citations.length);
  } else if (data.type === 'error') {
    console.error('Error:', data.message);
  }
});

const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  parser.feed(decoder.decode(value));
}
import requests, os

response = requests.post(
    'https://api.webpeel.dev/v1/deep-research',
    headers={
        'Authorization': f'Bearer {os.environ["WEBPEEL_API_KEY"]}',
        'Content-Type': 'application/json',
    },
    json={
        'question': 'What are the current state and limitations of quantum computing?',
        'llm': {
            'provider': 'openai',
            'apiKey': os.environ['OPENAI_API_KEY'],
            'model': 'gpt-4o-mini',
        },
        'maxRounds': 3,
        'maxSources': 20,
    },
    timeout=120,  # deep research can take 30-90s
)

data = response.json()
print(data['report'])
print(f"\n{data['sourcesUsed']} sources, {data['roundsCompleted']} rounds, {data['elapsed']}ms")
print(f"Citations: {len(data['citations'])}")
for cite in data['citations']:
    print(f"  [{cite['index']}] {cite['title']} β€” {cite['url']}")
import requests, json, os

with requests.post(
    'https://api.webpeel.dev/v1/deep-research',
    headers={
        'Authorization': f'Bearer {os.environ["WEBPEEL_API_KEY"]}',
        'Content-Type': 'application/json',
    },
    json={
        'question': 'What is the current state of quantum computing?',
        'llm': {'provider': 'openai', 'apiKey': os.environ['OPENAI_API_KEY']},
        'stream': True,
    },
    stream=True,
    timeout=120,
) as resp:
    report_parts = []
    for line in resp.iter_lines():
        if not line or not line.startswith(b'data: '):
            continue
        event = json.loads(line[6:])
        if event.get('eventType') == 'progress':
            print(f"[{event['type']}] {event['message']}")
        elif event.get('type') == 'chunk':
            print(event['text'], end='', flush=True)
            report_parts.append(event['text'])
        elif event.get('type') == 'done':
            print(f"\n\nComplete: {event['sourcesUsed']} sources, {event['elapsed']}ms")
        elif event.get('type') == 'error':
            print(f"Error: {event['message']}")

report = ''.join(report_parts)

Rate Limits & Scopes

PlanRequests/hourMax roundsMax sources
Free5210
Starter20320
Pro60530
EnterpriseUnlimited530

Deep research requires a full or read scope API key. Create one at app.webpeel.dev/keys.

Error Codes

Error CodeStatusCause
authentication_required401Missing or invalid API key.
invalid_request400Missing question, question too long (>5000 chars), or invalid llm.provider.
llm_required400No llm config provided and no server default configured.
llm_auth_failed401The LLM provider rejected the API key.
rate_limit_exceeded429WebPeel rate limit hit. Retry after the indicated interval.
free_tier_limit429Free tier LLM quota exhausted. Provide your own API key to continue.
deep_research_failed500Internal error during research. Check hint for details.

Deep Research vs. /v1/research vs. /v1/ask

/v1/deep-research/v1/research/v1/ask
OutputFull cited research report (Markdown)Concise synthesis paragraphSingle best-answer sentence
LLM requiredYes (BYOK)No (self-hosted Ollama by default, BYOK optional)No (BM25 scoring)
Search rounds1–5 (iterative, gap-filling)11
SourcesUp to 30Up to 5Up to 5
Time30–120 seconds5–15 seconds1–5 seconds
Best forResearch reports, deep divesQuick research with AI summaryQuick facts, RAG pipelines
New: /v1/research β€” A lightweight research endpoint that chains search β†’ fetch β†’ compile using WebPeel's self-hosted LLM. No API key needed for the LLM β€” works on the free tier. See the API Reference for details.

See Also