Skip to main content
DeepResearch runs multi-step research in the background and returns a cited report. Create a task, wait for it to finish, read the output.

Run your first task

from valyu import Valyu

valyu = Valyu()

# Create a task
task = valyu.deepresearch.create(
    query="What are the key differences between RAG and fine-tuning for LLMs?",
    mode="standard"
)

# Wait for it to finish (polls automatically)
result = valyu.deepresearch.wait(task.deepresearch_id)

print(result.output)
for source in result.sources:
    print(f"- {source.title}: {source.url}")
print(f"Cost: ${result.cost}")
import { Valyu } from "valyu-js";

const valyu = new Valyu();

// Create a task
const task = await valyu.deepresearch.create({
  query: "What are the key differences between RAG and fine-tuning for LLMs?",
  mode: "standard"
});

// Wait for it to finish (polls automatically)
const result = await valyu.deepresearch.wait(task.deepresearch_id);

console.log(result.output);
result.sources?.forEach(s => console.log(`- ${s.title}: ${s.url}`));
console.log(`Cost: $${result.cost}`);
# Create a task, then poll GET /v1/deepresearch/tasks/{id}/status until completed
curl -X POST "https://api.valyu.ai/v1/deepresearch/tasks" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "query": "What are the key differences between RAG and fine-tuning for LLMs?",
    "mode": "standard"
  }'
That’s it. The wait helper polls until the task completes, fails, or is cancelled.

Pick a mode

Mode controls depth, latency, and price.
ModePriceBest forTypical time
fast$0.10Quick lookups~5 min
standard$0.50Balanced research (default)~10-20 min
heavy$2.50Complex analysis with fact verificationup to ~90 min
max$15.00Exhaustive research, maximum qualityup to ~180 min
task = valyu.deepresearch.create(query="...", mode="heavy")

Get a PDF

Add pdf to output_formats to get a downloadable report alongside markdown.
task = valyu.deepresearch.create(
    query="Write a report on renewable energy trends",
    output_formats=["markdown", "pdf"]
)
result = valyu.deepresearch.wait(task.deepresearch_id)
print(result.pdf_url)

Next steps

Complete guide

Search config, tools, files, webhooks, and structured output

Batch processing

Run many tasks in parallel with shared config

Workflows

Templated, versioned research

API reference

Endpoint documentation