360 Secure SkillHub
360 安全技能中心

Google AI Mode API - AI Answers with Cited Sources

该 Skill 通过 Scavio API 向 Google AI Mode 发送查询,返回 AI 生成的分段答案、引用来源及可选购物结果;每次请求消耗 1 个额度,需配置 SCAVIO_API_KEY。

分类:搜索
scavio-ai
scavio-ai
热度 15.57
最近更新 2026-11-29 16:19:38

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add scavio-ai/google-ai-mode-api
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
google-ai-mode-api
description
Get Google's AI Mode answer for a query as structured JSON — AI-generated text blocks and the cited references behind them. v2 engine, 1 credit per request.
version
1.0.0
tags
google-ai-mode, ai-overview, generative-search, answer-engine, citations, agents, langchain, crewai, autogen, structured-data, json, ai-agents, research
metadata
{"openclaw":{"requires":{"env":["SCAVIO_API_KEY"]},"primaryEnv":"SCAVIO_API_KEY","timeout":90,"throttle":1,"emoji":"✨","homepage":"https://scavio.dev/docs/google-ai-mode?utm_source=agent-skills&utm_medium=skill&utm_campaign=google-ai-mode-api"}}

Google AI Mode via Scavio (v2)

Fetch Google's AI Mode answer as structured JSON: an AI-generated response broken into text blocks and the cited source references behind it. One credit per request.

When to trigger

Use this skill when the user asks to:

  • Get Google's AI-generated answer to a question, with its sources
  • See what Google's AI Mode says about a topic or product
  • Pull cited references behind an AI answer for grounding or verification
  • Answer a commercial query and surface AI-suggested products

Setup

Get a free API key at scavio.dev (50 free credits to get started, no card required):

export SCAVIO_API_KEY=sk_live_your_key

If you do not have a key yet

An agent running this skill without SCAVIO_API_KEY set will get 401 on every call below. The whole path from nothing to a working key is self-serve:

  1. Sign up at dashboard.scavio.dev - email or Google, no card required.
  2. A key is created for the account automatically at signup. It is on the dashboard under API Keys, ready to copy.
  3. A new account starts with 50 credits. Endpoints in this skill cost 1 credit each unless the table below says otherwise.

When the balance runs out the API answers 402 with a JSON body carrying billing_url. Topping up needs no code change - the same key keeps working. The smallest purchase is 2,500 credits for $25, and monthly plans work out cheaper per credit if the usage is steady rather than one-off.

Endpoint

POST https://api.scavio.dev/api/v2/google/ai-mode
Authorization: Bearer $SCAVIO_API_KEY

Every request costs 1 credit.

Workflow

  1. Send the user's question as query.
  2. Localize with gl/hl/location when the answer is region-specific.
  3. Read text_blocks[] for the AI answer and references[] for the cited sources. The response also carries a shopping_results array; treat it as optional, since it is frequently empty, even on product queries.

Parameters

Parameter Type Default Description
query string required Search query (1-500 chars)
device string desktop desktop or mobile
hl string -- UI language, ISO 639-1
gl string -- Geo country, ISO 3166-1 alpha-2
google_domain string google.com Regional Google domain
location string -- Canonical location name (auto-UULE)
uule string -- Pre-encoded UULE (takes priority over location)
safe string -- active filters adult content
include_html boolean false Include raw HTML in the html field

Example

import requests

# Your key from https://scavio.dev. Load it from your environment or secret
# store in real code - keep it out of source control.
API_KEY = "sk_your_key_here"

response = requests.post(
    "https://api.scavio.dev/api/v2/google/ai-mode",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"query": "best running shoes for flat feet 2026", "gl": "us", "hl": "en"},
)
data = response.json()
for b in data.get("text_blocks", []):
    print(b.get("snippet") or b.get("text"))
for ref in data.get("references", []):
    print("source:", ref.get("title"), ref.get("link"))

Response

{
  "text_blocks": [
    { "type": "paragraph", "snippet": "AI-generated answer text..." }
  ],
  "references": [
    { "title": "Source article", "link": "https://example.com", "source": "Example" }
  ],
  "shopping_results": [],
  "response_time": 2140,
  "credits_used": 1,
  "credits_remaining": 995,
  "cached": false
}

Guardrails

  • Each call costs 1 credit.
  • Never fabricate the AI answer, references, or products. Only return API data.
  • Do not promise product cards: if shopping_results is empty, answer from text_blocks and references.
  • Present the answer from text_blocks and always surface its references so the user can verify sources.
  • AI Mode does not support pagination or result filtering — it is a single answer per query.

Failure handling

  • 400 means an invalid parameter — fix and retry.
  • 401 means the API key is invalid or missing. Check SCAVIO_API_KEY.
  • 429 means rate or usage limit exceeded. Wait before retrying. See rate limits.
  • 502 / 503 mean upstream is temporarily unavailable. Wait a few seconds before retrying.
  • If no AI answer is returned, the query may not trigger AI Mode — fall back to the scavio-google search skill.
  • If SCAVIO_API_KEY is not set, prompt the user to export it before continuing.