Integrate 2O

Connect your AI agent to human verification in under 5 minutes. Pick the method that fits your stack.

Quick Start

1. Register your agent at /register to get an API key.

2. Set your key as an environment variable:

export TWO_O_API_KEY=2o_sk_your_key_here

3. Make your first verification call:

cURL

verify.shbash
curl -X POST https://www.2oapi.xyz/api/v1/verify \
  -H "Authorization: Bearer $TWO_O_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "claim": "The Great Wall of China is visible from space",
    "domain": "scientific",
    "budget_cents": 100
  }'

Python

verify.pypython
import requests, os

resp = requests.post(
    "https://www.2oapi.xyz/api/v1/verify",
    headers={"Authorization": f"Bearer {os.environ['TWO_O_API_KEY']}"},
    json={
        "claim": "The Great Wall of China is visible from space",
        "domain": "scientific",
        "budget_cents": 100,
    },
)
data = resp.json()
print(f"Request ID: {data['id']}")

TypeScript

verify.tstypescript
const resp = await fetch("https://www.2oapi.xyz/api/v1/verify", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TWO_O_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    claim: "The Great Wall of China is visible from space",
    domain: "scientific",
    budget_cents: 100,
  }),
});
const data = await resp.json();
console.log("Request ID:", data.id);

4. Poll for the result:

result.shbash
curl https://www.2oapi.xyz/api/v1/verify/{request_id}/result \
  -H "Authorization: Bearer $TWO_O_API_KEY"

OpenClaw Skill

If you're running an OpenClaw agent, install the 2O verification skill for automatic access to human experts:

Tell your agent:

“Install the 2O verification skill from https://www.2oapi.xyz/integrate”

Or install manually:

install.shbash
# Download the 2O skill
mkdir -p ~/.openclaw/skills/2o-verification
curl -fsSL https://www.2oapi.xyz/openclaw-skill/SKILL.md \
  -o ~/.openclaw/skills/2o-verification/SKILL.md
curl -fsSL https://www.2oapi.xyz/openclaw-skill/_meta.json \
  -o ~/.openclaw/skills/2o-verification/_meta.json

Once installed, your agent can say things like:

  • • “Verify this claim: GDPR requires deletion within 30 days”
  • • “I need a consensus check on this medical claim before sharing”
  • • “Check my 2O verification balance”

The skill files are also available at: /openclaw-skill/SKILL.md · _meta.json · example_calls.md

MCP Server

2O provides a Model Context Protocol server for deep integration with Claude Code, Claude Desktop, and other MCP clients.

Claude Code / Claude Desktop

mcp_config.jsonjson
{
  "mcpServers": {
    "2o": {
      "command": "npx",
      "args": ["-y", "2o-mcp-server"],
      "env": {
        "TWO_O_API_KEY": "2o_sk_your_key_here"
      }
    }
  }
}

The MCP server exposes these tools to the agent:

  • verify_claim — Submit a claim for human verification
  • check_status — Poll a verification request status
  • get_result — Retrieve the final verdict
  • list_domains — List available verification domains

npm package: 2o-mcp-server

LangChain / LlamaIndex

Wrap the 2O API as a tool in popular agent frameworks:

LangChain (Python)

langchain_tool.pypython
from langchain.tools import tool
import requests, os

@tool
def verify_claim(claim: str, domain: str = "general") -> str:
    """Verify a factual claim with human domain experts via 2O."""
    resp = requests.post(
        "https://www.2oapi.xyz/api/v1/verify",
        headers={"Authorization": f"Bearer {os.environ['TWO_O_API_KEY']}"},
        json={"claim": claim, "domain": domain, "budget_cents": 100},
    )
    data = resp.json()
    request_id = data["id"]

    # Poll for result (in production, use async polling)
    import time
    for _ in range(60):
        time.sleep(30)
        result = requests.get(
            f"https://www.2oapi.xyz/api/v1/verify/{request_id}/result",
            headers={"Authorization": f"Bearer {os.environ['TWO_O_API_KEY']}"},
        ).json()
        if result.get("status") == "completed":
            return (
                f"Verdict: {result['verdict']} "
                f"(confidence: {result['confidence']})\n"
                f"Explanation: {result['explanation']}"
            )
    return "Verification timed out"

LlamaIndex (Python)

llamaindex_tool.pypython
from llama_index.core.tools import FunctionTool
import requests, os

def verify_with_2o(claim: str, domain: str = "general") -> str:
    """Submit a claim to 2O for human expert verification."""
    resp = requests.post(
        "https://www.2oapi.xyz/api/v1/verify",
        headers={"Authorization": f"Bearer {os.environ['TWO_O_API_KEY']}"},
        json={"claim": claim, "domain": domain, "budget_cents": 100},
    )
    return f"Verification submitted. Request ID: {resp.json()['id']}"

verify_tool = FunctionTool.from_defaults(fn=verify_with_2o)

Direct API

For full control, use the REST API directly. The complete reference is in the API Documentation.

POST/api/v1/verifySubmit a claim
GET/api/v1/verify/:idCheck status
GET/api/v1/verify/:id/resultGet verdict
POST/api/v1/verify/:id/feedbackSubmit feedback
GET/api/v1/agent/balanceCheck balance
GET/api/v1/domainsList domains

All endpoints require an Authorization: Bearer header with your agent API key (except /api/v1/domains which is public).

Ready to add human verification?

New agents get $5.00 in free credits.