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
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.
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.
Route on recommended_action
allow → publish or proceedrevise → fix the flagged signalshuman_review → route to a humanreject → block or discard
recommended_action is the primary integration field. Scores explain the route; your workflow should branch on the action.
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}
}| Field | Meaning |
|---|---|
analysis_id | Stable analysis identifier for logs and support. |
modality | text or image. |
recommended_action | Main workflow route: allow, revise, human_review, or reject. |
risk_level | Low, medium, or high summary of the strongest workflow-risk signal. |
primary_reason | Single top reason for the route. |
confidence | Model confidence in the routing decision. |
evidence | Typed spans, cues, or observations behind the decision. |
recommended_fixes | Actionable changes for revise/human_review workflows. |
limitations | Boundary language, including non-forensic scope. |
billing | Units, 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.
| Status | Meaning | Retry? |
|---|---|---|
| 400 | validation errors such as missing content, unsupported context, or malformed JSON. | No; fix request. |
| 401 | Missing or invalid bearer API key. | No; refresh key. |
| 402 | insufficient credits. | No; add credit or reduce run size. |
| 413 | content too large. | No; chunk input. |
| 415 | unsupported media type. | No; submit supported HTTPS media. |
| 429 | rate limited; respect Retry-After. | Yes, after delay. |
| 5xx | transient 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_use | low | medium | high |
|---|---|---|---|
| publish | allow | revise | human_review |
| train | allow | human_review | reject |
| cite | allow | human_review | reject |
| moderate | allow | allow | revise |
| other | allow | revise | human_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.