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.

Read the newer response fields

Task responses carry newer fields. Read these fields in new code. The older fields stay for now. The older cost, mode, format and error behaviour is deprecated. The API still sends cost_breakdown, mode and output_formats. Valyu will remove them later. You get at least 30 days’ notice before removal. Use valyu-py 2.13.7 or later, or valyu-js 2.11.7 or later. These versions read all the new fields. For a field that is present only when it applies, fall back to the older field:

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, PDF, JSON and HTML 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. Excel, PowerPoint and Word files use 55 credits each and HTML files use 100 credits each, with no included file. One CSV or JSON file per task is included (they share it), then 15 credits for each extra file. PDF files are always included and do not use the included file. See pricing. See example reports for real deliverables.

JSON deliverable

A json deliverable gives you a data file that your code can read. The file is served as application/json. Every number in the file is a number that the report states. Without schema, the file has this default shape. The tables come from the tables in the report.
Send schema to set the shape yourself. The file must then validate against your schema.
Rules for schema:
  • JSON Schema 2020-12 is the default. Draft-07 is used when the $schema header says so, or when the schema uses the draft-07 tuple form items: [...].
  • $defs, definitions and recursive references work.
  • Only internal references (#/...) are allowed. An external $ref URL is refused.
  • pattern and patternProperties use RE2 syntax. Lookahead, lookbehind and backreferences are refused.
  • The schema can have at most 20,000 characters.
  • Formats such as email, date, date-time and uri are checked.
  • OpenAPI nullable: true is accepted.
An invalid schema returns 400 with the code DELIVERABLE_SCHEMA_INVALID, and no task is created. On any other deliverable type, schema is ignored and the task gets a deliverable_adjusted warning. schema is separate from output_formats, which shapes the report itself.

HTML deliverable

An html deliverable is a self-contained interactive web page of the report. It makes no external requests and opens offline.

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.
  • historical_cache_strict - how strictly a backtest run holds its cutoff: prefer (default), only or off, the same values as Search. It applies to every web search, page read, screenshot and URL in the task. Under prefer, a page with no snapshot at or before the cutoff is read live, so it can contain text written after the cutoff. Under only, that page is dropped. For strict backtests, use only. Python: pass search as a dict (any valyu-py version). TypeScript: historicalCacheStrict, valyu-js >= 2.10.2.
  • 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.
A strict backtest:

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.
X search runs automatically for organisations with X access. It uses 32 credits for each call that returns posts. Send "tools": { "x_search": false } to turn it off. 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 50 URLs per request. The first 10 URLs are free. Each extra URL uses 8 credits. Scanned pages (OCR) in URL files and uploaded files use 2.4 credits per page, for tasks created from 2026-11-13. 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.

Concurrency limits

Your plan caps how many of your DeepResearch tasks run at once, across every task, batch and task added to a batch. A task over the cap is still created and still holds its credits. It waits as queued and starts automatically when one of your running tasks finishes. Nothing is rejected for being over the cap. When a create would push you over your cap, the response’s message says so and gives the link to raise it:
Your organisation’s admins also get an email the first time in two weeks that tasks queue behind the limit, listing the plans that run more at once. A new plan’s limit applies from your next DeepResearch request, including to tasks already waiting. See DeepResearch concurrency on the pricing page.

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