Examples

Copy-paste VeracityAPI into your agent stack.

Use these wrappers as drop-in gates before agents publish, cite, train on, or moderate content. Each wrapper preserves risk_level, recommended_action, evidence, and limitations.

Get API key Open use case library Docs

LangChain @tool + Python SDK

from langchain_core.tools import tool
from veracityapi import VeracityAPI

client = VeracityAPI()

@tool
def veracity_content_gate(text: str, intended_use: str = "publish") -> dict:
    """Score content trust risk before an agent acts."""
    return client.analyze_text(
        text,
        context={"format": "article", "intended_use": intended_use},
    )

Vercel AI SDK tool

import { tool } from "ai";
import { z } from "zod";
import { VeracityAPI } from "@veracityapi/sdk";

const veracity = new VeracityAPI({ apiKey: process.env.VERACITY_API_KEY });

export const veracityContentGate = tool({
  description: "Route content by trust risk before publish/cite/train/moderate.",
  parameters: z.object({ text: z.string(), intendedUse: z.string().default("publish") }),
  execute: async ({ text, intendedUse }) => veracity.analyzeText({
    text,
    context: { format: "article", intended_use: intendedUse }
  })
});

LlamaIndex FunctionTool

from llama_index.core.tools import FunctionTool
from veracityapi import VeracityAPI

client = VeracityAPI()

def veracity_content_gate(text: str, intended_use: str = "publish"):
    return client.analyze_text(text, context={"format": "article", "intended_use": intended_use})

veracity_tool = FunctionTool.from_defaults(fn=veracity_content_gate)

LangGraph routing node

import { VeracityAPI } from "@veracityapi/sdk";

const veracity = new VeracityAPI({ apiKey: process.env.VERACITY_API_KEY });

async function veracityGate(state) {
  return { ...state, veracity: await veracity.analyzeText({
    text: state.draft,
    auto_revise: true,
    context: { format: "article", intended_use: "publish" }
  }) };
}
function routeByVeracity(state) {
  return state.veracity.recommended_action; // allow | revise | human_review | reject
}

MCP local client config

Use this for Claude Desktop, Cursor, and local MCP clients. Hosted remote MCP is live at https://api.veracityapi.com/mcp for compatible custom connectors.

{
  "mcpServers": {
    "veracityapi": {
      "command": "npx",
      "args": ["-y", "@veracityapi/mcp"],
      "env": { "VERACITY_API_KEY": "YOUR_API_KEY" }
    }
  }
}

Publishing pipeline quality gate

A pre-publish quality gate for agent-written articles, listicles, comparison pages, and programmatic SEO output. Stop generic drafts at the CMS boundary, send weak ones back to the rewrite agent with evidence attached, and only publish what would survive a human editor's first read.

Social caption pre-flight check

Score Reels, TikTok captions, carousel covers, Pinterest descriptions, and YouTube Shorts copy before scheduling. Catch the captions that sound like every other brand account — and the ones that quietly bury whatever was interesting about the post.

SEO helpful-content proxy

Use VeracityAPI as a cheap proxy for the helpful-content question before Search Console can tell you the answer eight weeks later. Catch the pages that read generic now, while it's still cheap to fix them.

Reddit source validation

When your research agent mines Reddit for victim stories, product complaints, niche tips, or breaking-news leads, score posts for specificity and provenance before they enter the source pool. Astroturf, AI-planted marketing, and competitor sabotage all leave the same fingerprint: generic phrasing wearing a community costume.

Competitor content intelligence

Score competitor pages at scale to find the URLs where they're winning on keywords but losing on substance. Those are the pages where adding concrete specificity beats them — not on backlinks, not on age, on the one thing a fresh page can change.

KDP manuscript QA

Before you upload a manuscript to Kindle Direct Publishing, score each chapter for generic filler, weak sourcing, and the kind of advice-shaped paragraphs that read fine in isolation but read hollow across 200 pages. Reviews are forever; the gate runs once.