Skip to main content
Use this guide after your first research task to control what DeepResearch reads, what it produces and how your application tracks the result.

Create, poll, result

Create a task and save its deepresearch_id, then poll its status or receive a webhook. The SDK’s wait helper handles polling. In Python it raises if the task fails, is cancelled or times out; in TypeScript it returns the final status, so check status === "completed" before reading output. Follow the quickstart for the runnable create-and-wait example, or embed research for an application architecture that survives disconnects and retries.

Research modes

Mode changes the research budget, latency and base price. Set it on create. Tool and deliverable charges can apply; see pricing. Compare modes on your own tasks rather than assuming the longest run is always the right choice. When you omit mode, the API and the Python SDK use standard. The TypeScript SDK sends fast when mode is unset, so pass mode explicitly if you want consistent behaviour across SDKs. Searches and page reads inside a task are included in the task price. Each run also has a hard time limit (instant 2 min, fast 10 min, standard 20 min, heavy 45 min, max 90 min), and a queued task can wait before it starts, so set client timeouts at or above the recommended values.

Task statuses

The wait helper polls for completion and raises on failure, cancellation or timeout. For interactive runs, provide a checkpoint handler or respond from your application; an unanswered checkpoint needs input to continue.

Output formats

Default output is markdown. Add pdf, or pass a JSON Schema for structured data.
Pass a JSON Schema as the single output format to get research results as structured data:
You cannot mix JSON Schema with markdown/pdf - use one or the other.

Deliverables

Ask for files and they come back with the report, generated from the same research: up to 10 per task, in every mode except instant. A bare format works ("deliverables": ["xlsx"]), and so does a plain-language description. The structured form takes type, description and, for tables, suggested columns:
Excel, PowerPoint and Word files need code_execution; CSV and PDF don’t. Each file comes back in deliverables with type, status (completed or failed), title, a signed url, and row_count and column_count for tables. The links expire, so download files you need to keep. The first file is included in the task price; see pricing for extra files. See example reports for real deliverables.

Citations and passages

The report cites its sources with numbered markers, and sources lists each one with its title and URL. A source can also carry locations: the exact passages the citation rests on, with the page number when the document has pages.
Use locations to show the line a claim rests on next to the claim. It is optional: a source without a stored passage has no locations. The released SDKs don’t expose the field yet, so read it from the status endpoint response directly. For a link that opens the source at the passage, append fragment to url when it is present.

Guiding research and output

Two optional parameters shape the run. research_strategy guides the search phase (what to look for, which sources to prioritise); report_format controls the final output (structure, style, length).
Use either or both to guide the research and report. Use structured output when your application needs a defined schema rather than relying on prose instructions alone. Combined length must stay under 15,000 characters.
The older strategy parameter is deprecated. Use research_strategy instead; it takes precedence if both are sent.

Search configuration

The search object controls which sources are queried and how results are filtered. Request-level settings are enforced and cannot be overridden by the agent.
search_type - which backends to query:
  • "all" (default): web + proprietary sources
  • "web": general web, news, articles only
  • "proprietary": academic, finance, patents, etc. only
included_sources restricts to only these source types. excluded_sources removes them. Use one, not both. You can also pass individual dataset ids (valyu/valyu-arxiv), domains (nature.com), or a saved collection:<name> - see Targeting sources. Available presets:
Presets group related sources; the medical preset combines several families. academic is papers and preprints only - clinical trials, drug labels, WHO and NIH grants live in health, and ChEMBL/Open Targets/PubChem live in chemistry. To cover life sciences broadly in one preset, use medical.
Soft ranking hints that nudge (but don’t hard-filter) which sources appear. Keys are domains/paths, values are integers from -5 (demote) to +5 (boost).
  • start_date / end_date - ISO YYYY-MM-DD date bounds for the research search configuration. Use either bound or both for a range. Date handling varies by source; inspect returned dates and distinguish publication dates from event dates.
  • reference_date - pins the whole run to a past date, for backtests: research uses sources published, or snapshots captured, on or before that date. end_date with historical_cache: true does the same. Dates before 2026 return a 400. The TypeScript SDK doesn’t forward reference_date yet; send it through the REST API.
  • category - source-dependent category filter.
  • country_code - ISO 3166-1 alpha-2 (e.g. "US", "GB"). Biases web results toward a region; academic/proprietary sources may ignore it.

Tools

Optional capabilities the agent can use during a task. All are off by default and must be explicitly enabled. You enable them; the agent decides when to use them.
Each tool takes { enabled, max_calls }. max_calls can only be lowered below the system default, never raised. See Pricing for surcharges.
Screenshots - max 15/task (5 MB download cap, 1280×4000 px report cap). Appear in images with image_type: "screenshot" plus source_url and captured_at.Code execution - Python only, 5-60s timeout (default 30s), no network access, text output via print().Browser use - max 5 sessions/task.Charts - no additional chart charge. Appear in images with image_type: "chart" plus chart_type, x_axis_label, y_axis_label, and data_series. Chart types include line, bar, area, pie, scatter, heatmap, boxplot, histogram, waterfall, timeline, and more.

File attachments and URLs

Attach documents (PDFs, images, Office files) to analyze as part of research, or pass specific URLs to include.
Max 10 files and 10 URLs per request. Files are validated on upload and rejected with HTTP 400 ({ "error": "..." }) on any violation.
Total across all files: 100 MB. PPTX is converted to markdown slide-by-slide before being sent to the model. Extracted text is truncated at 500K characters.

Task management

Follow-up instructions are only accepted before the writing phase starts. Once report generation begins, they are rejected. Submit them early in the research phase.
You can cancel a task that is running, queued, awaiting_input or paused. A successful cancel returns 200 with "message": "Task cancelled". If the task finishes before the cancel lands, you get 409 with Task is no longer cancellable.

Billing and credit holds

When you create a task, its mode price is held against your balance. The hold is released when the task is charged, or when it turns out to be free. Tool and deliverable charges are added when the task completes and are not part of the hold.
  • Available balance. Your balance minus the holds of your other queued and running tasks must cover the mode price. For example, max needs at least 2,500 credits available, and five standard tasks running at once need 500.
  • 402 Payment Required. If the available balance is too low, the task is not created and the error states the required and available amounts. You also get a 402 if the task would exceed your monthly usage limit (Monthly credit limit exceeded. Please increase your limits.).
  • 503 Service Unavailable. If billing cannot be checked, you get {"error": "Billing temporarily unavailable"} and no task is created. Retry with exponential backoff.
  • Batches. Adding tasks to a batch holds the price of every task in the request at once. Either all of them are added or none are.
  • Late starts. A HITL task resumed more than 24 hours after it paused, or a batch task that waited in the queue for more than 48 hours, needs enough balance when it starts. Otherwise it fails with an Insufficient credits - ... error and is not charged.
DeepResearch error bodies contain an error string and no success field. See pricing for mode prices and optional charges.

Webhooks

Provide a webhook_url to get a POST notification when a task completes or fails, instead of polling. The response includes a webhook_secret for signature verification.
The webhook_secret is only returned on the initial create response - store it securely, you cannot retrieve it later. Webhook URLs must use HTTPS.
Each request includes X-Webhook-Signature (sha256=<hex> HMAC) and X-Webhook-Timestamp (ms). Reconstruct timestamp.payload, HMAC-SHA256 it with your secret, and compare in constant time.
Verify against the original request body. Check timestamp freshness and deduplicate handling by task ID before accepting the event. Return a 2xx quickly after accepting it and process the payload asynchronously.
The payload is the full task object (deepresearch_id, status, output, pdf_url, sources, cost, error, timestamps, etc.).Webhooks fire on completed and failed only - not on cancelled. Use the status endpoint to track cancellations.Failed deliveries retry up to 5 times with exponential backoff (1s → 2s → 4s → 8s → 16s), 15s timeout per attempt. 4xx responses are not retried; 5xx are.

Human-in-the-loop

Add optional checkpoints that pause execution for human review - clarifying questions, plan review, source filtering, or outline review.

HITL guide

Configure and respond to HITL checkpoints

Best practices

  • Pick the right mode - fast for lookups, standard for most work, heavy/max when testing shows the additional research is useful.
  • Narrow scope - use search filters and start_date/end_date to focus on relevant content.
  • Be specific - clear queries plus research_strategy and report_format produce better reports.
  • Use webhooks in production to avoid polling overhead. If polling, scale the interval to the mode (a few seconds for fast, up to 30-60s for max).

Limitations

Next steps

Batch processing

Run many research tasks in parallel

Workflows

Versioned, reusable research for repeatable work

API reference

Complete endpoint documentation

Python SDK

Python SDK reference