Second Opinion for Python agents (LangChain · CrewAI · anything)
Give your agent a paid, independent skeptic: before acting on a claim, it buys an adversarial verification ($0.02–$0.75 in USDC via x402 — no account, no API key) and gets a structured verdict with calibrated confidence, citations, and a signed offline-verifiable receipt.
Setup (~5 minutes)
pip install secondopinion-x402
- Create a throwaway EVM wallet and fund it with a few dollars of USDC on Base (exchange withdrawal → network "Base"). No ETH needed — payments are gas-free for you; the facilitator covers it. Keep only pocket money in it.
export SECOND_OPINION_PRIVATE_KEY=0x…— the key signs payments locally and never leaves your machine.
Try it first — no wallet
from secondopinion import SecondOpinionClient
so = SecondOpinionClient() # no key needed for the free trial
v = so.try_free("The Model Context Protocol uses JSON-RPC 2.0")
Free trial is rate-limited per caller per day and returns unsigned verdicts.
Plain Python (paid)
so = SecondOpinionClient() # default tier: quick ($0.02)
v = so.verify("Library X v3 supports streaming natively",
context="About to build a day's work on this")
if v["verdict"] == "refuted":
... # stop and re-plan; v["findings"] says why, v["citations"] has sources
LangChain
from secondopinion import langchain_tool
tools = [langchain_tool()] # requires langchain-core
# or: langchain_tool(tier="verify") to default to web-researched verdicts
One call, minimum sufficient spend: tier="auto"
v = client.verify("Library X v3 supports streaming natively", tier="auto", max_usd=0.25)
print(client.last_auto) # the run's hop receipt — see below
Quick first; escalates to the researched tier only when quick is inconclusive or under the confidence bar (escalate_below=0.8). Prices are read live from the service's own free 402 quotes; panel is never auto-selected; the returned verdict stays receipt-pristine.
client.last_auto is the run's hop receipt (since 0.3.1): the
escalation rule and threshold in force, the max_usd cap, the refusal
reason when a cap blocked a wanted escalation, the superseded
quick_verdict, total_usd actually spent, and one hops[] entry per
paid call carrying the 402-quoted price (quoted_usd), the decoded
on-chain settlement (network + transaction id from the PAYMENT-RESPONSE
header) and the hop's verdict_id. Log it next to the verdict and every
cent your agent spent is attributable, on purpose.
CrewAI
from secondopinion import SecondOpinionCrewTool
tools = [SecondOpinionCrewTool()] # requires crewai
OpenAI Agents SDK
from secondopinion import openai_agents_tool
agent = Agent(..., tools=[openai_agents_tool()]) # requires openai-agents
What comes back
refuted | supported | inconclusive + confidence (scores the verdict, not
the claim) + findings + citations + a signed receipt — verify it offline
against https://secondopinionx402.com/.well-known/second-opinion-pubkey.json
for a tamper-evident audit trail. Measured accuracy, failures included:
https://secondopinionx402.com/benchmark
Tiers: quick $0.02 reasoning-only (~20s) · verify $0.20 live web research
(~60s) · panel $0.75 three skeptics, majority vote. You are never charged
for failed requests; failed async jobs retry free.
Status: core client and LangChain adapter are payment-tested against production; the CrewAI adapter is a thin wrapper of the same client (import-guarded) — report anything odd and it'll be fixed fast.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file secondopinion_x402-0.3.1.tar.gz.
File metadata
- Download URL: secondopinion_x402-0.3.1.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ba3a5d6301b4cbc6cf4fe1aeeefd00ba92590a711b9518ebf1cf51431006115
|
|
| MD5 |
6105322bb2cd8a10fb304dff92080c17
|
|
| BLAKE2b-256 |
acbcc457ae8a6b87c37025de98c4f1d915860af53c0c063674a23c81a7bb726d
|
File details
Details for the file secondopinion_x402-0.3.1-py3-none-any.whl.
File metadata
- Download URL: secondopinion_x402-0.3.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a70751281e95938b5f7c239e14b5b8c1955ec229985ebd375afe64bcf0326fa
|
|
| MD5 |
0fc7a21c88cd74052f2daef499625b3e
|
|
| BLAKE2b-256 |
c5ff6cbe8974d34b0c28f46bd4f0da3f8a7b75888df87e47b8311942137f2d3b
|