Skip to main content
The Rust SDK is in alpha. Interfaces may change between releases; check the crate version before upgrading.
Run a multi-step investigation and retrieve a cited report or structured output. Create a task, retain its ID, then wait for completion or receive a webhook.
For the conceptual overview, search configuration, and best practices, see the DeepResearch Guide. This page is the Rust SDK method reference.

Basic usage

The Rust SDK does not model the cost and cost_breakdown fields of the status response yet, and the API no longer returns the legacy usage field, so result.usage is always None. To read a task’s charge, call GET /v1/deepresearch/tasks/{id}/status directly.

Research modes

Use DeepResearchMode::Fast (25 credits per task), ::Standard (100 credits, the default) or ::Heavy (500). The Rust SDK has no max or instant variant; to run max (2,500 credits), call the REST API directly. Tool and deliverable charges can apply; see pricing and the DeepResearch guide for mode selection. Creating a task holds its mode price against your balance. If the available balance is too low, the API returns 402 with the required and available amounts; if billing cannot be checked, it returns 503 and you should retry with backoff. See billing and credit holds.

Builder pattern

Use DeepResearchCreateRequest for full control, then call client.deepresearch_create(&request):
In production, prefer webhooks over polling. The webhook_secret is returned only once on create - store it securely:

Reference

input (impl Into<String>, required) - research query or task description.
DeepResearchSearchConfig (passed via with_search()) controls which sources are queried. Request-level parameters are enforced and cannot be overridden by the agent.
Source presets: web, academic, finance, health, medical, chemistry, genomics, physics, patent, transportation, politics, legal, cybersecurity, environment, automotive, compliance, pulse. You can also pass dataset ids, domains, or collection:<name>. The 0.3 SDK search configuration exposes search_type and included_sources. Use the REST API for parameters not exposed by this SDK version. See the DeepResearch Guide for full detail.
This example also requires base64 = "0.22" and serde_json = "1" in Cargo.toml.
Up to 10 deliverables per task (csv, xlsx, pptx, docx, pdf), generated after research completes. Supported file types: PDFs, images (PNG, JPEG, WebP), and documents.
deepresearch_wait errors when the task is cancelled or the timeout is exceeded - use a longer timeout for heavy mode (about 60 minutes) and max mode (about 120 minutes).