The Rust SDK is in alpha. Interfaces may change between releases; check the crate version before upgrading.
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
UseDeepResearchMode::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
UseDeepResearchCreateRequest for full control, then call client.deepresearch_create(&request):
webhook_secret is returned only once on create - store it securely:
Reference
Builder methods
Builder methods
input (impl Into<String>, required) - research query or task description.Search configuration
Search configuration
DeepResearchSearchConfig (passed via with_search()) controls which sources are queried. Request-level parameters are enforced and cannot be overridden by the agent.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.Deliverables and file attachments
Deliverables and file attachments
This example also requires 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.
base64 = "0.22" and serde_json = "1" in Cargo.toml.Client methods
Client methods
Response types
Response types
Error handling
Error handling
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).