Developer docs

Quickstart — 5 minutes to your first analyzed result

Call VeracityAPI before an agent publishes, cites, trains on, or moderates text or image content. Results include evidence, limitations, and a workflow-ready recommended_action.

Get API key Error handling Trust model OpenAPI JSON

Search this page
Step 1

Create a key

Sign in at /account, copy an API key, and set it as VERACITY_API_KEY. New accounts include starter credit for production-like smoke tests.

Step 2

Send one unified request

curl https://api.veracityapi.com/v1/analyze \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"text","content":"Paste article, review, caption, or source text here...","auto_revise":true,"context":{"format":"article","intended_use":"publish"},"store_content":false}'

Use the same endpoint for type:"text" or type:"image". Text can set auto_revise:true to receive revised_text when the action is revise.

Step 3

Route on recommended_action

  • allow → publish or proceed
  • revise → fix the flagged signals
  • human_review → route to a human
  • reject → block or discard

recommended_action is the primary integration field. Scores explain the route; your workflow should branch on the action.

Step 4

Inspect evidence and fixes

Evidence spans and recommended_fixes tell a writer, generator, moderator, or source-checking agent what to change next. Keep store_content:false when you do not want raw submitted text retained.

Complete response example

This mirrors the public OpenAPI response fields developers should expect from text analysis. Media responses keep the same routing spine and add modality-specific risk fields.

{
  "analysis_id": "ana_01HX...",
  "modality": "text",
  "content_trust_score": 0.42,
  "synthetic_risk": 0.61,
  "slop_risk": 0.74,
  "specificity_risk": 0.68,
  "provenance_weakness": 0.55,
  "risk_level": "high",
  "recommended_action": "human_review",
  "primary_reason": "unsupported_generic_claims",
  "confidence": "medium",
  "evidence": [{"type":"generic_phrasing","severity":"high","span":"always stay alert","explanation":"Vague advice without sourceable detail."}],
  "recommended_fixes": ["Replace generic warnings with named places, mechanisms, and sourceable evidence."],
  "limitations": ["Workflow signals, not forensic proof."],
  "revised_text": "Only present when auto_revise:true and recommended_action is revise.",
  "billing": {"units_analyzed":1,"bucket":"text_1k_units","price_cents":0.5,"remaining_balance_cents":149.5}
}
FieldMeaning
analysis_idStable analysis identifier for logs and support.
modalitytext or image.
recommended_actionMain workflow route: allow, revise, human_review, or reject.
risk_levelLow, medium, or high summary of the strongest workflow-risk signal.
primary_reasonSingle top reason for the route.
confidenceModel confidence in the routing decision.
evidenceTyped spans, cues, or observations behind the decision.
recommended_fixesActionable changes for revise/human_review workflows.
limitationsBoundary language, including non-forensic scope.
billingUnits, bucket, price, and remaining balance for authenticated calls.

Error handling

Production integrations should handle validation, credit, rate-limit, and provider failures explicitly. See the full page at /docs/errors.

StatusMeaningRetry?
400validation errors such as missing content, unsupported context, or malformed JSON.No; fix request.
401Missing or invalid bearer API key.No; refresh key.
402insufficient credits.No; add credit or reduce run size.
413content too large.No; chunk input.
415unsupported media type.No; submit supported HTTPS media.
429rate limited; respect Retry-After.Yes, after delay.
5xxtransient Worker or provider failure.Yes; exponential backoff, max 3 attempts.

Current thresholds and action policy

Text v0.1 uses max(synthetic_risk, slop_risk): below 0.40 = low, below 0.70 = medium, 0.70+ = high. Image v0.1 uses synthetic_image_risk: below 0.40 = low, below 0.70 = medium, 0.70+ = high.

intended_uselowmediumhigh
publishallowrevisehuman_review
trainallowhuman_reviewreject
citeallowhuman_reviewreject
moderateallowallowrevise
otherallowrevisehuman_review

Signal definitions

slop_risk
Likelihood that text is generic, low-information, padded, or unfit to ship without revision.
synthetic_risk
Modality-level synthetic-media or AI-texture workflow risk signal; not authorship proof.
specificity_risk
How much the content lacks concrete names, mechanisms, numbers, examples, or local detail.
provenance_weakness
Weakness in source context, attribution, corroboration, or traceability.
risk_level
Low/medium/high rollup used for triage dashboards.
confidence
How strongly the system trusts the route given input quality and evidence density.
primary_reason
Top reason to show in a queue or webhook.
threshold
Your workflow's action cutoff. Tune by intended_use and business risk.
intended_use
Policy context such as publish, cite, train, moderate, or other.

Routing snippet

switch (result.recommended_action) {
  case "allow": publish(); break;
  case "revise": rewriteWith(result.evidence, result.recommended_fixes); break;
  case "human_review": queueForReview(result); break;
  case "reject": quarantine(result); break;
}

Batch + balance

POST https://api.veracityapi.com/v1/analyze-batch
GET https://api.veracityapi.com/v1/balance

Batch supports 1-25 text items. Balance returns account credit and recent usage so agents can check spend before large jobs.

TypeScript SDK

npm install @veracityapi/sdk

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

const client = new VeracityAPI({ apiKey: process.env.VERACITY_API_KEY });
const result = await client.analyzeText({
  type: "text",
  content: draft,
  auto_revise: true,
  context: { format: "article", intended_use: "publish" }
});

Python SDK

pip install veracityapi

from veracityapi import VeracityAPI

client = VeracityAPI()
result = client.analyze_text(
    text,
    auto_revise=True,
    context={"format": "article", "intended_use": "publish"},
)

Image curl

curl https://api.veracityapi.com/v1/analyze -H "Authorization: Bearer API_KEY" -H "Content-Type: application/json" -d '{"type":"image","content":"https://example.com/image.jpg","context":{"format":"social_post","intended_use":"moderate"},"store_content":false}'

Send HTTPS image URLs only. Returns synthetic_image_risk, evidence spans for geometry/text/lighting, and a workflow-ready recommended_action. Cost: $0.02 per image.

Privacy defaults

Image endpoints store no raw bytes, base64 payloads, or full URLs. Text defaults to store_content=false. See Privacy, Security, and Subprocessors.