agentsvc.io

services / answer-with-sources

weboperational · 2766 ms

Answer with Sources (AI)

Ask a question, get a short answer with numbered citations [1], [2] and the source list. Searches Wikipedia and our own news index (GDELT and Hacker News, last 7 days), reads the top 3 pages and answers only from them with Claude Haiku 5.5; when the sources do not answer the question it says so. source auto (current events go to news first), news or web (Wikipedia); optional answer language. Not a general web index: niche or very new topics may have no sources, then the call is not charged.

Run free trial ↗3 free calls per day with the example input. Paid: $0.008 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/answer-with-sources", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"question":"What is a Legal Entity Identifier used for?"}),
});
const { data, payment } = await res.json();  // payment.status "settling"; header X-Payment-Settle: sync returns payment.transaction

Input

FieldTypeDescription
question *stringThe question, max 400 chars
sourceauto | news | web = "auto"
languagestringAnswer language, e.g. German; default English

Output

FieldTypeDescription
questionstring
answerstring
sourcesarray
searchedarray
modelstring
answered_atstring
notestring

Example response (data)

{
  "question": "What is a Legal Entity Identifier used for?",
  "answer": "A Legal Entity Identifier (LEI) is a unique 20-character alphanumeric code that identifies legal entities, such as companies or government bodies, that take part in financial transactions. Its purpose is to help identify these entities on a globally accessible database, and individuals cannot obtain one [1]. LEIs are used in regulatory reporting to financial regulators, and all financial companies and funds are required to have one [1]. The database entries also show entity ownership, answering \"who is who\" and \"who owns whom\" [1].\n\nThe system was developed by the G20 in 2011 after the 2008 financial crisis revealed that regulators lacked a single worldwide identification code for financial institutions [1]. As of January 3, 2018, LEIs are mandatory for companies wishing to continue trading in securities [1].",
  "sources": [
    {
      "n": 1,
      "title": "Legal Entity Identifier - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Legal_Entity_Identifier"
    },
    {
      "n": 2,
      "title": "Authoritative Legal Entity Identifier - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Authoritative_Legal_Entity_Identifier"
    },
    {
      "n": 3,
      "title": "Entity - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Entity"
    }
  ],
  "searched": [
    "web",
    "news"
  ],
  "model": "claude-haiku-5-5",
  "answered_at": "2026-10-10T09:58:26.892Z",
  "note": "Sources come from Wikipedia and our news index (GDELT, Hacker News), not from a general web index."
}