The demo makes one Exa /search request with type: "auto". Auto searches, uses requested image metadata from the results, and fills a small schema of image tiles.
Exa Auto Call
The x-exa-image-references: true schema field tells Exa Auto to return image references as structured image cards.
const res = await fetch("https://api.exa.ai/search", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.EXA_API_KEY,
},
body: JSON.stringify({
query,
type: "auto",
numResults: 15,
outputSchema: {
type: "object",
properties: {
images: {
type: "array",
"x-exa-image-references": true,
description: "Return 20 images.",
},
},
required: ["images"],
},
}),
});
const data = await res.json();
const images = data.output.content.images;