Skip to article

SearchResponse

Inspect the winner, source material, execution trace, warnings, and reported usage.

On this page

Response fields

TypeScript · shape
interface SearchResponse {
  provider: string;
  results: readonly SearchResult[];
  attempts: readonly SearchAttempt[];
  warnings: readonly {
    code: 'fallback_used' | 'provider_warning';
    provider: string;
  }[];
  usage: { unit: 'usd' | 'credits'; value: number } | null;
  reuse?: 'cache' | 'inflight';
}

Result fields

FieldMeaning
urlValidated HTTP(S) source link.
title?, snippet?Optional provider text; render as untrusted text.
highlights?Separate passages, preserved as an array.
score?Native score; no cross-provider normalization.
provenanceProvider ID, sourceUrl, retrievedAt, optional requestId.

Validation and omissions

Built-in adapters validate consumed fields, including results beyond the output ceiling, before returning. A malformed consumed field rejects with invalid_response instead of being silently discarded. Unknown provider fields are ignored. The orchestrator also checks the normalized shape returned by custom providers, including safe URLs, provenance fields, usage, and warnings, and copies only public fields. Structural validation does not prove source truth or attribution.