Execute AI-powered research queries that search the web, analyze sources, and synthesize comprehensive answers. This endpoint always streams responses using Server-Sent Events (SSE).
Streaming Response:
- All responses are streamed using Server-Sent Events (
text/event-stream) - Real-time progress updates as research progresses through phases
Research Modes:
fast- Quick answers with minimal web searches (default)balanced- Standard research with multiple iterations
Use Cases:
- Answering complex questions with cited sources
- Synthesizing information from multiple web sources
- Research reports on specific topics
- Fact-checking and verification tasks
ParametersExpand Collapse
ReturnsExpand Collapse
type ResearchEventUnion interface{…}A Server-Sent Event from /v1/research. Typed discriminated union keyed on event.
A Server-Sent Event from /v1/research. Typed discriminated union keyed on event.
type ResearchEventAnalyzingEnd struct{…}Envelope for the “analyzing:end” event from /v1/research.
Envelope for the “analyzing:end” event from /v1/research.
Data ResearchEventAnalyzingEndData
Samples []ResearchEventAnalyzingEndDataSample
URLSource stringURL source tracking - where a URL came from
URL source tracking - where a URL came from
Relevance stringOptional
type ResearchEventAnalyzingStart struct{…}Envelope for the “analyzing:start” event from /v1/research.
Envelope for the “analyzing:start” event from /v1/research.
type ResearchEventComplete struct{…}Envelope for the “complete” event from /v1/research.
Envelope for the “complete” event from /v1/research.
Data ResearchEventCompleteDatacomplete - Research finished successfully
complete - Research finished successfully
Metadata ResearchEventCompleteDataMetadataResearch metadata
Note: citedPages, gapEvaluations, outline, and judgments are optional to support fast mode, which skips these phases for maximum speed.
Research metadata
Note: citedPages, gapEvaluations, outline, and judgments are optional to support fast mode, which skips these phases for maximum speed.
Mode stringResearch mode determines depth, thinking budget, and quality controls
Modes (in order of cost/thoroughness):
- fast: Quick answers with minimal validation (~$2, 1 iteration, no judge)
- balanced: Standard research with moderate depth (~$8, 3 iterations, Flash models, no judge)
- deep: Thorough research with judge review (~$15, 5 iterations, Flash models, with judge)
- max: Maximum quality with Pro models (~$40, 5 iterations, Pro models, with judge)
- ultra: Ultimate tier - all Pro models, 10 iterations (expensive, for when accuracy is paramount)
Research mode determines depth, thinking budget, and quality controls
Modes (in order of cost/thoroughness):
- fast: Quick answers with minimal validation (~$2, 1 iteration, no judge)
- balanced: Standard research with moderate depth (~$8, 3 iterations, Flash models, no judge)
- deep: Thorough research with judge review (~$15, 5 iterations, Flash models, with judge)
- max: Maximum quality with Pro models (~$40, 5 iterations, Pro models, with judge)
- ultra: Ultimate tier - all Pro models, 10 iterations (expensive, for when accuracy is paramount)
QueryComplexity string
CitedPages []ResearchEventCompleteDataMetadataCitedPageOptionalPages cited in the report, ordered by first citation appearance
Pages cited in the report, ordered by first citation appearance
Full page text (fetched markdown or search excerpts). Only populated when includeFullText: true in ResearchOptions.
- Fast mode: Parallel API excerpts (~5000 chars)
- Other modes: Fetched page markdown
Relevance stringOptional
Reliability stringOptional
URLSource stringOptionalURL source tracking - where a URL came from
URL source tracking - where a URL came from
GapEvaluations []ResearchEventCompleteDataMetadataGapEvaluationOptional
Based on unanswered/partial questions, what specific information is still needed?
QuestionAssessments []ResearchEventCompleteDataMetadataGapEvaluationQuestionAssessmentAssessment of each research question’s status and findings
Assessment of each research question’s status and findings
Status stringStatus: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)
Status: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)
ResearchCoverage stringResearch coverage level - assesses quality across all questions.
Hierarchy: Light < Moderate < Solid < Comprehensive
- Light: Basic info on some questions, most need more depth → Continue
- Moderate: Multiple questions answered, some remain partial → Continue
- Solid: Most questions well-answered with validated sources → Sufficient to stop
- Comprehensive: All questions thoroughly answered, exceptional depth → Definitely stop
Research coverage level - assesses quality across all questions.
Hierarchy: Light < Moderate < Solid < Comprehensive
- Light: Basic info on some questions, most need more depth → Continue
- Moderate: Multiple questions answered, some remain partial → Continue
- Solid: Most questions well-answered with validated sources → Sufficient to stop
- Comprehensive: All questions thoroughly answered, exceptional depth → Definitely stop
Explicit decision: should research continue with another iteration?
- Considers: how many questions unanswered/partial, coverage for mode, remaining iterations
- Drives query generation: true → generate queries, false → stop researching
Metrics ResearchEventCompleteDataMetadataMetricsOptionalComplete research metrics
Complete research metrics
Phases map[string, ResearchEventCompleteDataMetadataMetricsPhase]Phase timings with duration in milliseconds
Phase timings with duration in milliseconds
type ResearchEventError struct{…}Envelope for the “error” event from /v1/research.
Envelope for the “error” event from /v1/research.
type ResearchEventEvaluatingEnd struct{…}Envelope for the “evaluating:end” event from /v1/research.
Envelope for the “evaluating:end” event from /v1/research.
Data ResearchEventEvaluatingEndData
Coverage string
QuestionAssessments []ResearchEventEvaluatingEndDataQuestionAssessment
Status stringStatus: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)
Status: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)
type ResearchEventEvaluatingStart struct{…}Envelope for the “evaluating:start” event from /v1/research.
Envelope for the “evaluating:start” event from /v1/research.
type ResearchEventFollowingEnd struct{…}Envelope for the “following:end” event from /v1/research.
Envelope for the “following:end” event from /v1/research.
Data ResearchEventFollowingEndData
Samples []ResearchEventFollowingEndDataSample
URLSource stringURL source tracking - where a URL came from
URL source tracking - where a URL came from
Relevance stringOptional
type ResearchEventFollowingStart struct{…}Envelope for the “following:start” event from /v1/research.
Envelope for the “following:start” event from /v1/research.
type ResearchEventIterationEnd struct{…}Envelope for the “iteration:end” event from /v1/research.
Envelope for the “iteration:end” event from /v1/research.
type ResearchEventIterationStart struct{…}Envelope for the “iteration:start” event from /v1/research.
Envelope for the “iteration:start” event from /v1/research.
type ResearchEventOutliningStart struct{…}Envelope for the “outlining:start” event from /v1/research.
Envelope for the “outlining:start” event from /v1/research.
type ResearchEventPlanningEnd struct{…}Envelope for the “planning:end” event from /v1/research.
Envelope for the “planning:end” event from /v1/research.
type ResearchEventPrefetchingEnd struct{…}Envelope for the “prefetching:end” event from /v1/research.
Envelope for the “prefetching:end” event from /v1/research.
type ResearchEventPrefetchingStart struct{…}Envelope for the “prefetching:start” event from /v1/research.
Envelope for the “prefetching:start” event from /v1/research.
type ResearchEventSearchingStart struct{…}Envelope for the “searching:start” event from /v1/research.
Envelope for the “searching:start” event from /v1/research.
type ResearchEventUnion interface{…}A Server-Sent Event from /v1/research. Typed discriminated union keyed on event.
A Server-Sent Event from /v1/research. Typed discriminated union keyed on event.
type ResearchEventAnalyzingEnd struct{…}Envelope for the “analyzing:end” event from /v1/research.
Envelope for the “analyzing:end” event from /v1/research.
Data ResearchEventAnalyzingEndData
Samples []ResearchEventAnalyzingEndDataSample
URLSource stringURL source tracking - where a URL came from
URL source tracking - where a URL came from
Relevance stringOptional
type ResearchEventAnalyzingStart struct{…}Envelope for the “analyzing:start” event from /v1/research.
Envelope for the “analyzing:start” event from /v1/research.
type ResearchEventComplete struct{…}Envelope for the “complete” event from /v1/research.
Envelope for the “complete” event from /v1/research.
Data ResearchEventCompleteDatacomplete - Research finished successfully
complete - Research finished successfully
Metadata ResearchEventCompleteDataMetadataResearch metadata
Note: citedPages, gapEvaluations, outline, and judgments are optional to support fast mode, which skips these phases for maximum speed.
Research metadata
Note: citedPages, gapEvaluations, outline, and judgments are optional to support fast mode, which skips these phases for maximum speed.
Mode stringResearch mode determines depth, thinking budget, and quality controls
Modes (in order of cost/thoroughness):
- fast: Quick answers with minimal validation (~$2, 1 iteration, no judge)
- balanced: Standard research with moderate depth (~$8, 3 iterations, Flash models, no judge)
- deep: Thorough research with judge review (~$15, 5 iterations, Flash models, with judge)
- max: Maximum quality with Pro models (~$40, 5 iterations, Pro models, with judge)
- ultra: Ultimate tier - all Pro models, 10 iterations (expensive, for when accuracy is paramount)
Research mode determines depth, thinking budget, and quality controls
Modes (in order of cost/thoroughness):
- fast: Quick answers with minimal validation (~$2, 1 iteration, no judge)
- balanced: Standard research with moderate depth (~$8, 3 iterations, Flash models, no judge)
- deep: Thorough research with judge review (~$15, 5 iterations, Flash models, with judge)
- max: Maximum quality with Pro models (~$40, 5 iterations, Pro models, with judge)
- ultra: Ultimate tier - all Pro models, 10 iterations (expensive, for when accuracy is paramount)
QueryComplexity string
CitedPages []ResearchEventCompleteDataMetadataCitedPageOptionalPages cited in the report, ordered by first citation appearance
Pages cited in the report, ordered by first citation appearance
Full page text (fetched markdown or search excerpts). Only populated when includeFullText: true in ResearchOptions.
- Fast mode: Parallel API excerpts (~5000 chars)
- Other modes: Fetched page markdown
Relevance stringOptional
Reliability stringOptional
URLSource stringOptionalURL source tracking - where a URL came from
URL source tracking - where a URL came from
GapEvaluations []ResearchEventCompleteDataMetadataGapEvaluationOptional
Based on unanswered/partial questions, what specific information is still needed?
QuestionAssessments []ResearchEventCompleteDataMetadataGapEvaluationQuestionAssessmentAssessment of each research question’s status and findings
Assessment of each research question’s status and findings
Status stringStatus: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)
Status: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)
ResearchCoverage stringResearch coverage level - assesses quality across all questions.
Hierarchy: Light < Moderate < Solid < Comprehensive
- Light: Basic info on some questions, most need more depth → Continue
- Moderate: Multiple questions answered, some remain partial → Continue
- Solid: Most questions well-answered with validated sources → Sufficient to stop
- Comprehensive: All questions thoroughly answered, exceptional depth → Definitely stop
Research coverage level - assesses quality across all questions.
Hierarchy: Light < Moderate < Solid < Comprehensive
- Light: Basic info on some questions, most need more depth → Continue
- Moderate: Multiple questions answered, some remain partial → Continue
- Solid: Most questions well-answered with validated sources → Sufficient to stop
- Comprehensive: All questions thoroughly answered, exceptional depth → Definitely stop
Explicit decision: should research continue with another iteration?
- Considers: how many questions unanswered/partial, coverage for mode, remaining iterations
- Drives query generation: true → generate queries, false → stop researching
Metrics ResearchEventCompleteDataMetadataMetricsOptionalComplete research metrics
Complete research metrics
Phases map[string, ResearchEventCompleteDataMetadataMetricsPhase]Phase timings with duration in milliseconds
Phase timings with duration in milliseconds
type ResearchEventError struct{…}Envelope for the “error” event from /v1/research.
Envelope for the “error” event from /v1/research.
type ResearchEventEvaluatingEnd struct{…}Envelope for the “evaluating:end” event from /v1/research.
Envelope for the “evaluating:end” event from /v1/research.
Data ResearchEventEvaluatingEndData
Coverage string
QuestionAssessments []ResearchEventEvaluatingEndDataQuestionAssessment
Status stringStatus: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)
Status: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)
type ResearchEventEvaluatingStart struct{…}Envelope for the “evaluating:start” event from /v1/research.
Envelope for the “evaluating:start” event from /v1/research.
type ResearchEventFollowingEnd struct{…}Envelope for the “following:end” event from /v1/research.
Envelope for the “following:end” event from /v1/research.
Data ResearchEventFollowingEndData
Samples []ResearchEventFollowingEndDataSample
URLSource stringURL source tracking - where a URL came from
URL source tracking - where a URL came from
Relevance stringOptional
type ResearchEventFollowingStart struct{…}Envelope for the “following:start” event from /v1/research.
Envelope for the “following:start” event from /v1/research.
type ResearchEventIterationEnd struct{…}Envelope for the “iteration:end” event from /v1/research.
Envelope for the “iteration:end” event from /v1/research.
type ResearchEventIterationStart struct{…}Envelope for the “iteration:start” event from /v1/research.
Envelope for the “iteration:start” event from /v1/research.
type ResearchEventOutliningStart struct{…}Envelope for the “outlining:start” event from /v1/research.
Envelope for the “outlining:start” event from /v1/research.
type ResearchEventPlanningEnd struct{…}Envelope for the “planning:end” event from /v1/research.
Envelope for the “planning:end” event from /v1/research.
type ResearchEventPrefetchingEnd struct{…}Envelope for the “prefetching:end” event from /v1/research.
Envelope for the “prefetching:end” event from /v1/research.
type ResearchEventPrefetchingStart struct{…}Envelope for the “prefetching:start” event from /v1/research.
Envelope for the “prefetching:start” event from /v1/research.
type ResearchEventSearchingStart struct{…}Envelope for the “searching:start” event from /v1/research.
Envelope for the “searching:start” event from /v1/research.
Research
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/tabstack-go"
"github.com/stainless-sdks/tabstack-go/option"
)
func main() {
client := tabstack.NewClient(
option.WithAPIKey("My API Key"),
)
stream := client.Agent.ResearchStreaming(context.TODO(), tabstack.AgentResearchParams{
Query: "What are the latest developments in quantum computing?",
})
for stream.Next() {
fmt.Printf("%+v\n", stream.Current())
}
err := stream.Err()
if err != nil {
panic(err.Error())
}
}