Base: https://api.aindex-ai.com/v1 · Autenticação: cabeçalho X-Api-Key · Limite: 120 req/min por chave.
1 Crie uma chave de API no painel (Configurações → Nova chave), escolhendo os escopos search, ingest e/ou read.
2 Consulte o índice (escopo search):
curl -X POST https://api.aindex-ai.com/v1/search \
-H "Content-Type: application/json" \
-H "X-Api-Key: ain_live_xxx" \
-d '{"query":"melhor notebook até R$ 6.000","topK":8}'
const res = await fetch("https://api.aindex-ai.com/v1/search", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": process.env.AIN_API_KEY,
},
body: JSON.stringify({ query: "melhor notebook até R$ 6.000", topK: 8 }),
});
const data = await res.json(); // { answer, sources[], request_id }
<?php
$ch = curl_init("https://api.aindex-ai.com/v1/search");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: " . getenv("AIN_API_KEY"),
],
CURLOPT_POSTFIELDS => json_encode(["query" => "melhor notebook até R$ 6.000", "topK" => 8]),
]);
$data = json_decode(curl_exec($ch), true);
3 Envie/atualize conteúdo (escopo ingest):
curl -X POST https://api.aindex-ai.com/v1/ingest \
-H "Content-Type: application/json" \
-H "X-Api-Key: ain_live_xxx" \
-d '{"propertyId":"clx123...","url":"https://loja.com/produto-x","title":"Produto X","type":"product","content":"Descrição completa..."}'