Second opinion from several AI models
POST /api/second-opinionGet a second opinion: ask several companies' AI models one question and get one combined answer that says where they disagreed.
Details
Asks OpenAI's GPT-6 Luna, Anthropic's Claude Haiku 5.5, Google's Gemini 3.5 Flash Lite and DeepSeek's DeepSeek V4.1 Flash; one that does not answer, or is not served in your location, is left out and named. Fewer than two replies is an error. Send the whole question with its context, up to 4000 chars: the models see nothing else and search nothing. Model-backed: the answer is AI-generated and can be wrong. Some calls are paid before they run; a failed one can be retried free with the same payment, or is refunded.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
question | string | yes | The whole question with any context it needs, and the answer you already have if you want it checked Up to 4000 characters. |
Example request
curl -i -X POST https://agent402.tools/api/second-opinion \
-H "Content-Type: application/json" \
-d '{"question":"We sell coffee beans by subscription. Should a new customer get a free first bag, or 20% off the first three months?"}'Watch a call get paid
POST /api/second-opinion$0.02 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example response
{
"answer": "A free first bag, because people taste the product before they decide...\n\nThe models disagree on when the discount wins: Claude Haiku 5.5 would use it for customers who already drink the brand; the others would give the bag to everyone.\n\n(GPT-6 Luna, Claude Haiku 5.5, Gemini 3.5 Flash Lite, DeepSeek V4.1 Flash)",
"models": [
{
"name": "GPT-6 Luna",
"company": "OpenAI",
"model": "openai/gpt-6-luna"
},
{
"name": "Claude Haiku 5.5",
"company": "Anthropic",
"model": "anthropic/claude-haiku-5.5"
},
{
"name": "Gemini 3.5 Flash Lite",
"company": "Google",
"model": "google/gemini-3.5-flash-lite"
},
{
"name": "DeepSeek V4.1 Flash",
"company": "DeepSeek",
"model": "deepseek/deepseek-v4.1-flash"
}
],
"leftOut": [],
"aiGenerated": true
}| Field | Type | Always present | In the example |
|---|---|---|---|
answer | string | yes | A free first bag, because people taste the product before they decide... The... |
models | array of objects | yes | 4 items in the example |
leftOut | array | yes | 0 items in the example |
aiGenerated | boolean | yes | true |
From an MCP client
catalog.call {
"slug": "second-opinion",
"params": {
"question": "We sell coffee beans by subscription. Should a new customer get a free first bag, or 20% off the first three months?"
}
}Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.20.1): pays from a wallet or AGENT402_CREDITS_KEY.
Errors and behavior
- Pay $0.02 per call over x402 or MPP. Wallet-only, model-backed: no proof-of-work tier; the same input can give a different result. A prepaid card-credits key (
Authorization: Bearer a402_...) also pays it. - Required:
question; a rejected input answers 4xx witherror,tool,expected,requiredandexample. - On this route, a call ending in any status of 400 or above is not charged over x402, MPP or a credits key. Some calls are paid before they run; a failed one can be retried free with the same payment, or is refunded. A Tempo push credential pays before the call; a failure is a refund owed.
- A bodyless
GETorHEADreturns the same 402 quote. - An
Idempotency-Keyreplays the first 200 uncharged (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.02" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/second-opinion", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"question": "We sell coffee beans by subscription. Should a new customer get a free first bag, or 20% off the first three months?"
}),
});Get a wallet or run npx -y agent402-mcp@0.20.1 wallet new.
The quote (Python)
import base64, json, urllib.error, urllib.request
req = urllib.request.Request("https://agent402.tools/api/second-opinion", method="POST", data="{\"question\":\"We sell coffee beans by subscription. Should a new customer get a free first bag, or 20% off the first three months?\"}".encode(), headers={"Content-Type": "application/json"})
try:
urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]]) # the price, per chain, in base units