curl --request POST \
--url https://api.valyu.ai/v1/deepresearch/batches \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Q4 2024 Earnings Analysis",
"mode": "standard",
"output_formats": [
"markdown",
"pdf"
],
"search": {
"search_type": "proprietary",
"included_sources": [
"finance"
]
}
}
'import requests
url = "https://api.valyu.ai/v1/deepresearch/batches"
payload = {
"name": "Q4 2024 Earnings Analysis",
"mode": "standard",
"output_formats": ["markdown", "pdf"],
"search": {
"search_type": "proprietary",
"included_sources": ["finance"]
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Q4 2024 Earnings Analysis',
mode: 'standard',
output_formats: ['markdown', 'pdf'],
search: {search_type: 'proprietary', included_sources: ['finance']}
})
};
fetch('https://api.valyu.ai/v1/deepresearch/batches', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valyu.ai/v1/deepresearch/batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Q4 2024 Earnings Analysis',
'mode' => 'standard',
'output_formats' => [
'markdown',
'pdf'
],
'search' => [
'search_type' => 'proprietary',
'included_sources' => [
'finance'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.valyu.ai/v1/deepresearch/batches"
payload := strings.NewReader("{\n \"name\": \"Q4 2024 Earnings Analysis\",\n \"mode\": \"standard\",\n \"output_formats\": [\n \"markdown\",\n \"pdf\"\n ],\n \"search\": {\n \"search_type\": \"proprietary\",\n \"included_sources\": [\n \"finance\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.valyu.ai/v1/deepresearch/batches")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Q4 2024 Earnings Analysis\",\n \"mode\": \"standard\",\n \"output_formats\": [\n \"markdown\",\n \"pdf\"\n ],\n \"search\": {\n \"search_type\": \"proprietary\",\n \"included_sources\": [\n \"finance\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valyu.ai/v1/deepresearch/batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Q4 2024 Earnings Analysis\",\n \"mode\": \"standard\",\n \"output_formats\": [\n \"markdown\",\n \"pdf\"\n ],\n \"search\": {\n \"search_type\": \"proprietary\",\n \"included_sources\": [\n \"finance\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"batch_id": "batch_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "open",
"mode": "standard",
"name": "Q4 2024 Earnings Analysis",
"output_formats": [
"markdown",
"pdf"
],
"search_params": {
"search_type": "proprietary",
"included_sources": [
"finance"
]
},
"counts": {
"total": 0,
"queued": 0,
"running": 0,
"completed": 0,
"failed": 0,
"cancelled": 0
},
"cost": 0,
"created_at": "2024-06-15T10:30:00.000Z",
"webhook_secret": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef12345678"
}{
"success": false,
"error": "Invalid search_type. Must be 'all', 'web', 'proprietary', or 'news'"
}{
"success": false,
"error": "Invalid API key"
}{
"success": false,
"error": "Insufficient credits. Please top up your account at platform.valyu.ai"
}{
"success": false,
"error": "API key does not have inference permission"
}{
"success": false,
"error": "Internal server error. Please try again later."
}Create Batch
Reference for creating a new batch via POST /v1/deepresearch/batches.
curl --request POST \
--url https://api.valyu.ai/v1/deepresearch/batches \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Q4 2024 Earnings Analysis",
"mode": "standard",
"output_formats": [
"markdown",
"pdf"
],
"search": {
"search_type": "proprietary",
"included_sources": [
"finance"
]
}
}
'import requests
url = "https://api.valyu.ai/v1/deepresearch/batches"
payload = {
"name": "Q4 2024 Earnings Analysis",
"mode": "standard",
"output_formats": ["markdown", "pdf"],
"search": {
"search_type": "proprietary",
"included_sources": ["finance"]
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Q4 2024 Earnings Analysis',
mode: 'standard',
output_formats: ['markdown', 'pdf'],
search: {search_type: 'proprietary', included_sources: ['finance']}
})
};
fetch('https://api.valyu.ai/v1/deepresearch/batches', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valyu.ai/v1/deepresearch/batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Q4 2024 Earnings Analysis',
'mode' => 'standard',
'output_formats' => [
'markdown',
'pdf'
],
'search' => [
'search_type' => 'proprietary',
'included_sources' => [
'finance'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.valyu.ai/v1/deepresearch/batches"
payload := strings.NewReader("{\n \"name\": \"Q4 2024 Earnings Analysis\",\n \"mode\": \"standard\",\n \"output_formats\": [\n \"markdown\",\n \"pdf\"\n ],\n \"search\": {\n \"search_type\": \"proprietary\",\n \"included_sources\": [\n \"finance\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.valyu.ai/v1/deepresearch/batches")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Q4 2024 Earnings Analysis\",\n \"mode\": \"standard\",\n \"output_formats\": [\n \"markdown\",\n \"pdf\"\n ],\n \"search\": {\n \"search_type\": \"proprietary\",\n \"included_sources\": [\n \"finance\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valyu.ai/v1/deepresearch/batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Q4 2024 Earnings Analysis\",\n \"mode\": \"standard\",\n \"output_formats\": [\n \"markdown\",\n \"pdf\"\n ],\n \"search\": {\n \"search_type\": \"proprietary\",\n \"included_sources\": [\n \"finance\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"batch_id": "batch_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "open",
"mode": "standard",
"name": "Q4 2024 Earnings Analysis",
"output_formats": [
"markdown",
"pdf"
],
"search_params": {
"search_type": "proprietary",
"included_sources": [
"finance"
]
},
"counts": {
"total": 0,
"queued": 0,
"running": 0,
"completed": 0,
"failed": 0,
"cancelled": 0
},
"cost": 0,
"created_at": "2024-06-15T10:30:00.000Z",
"webhook_secret": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef12345678"
}{
"success": false,
"error": "Invalid search_type. Must be 'all', 'web', 'proprietary', or 'news'"
}{
"success": false,
"error": "Invalid API key"
}{
"success": false,
"error": "Insufficient credits. Please top up your account at platform.valyu.ai"
}{
"success": false,
"error": "API key does not have inference permission"
}{
"success": false,
"error": "Internal server error. Please try again later."
}Authorizations
API key for authentication. Get yours at platform.valyu.ai.
Body
Create a new batch for running multiple DeepResearch tasks with shared configuration.
Optional name for the batch.
"Q4 Earnings Analysis Batch"
Research mode applied to all tasks in the batch.
fast, standard, heavy, max Deprecated. Use mode instead.
fast, standard, heavy, max Output formats applied to all tasks.
markdown, pdf Search configuration for DeepResearch tasks.
Show child attributes
Show child attributes
HTTPS URL to receive a webhook when all tasks complete.
Arbitrary key-value metadata.
Show child attributes
Show child attributes
Response
Batch created.
Batch status and metadata.
Unique batch identifier.
"batch_a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Batch lifecycle status.
open- Batch created, accepting tasksprocessing- Tasks are runningcompleted- All tasks finished successfullycompleted_with_errors- All tasks finished, some failedcancelled- Batch was cancelled
open, processing, completed, completed_with_errors, cancelled "processing"
Research mode for all tasks in this batch.
fast, standard, heavy, max "standard"
ISO 8601 timestamp of batch creation.
"2024-06-15T10:30:00.000Z"
Task count breakdown for a batch.
Show child attributes
Show child attributes
Aggregated cost in USD across all tasks.
5
Human-readable name for the batch.
"Q4 Earnings Analysis Batch"
Output formats configured for all tasks.
["markdown"]
Shared search configuration.
ISO 8601 timestamp. Present when batch is completed.
HMAC-SHA256 secret. Only present on creation when webhook_url was provided.
Was this page helpful?

