Start research task
Starts a deep research task that runs multiple searches, reads sources, and synthesizes an answer with citations.
Synchronous mode (default)
When background is false or omitted, the request blocks until the research completes and returns the answer with citations. This can take up to 120 seconds depending on research_effort.
Asynchronous mode
When background is true, the request returns immediately with a task_id and status: pending. Poll GET /web_search/research/{task_id} to check when the research completes and retrieve the answer.
POST
/
web_search
/
research
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.webSearch.research.create({
query: 'Compare the performance of RAG vs fine-tuning for domain-specific QA',
});
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.web_search.research.create(
query="Compare the performance of RAG vs fine-tuning for domain-specific QA",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
research, err := client.WebSearch.Research.New(
context.TODO(),
telnyx.WebSearchResearchNewParams{
Query: "Compare the performance of RAG vs fine-tuning for domain-specific QA",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", research.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.webSearch.research.ResearchCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ResearchCreateParams params = ResearchCreateParams.builder()
.query("Compare the performance of RAG vs fine-tuning for domain-specific QA")
.build();
var response = client.webSearch().research().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.web_search.research.create(query: "Compare the performance of RAG vs fine-tuning for domain-specific QA")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->webSearch->research->create(
query: 'Compare the performance of RAG vs fine-tuning for domain-specific QA',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx web-search:research create \
--api-key 'My API Key' \
--query 'Compare the performance of RAG vs fine-tuning for domain-specific QA'curl --request POST \
--url https://api.telnyx.com/v2/web_search/research \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "Compare the performance of RAG vs fine-tuning for domain-specific QA",
"research_effort": "standard",
"max_sources": 20,
"background": false
}
'{
"data": {
"answer": "RAG and fine-tuning serve different purposes...",
"citations": [
{
"url": "https://arxiv.org/abs/2401.15884",
"title": "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks",
"snippet": "We show that RAG models produce more factually grounded responses..."
}
]
}
}Body
application/json
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.webSearch.research.create({
query: 'Compare the performance of RAG vs fine-tuning for domain-specific QA',
});
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.web_search.research.create(
query="Compare the performance of RAG vs fine-tuning for domain-specific QA",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
research, err := client.WebSearch.Research.New(
context.TODO(),
telnyx.WebSearchResearchNewParams{
Query: "Compare the performance of RAG vs fine-tuning for domain-specific QA",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", research.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.webSearch.research.ResearchCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ResearchCreateParams params = ResearchCreateParams.builder()
.query("Compare the performance of RAG vs fine-tuning for domain-specific QA")
.build();
var response = client.webSearch().research().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.web_search.research.create(query: "Compare the performance of RAG vs fine-tuning for domain-specific QA")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->webSearch->research->create(
query: 'Compare the performance of RAG vs fine-tuning for domain-specific QA',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx web-search:research create \
--api-key 'My API Key' \
--query 'Compare the performance of RAG vs fine-tuning for domain-specific QA'curl --request POST \
--url https://api.telnyx.com/v2/web_search/research \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "Compare the performance of RAG vs fine-tuning for domain-specific QA",
"research_effort": "standard",
"max_sources": 20,
"background": false
}
'{
"data": {
"answer": "RAG and fine-tuning serve different purposes...",
"citations": [
{
"url": "https://arxiv.org/abs/2401.15884",
"title": "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks",
"snippet": "We show that RAG models produce more factually grounded responses..."
}
]
}
}