structured_results = exa.search( "Who is the CEO of OpenAI?", type="deep", system_prompt="Prefer official sources and avoid duplicate results", output_schema={ "type": "object", "properties": { "leader": {"type": "string"}, "title": {"type": "string"}, "source_count": {"type": "number"} }, "required": ["leader", "title"] }, contents={"highlights": {"max_characters": 4000}})print(structured_results.output.content if structured_results.output else None)
output_schema and system_prompt work across all search types. Keep output_schema focused on
the fields you want in output.content, and use system_prompt to guide the final returned
result. For more demanding synthesis, prefer reasoning-focused search types like deep-lite,
deep, deep-reasoning, or deep-max. Do not add citations/confidence fields there;
grounding is returned automatically in output.grounding. Adding citation/confidence fields to
output_schema creates duplicate data, weaker structure, and less reliable attribution.
Reasoning-focused search variants:
deep-lite: lowest-latency deep-search mode
deep: light mode
deep-reasoning: base reasoning mode
deep-max: maximum-effort deep-search mode
Need streaming structured synthesis? The raw /search endpoint supports stream: true together
with outputSchema and returns OpenAI-compatible SSE chunks. See the Search API
guide.