Send a prompt to Google's AI Mode and get a structured conversational reply with citation links. Continue the conversation across multiple calls using a session token.
curl "https://apidirect.io/v1/web/ai-mode?prompt=How%20do%20I%20make%20pizza%3F" \
-H "X-API-Key: YOUR_API_KEY"
{
"reply_parts": [
{
"type": "paragraph",
"text": "Making pizza at home involves preparing the dough, sauce, and toppings, then baking at high heat."
},
{
"type": "heading",
"text": "1. Prepare the Dough"
},
{
"type": "list",
"ordered": false,
"list": [
{
"title": "Activate Yeast:",
"text": "Mix warm water with yeast and a pinch of sugar. Let it sit for 5-10 minutes until foamy."
},
{
"title": "Mix and Knead:",
"text": "Combine the yeast mixture with flour and salt. Knead for 5-10 minutes until smooth and elastic."
}
]
}
],
"reference_links": [
{
"title": "Best Homemade Pizza Dough (photo tutorial)",
"link": "https://www.crunchycreamysweet.com/the-best-homemade-pizza-dough-photo-tutorial/",
"snippet": "Instructions. Place water and sugar in a large mixing bowl...",
"source": "Crunchy Creamy Sweet",
"favicon": "https://encrypted-tbn1.gstatic.com/faviconV2?url=https://www.crunchycreamysweet.com&size=128",
"date": "Jul 6, 2012"
}
],
"session_token": "Q21vd1lUZHFaMjlNYWtOTWREQndWRmRyV1RNemFqRnViak01Ym1FeE1tdFZVemhFVGxCeFQxZE9RV1o0..."
}
AI Mode returns a conversational, structured answer generated by Google's AI model, along with citation links. Regular web search returns a list of ranked URLs.
Walk reply_parts in order and render each block based on its type (paragraph, heading, list, images). The same structure is used by the AI Overview inside /v1/web/search.
Every response includes a session_token. Pass that token back in your next call (along with the new prompt) to continue the same conversation with prior context preserved.
The token is opaque - treat it as a string you pass through unchanged. Each follow-up call is billed as a new $0.005 request.
AI Mode is designed for informational and how-to prompts. Questions like 'How do I...?', 'What's the difference between...?', or 'Explain X' work well. The prompt length is capped at 2000 characters.
You only pay for successful requests. The Google AI Mode API costs $0.005 per request. There are no monthly fees or commitments. You get 50 free requests per endpoint every month.
No. You can sign up and use the free tier (50 requests/endpoint/month) without adding a payment method. You only need to add a card when you want to exceed the free tier.
Yes, there's a concurrency limit of 3 simultaneous requests per endpoint per user. If you need more, just get in touch.
Get your API key and start making requests in minutes. 50 requests/month free every month.
Get API Key