Gemini
Query Google Gemini via Wire — structured answers with grounding sources
POST
https://api.anakin.io/v1/wire/taskRun a prompt against Gemini and get its answer with grounding sources and citations, plus multi-turn support via conversation_id. Run it with the gemini_prompt action on POST /v1/wire/task.
Catalog: gemini · action_id: gemini_prompt · Credits: 2 / call · Auth: none
Request Body
{
"action_id": "gemini_prompt",
"params": { "prompt": "best CRM for small teams", "country": "us" }
}| Parameter | Type | Description |
|---|---|---|
action_id required | string | Set to gemini_prompt |
params.prompt required | string | Your question or instruction for Gemini (up to 8192 chars) |
params.country | string | Region to send the request from (2-letter code). Default us |
params.additional_prompt | string | Optional follow-up, asked in the same conversation |
params.force_search | boolean | Force Gemini to search the web and cite sources for this prompt (boosts citation coverage). Default false |
params.include_html | boolean | Also return the answer as HTML under answer_html. Default false |
Code Examples
curl -X POST http://staging-alb-1217701800.ap-south-1.elb.amazonaws.com/v1/wire/task \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"action_id": "gemini_prompt",
"params": { "prompt": "best CRM for small teams", "country": "us" }
}'import requests
res = requests.post(
'https://api.anakin.io/v1/wire/task',
headers={'X-API-Key': 'your_api_key'},
json={'action_id': 'gemini_prompt', 'params': {'prompt': 'best CRM for small teams', 'country': 'us'}},
)
job_id = res.json()['job_id']const res = await fetch('http://staging-alb-1217701800.ap-south-1.elb.amazonaws.com/v1/wire/task', {
method: 'POST',
headers: { 'X-API-Key': 'your_api_key', 'Content-Type': 'application/json' },
body: JSON.stringify({
action_id: 'gemini_prompt',
params: { prompt: 'best CRM for small teams', country: 'us' },
}),
});
const { job_id } = await res.json();Response
202 Accepted{ "status": "processing", "job_id": "…", "poll_url": "/v1/wire/jobs/…" }Poll GET /v1/wire/jobs/{id} until status: "completed":
{
"status": "completed",
"credits_used": 2,
"execution_ms": 19948,
"data": {
"status": "ok",
"data": {
"answer_text": "…", "answer_text_markdown": "…",
"citations": [
{ "url": "https://…", "title": "…", "domain": "…", "position": 1,
"ref_type": "web", "description": "…", "result_source": "search", "cited": true }
],
"citation_anchors": [
{ "cited_text": "…", "start_idx": 0, "end_idx": 42,
"raw_start_idx": 0, "raw_end_idx": 42,
"url": "https://example.com/page#:~:text=…",
"page_url": "https://example.com/page", "domain": "example.com", "title": "…" }
],
"sources": [{ "url": "https://…", "anchors": [] }], "search_sources": [],
"conversation_id": "…", "response_id": "…",
"related_media": [], "detected_location": "…", "language": "en",
"tools_used": ["search"], "model": "gemini-…"
},
"meta": { "action_id": "gemini_prompt", "catalog_slug": "gemini", "envelope_version": "v1" }
}
}| Field | Type | Description |
|---|---|---|
data.data.answer_text | string | The answer. answer_text_markdown is the same answer with a numbered link [[n]](url) after each cited span; answer_html is returned when include_html |
data.data.additional_answer_text | string | The answer to additional_prompt, when you send one |
data.data.answer_text_raw | string | The raw, unprocessed answer — keeps Gemini's inline citation-chip labels and placeholder tokens that answer_text strips out |
data.data.citations | array | Grounding sources — { url, title, domain, position, ref_type, description, result_source, cited } |
data.data.recommendations | array | Related products or items the engine recommends alongside the answer |
data.data.shopping | array | Shopping module for commercial-intent queries — products with titles, prices and links |
data.data.related_media | array | Images or videos attached to the answer |
data.data.citation_anchors | array | Where each source is cited in the answer body. One entry per cited span: cited_text, the character range in answer_text (start_idx/end_idx) and in answer_text_raw (raw_start_idx/raw_end_idx), and the source url (with a #:~:text= passage fragment where Gemini provides one). Each sources[] entry also carries its own matching anchors. |
data.data.links_attached | array | The cited sources as a flat list in reading order: { url, text, position } |
data.data.references | array | The cited sources in { url, title, attribution, domain } shape |
data.data.sources | array | Source pages behind the answer (Gemini's own source list; distinct from citations) |
data.data.search_sources | array | Sources Gemini considered during its web search (not necessarily cited) |
data.data.web_search_triggered | boolean | Whether Gemini actually ran a web search for this answer |
data.data.web_search_query | string | The search query Gemini ran |
data.data.conversation_id | string | Reuse to continue the thread (multi-turn) |
data.data.detected_location | string | How Gemini localized the answer for country |
data.data.tools_used | string[] | Tools Gemini invoked (e.g. search) |
data.data.ads | object | Reserved for sponsored results — Gemini serves none today, so this is always { name: null, url: null, favicon_url: null, carousel_cards: null } |
data.data.response_raw | string | Gemini's raw response stream, verbatim. Not a stable contract — its format can change without notice; use the structured fields instead |
citation_anchors,sources[].anchors, and the inline markdown links are empty on runs where Gemini doesn't search or cite (not every prompt grounds).response_raw, when present, is Google's raw stream — its format can change without notice, so usecitation_anchorsfor placement rather than parsing it. Billed only on success.