Quickstart — 5 minutes to your first analyzed result
Call VeracityAPI before an agent publishes, cites, trains on, or moderates text, image, audio, or private-beta video. Results include evidence, limitations, and a workflow-ready recommended_action. Benchmark v0.2 reports 0.871 macro F1 on a 500-item seed routing corpus.
Get API key Error handling Trust model OpenAPI JSON
1. Copy-paste cURL first
Set your key locally; never paste production keys into client-side code or public repos.
# Replace DOC_KEY with your key from /account
curl https://api.veracityapi.com/v1/analyze -H "Authorization: Bearer DOC_KEY" -H "Content-Type: application/json" -d '{"type":"text","content":"Paste a draft, caption, review, or source snippet with enough context to evaluate before it ships.","context":{"format":"article","intended_use":"publish","domain":"travel safety"},"auto_revise":true}'Branch on recommended_action: allow, revise, human_review, or reject.
allow → publish or proceedrevise → fix the flagged signalshuman_review → route to a humanreject → block or discard
Pricing units and billing buckets
Billing is prepaid usage-based. Text buckets are character-based, not token-based and not per-call.
| Bucket | Unit | Price | Notes |
|---|---|---|---|
text_1k_units | 1,000 input characters, rounded up per request | $0.005 / unit | Minimum 1 billable unit for valid text requests. |
text_revise_1k_units | 1,000 input characters, rounded up per request | $0.010 / unit | Used when auto_revise:true; revised_text only appears when action is revise. |
batch_text_1k_units | Sum of each item rounded up independently | $0.005 / item unit | Batch v0.1 is text-only and sync. |
image_v0 | One successful image analysis | $0.02 | HTTPS URL or base64 source; no raw image bytes stored. |
audio_v0 | One successful audio analysis | $0.01 | HTTPS URL or base64 source; transcript may be returned. |
video_v0 | One successful private-beta video analysis | $0.05 | Direct HTTPS video, 30s/25MB cap. |
Limits, sync behavior, and client timeouts
| Surface | Current limit | Behavior |
|---|---|---|
| Text | 20–100,000 characters | Below 20 chars returns 400 bad_request; above 100k returns 400/413-class validation. Use 30s client timeout. |
| Batch | 1–25 text items; each 20–4,000 chars; max 50,000 total text chars | Sync only. mode:"async" is rejected. Use batches for pipeline throughput, not unlimited concurrency. |
| Image | Public HTTPS URL up to 2,000 chars, or base64 PNG/JPEG/WebP up to 5MB | Sync. Use 60s client timeout. |
| Audio | Public HTTPS URL up to 2,000 chars, or base64 MP3/WAV/M4A/WebM/Ogg up to 4MB; optional transcript up to 10,000 chars | Sync. Use 60s client timeout. |
| Video private beta | Public HTTPS MP4/WebM/QuickTime URL, 30 seconds / 25MB | Sync contact-sheet triage. Use 45s client timeout. No webhook/async pattern yet. |
| Public demo | 12 demo calls/hour/IP by default | Returns 429 and Retry-After when exceeded. |
| Authenticated API RPS | No published hard per-account RPS yet | Beta guidance: keep retries bounded, preflight spend with /v1/balance, and contact us before high-concurrency jobs. |
Observed latency, last 30 days
| Modality | n | p50 | p95 |
|---|---|---|---|
| text | 117 | 5.4s | 10.5s |
| image | 15 | 5.4s | 10.5s |
| audio | 17 | 8.1s | 10.8s |
| video private beta | 2 | 6.4s | 11.6s |
Measured from analysis_logs.latency_ms over the last 30 days. These are observed production logs, not an SLA; small media/video samples are directional.
Complete response example
Text responses include scores, evidence, fixes, routing, limitations, model version, and billing. Media responses keep the same routing spine and add modality-specific fields such as synthetic_image_risk, synthetic_audio_risk, or synthetic_video_risk.
{
"analysis_id": "ana_01HX...",
"modality": "text",
"content_trust_score": 0.42,
"synthetic_risk": 0.61,
"slop_risk": 0.74,
"specificity_risk": 0.74,
"provenance_weakness": 0.55,
"synthetic_texture_risk": 0.61,
"risk_level": "high",
"recommended_action": "human_review",
"primary_reason": "unsupported_claim",
"confidence": "medium",
"evidence": [
{
"type": "unsupported_claim",
"severity": "high",
"span": "pickpockets are everywhere",
"explanation": "Absolute safety claim without a named source, location, or bounded condition."
}
],
"recommended_fixes": [
"Replace absolute warnings with named locations, mechanisms, dates, and sourceable evidence."
],
"limitations": ["Workflow signals, not forensic proof."],
"revised_text": "Only present when auto_revise:true and recommended_action is revise.",
"model_version": "v0.1",
"billing": {"units_analyzed":1,"bucket":"text_1k_units","price_cents":0.5,"remaining_balance_cents":149.5}
}Evidence spans
evidence[].span is currently the exact substring or observable cue text, not a character-offset object. If you need UI highlighting, find the first matching substring in the submitted text and fall back to displaying the evidence card when no exact match exists. Character offsets are a roadmap improvement.
Recommended fixes
recommended_fixes are human/agent instructions. They are not guaranteed patches. Use them to prompt a writer, revision agent, moderation queue, or source-checking workflow.
Error response shape
Errors use application/problem+json plus an x-request-id header. See /docs/errors for retry policy.
{
"type": "https://veracityapi.com/problems/bad_request",
"title": "Bad Request",
"status": 400,
"detail": "content: Text content must be 20-100000 characters",
"instance": "req_01HX...",
"code": "bad_request"
}| Status | Meaning | Retry? |
|---|---|---|
| 400 | Malformed JSON, invalid context, unsupported mode, text too short/long, bad URL. | No. |
| 401 | Missing or invalid bearer API key. | No. |
| 402 | insufficient credits / insufficient prepaid credits. | No; top up or reduce request size. |
| 429 | Rate limited. | Yes, after Retry-After. |
| 503 | Provider/model/video extractor unavailable. | Yes, bounded exponential backoff. |
Action policy and score relationships
For text v0.1, risk_level = threshold(max(synthetic_risk, slop_risk)): below 0.40 = low, below 0.70 = medium, 0.70+ = high. specificity_risk and provenance_weakness are derived explanatory axes: they help queues and dashboards understand why the content trust score fell, but they do not independently override risk_level in v0.1.
content_trust_score is higher-is-better and derived from the strongest quality/provenance/texture penalty. Use confidence to decide whether to trust automation: high confidence can route automatically in low-stakes workflows; medium/low confidence should bias toward review when stakes are high.
| intended_use | low | medium | high |
|---|---|---|---|
| publish | allow | revise | human_review |
| train | allow | human_review | reject |
| cite | allow | human_review | reject |
| moderate | allow | human_review | reject |
| other | allow | revise | human_review |
This is workflow triage, not forensic proof. Do not use VeracityAPI as legal, academic misconduct, identity, speaker-verification, or authorship evidence.
Batch endpoint semantics
POST https://api.veracityapi.com/v1/analyze-batch GET https://api.veracityapi.com/v1/balance
- Batch v0.1 supports text items only.
- Results preserve request order:
results[i]corresponds toitems[i]. - The HTTP status is
200for a syntactically valid batch; per-item failures are returned as{"status":"error","error":...}inside the array. - The batch is debited before processing using the sum of per-item rounded-up text units. If the scoring provider fails for the whole batch, usage is refunded. Per-item validation should be caught before billing by request validation.
auto_reviseis disabled for batch v0.1.
Versioning, idempotency, and language coverage
- Model version: every response includes
model_version. The public default isv0.1. There is no request-body model selector yet. - Rollouts: threshold-changing model updates should ship with a new model version, docs update, and eval note before being treated as production-stable.
- Idempotency: send
Idempotency-KeyonPOST /v1/analyzeretries. Successful responses are cached for 24h per account, endpoint, and key. Replays return the original JSON withIdempotency-Replayed: trueand do not debit credits again. Reusing the same key with a different request body returns409 idempotency_conflict. - Language: English-calibrated first. Non-English and RTL content are experimental until language-specific evals are published.
auto_revise behavior
auto_revise:true runs an additional revision pass only when text routes to revise. It is designed to preserve factual claims, links, Markdown-ish structure, and the caller's domain context when possible. It is not a deterministic diff engine and should not be used for legal/compliance rewrites without review. HTML should be submitted as text or pre-extracted content; sanitize rendered HTML in your own application.
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,
auto_revise=True,
context={"format": "article", "intended_use": "publish"},
)Image cURL
curl https://api.veracityapi.com/v1/analyze -H "Authorization: Bearer DOC_KEY" -H "Content-Type: application/json" -d '{"type":"image","content":"https://example.com/image.jpg","context":{"format":"social_post","intended_use":"moderate"}}'Audio cURL
curl https://api.veracityapi.com/v1/analyze -H "Authorization: Bearer DOC_KEY" -H "Content-Type: application/json" -d '{"type":"audio","content":"https://example.com/audio.mp3","context":{"format":"social_post","intended_use":"moderate"}}'Video private beta
curl https://api.veracityapi.com/v1/analyze -H "Authorization: Bearer DOC_KEY" -H "Content-Type: application/json" -d '{"type":"video","content":"https://example.com/clip.mp4","context":{"format":"social_post","intended_use":"moderate"}}'Direct HTTPS videos only, capped at 30 seconds / 25MB. Cost: $0.05 per successful call. For access questions, email hello@veracityapi.com.
Privacy, auth, and browser guidance
- Customer-submitted content is not used to train models.
- Raw text/content/media bytes/full media URLs are not stored by default; logs retain hashes, metadata, response JSON, billing, model version, and latency.
- Image/audio/video endpoints store no raw media bytes, base64 payloads, contact sheets, frames, or full URLs.
- privacy-safe defaults: customer content is not used for training, and API keys are bearer secrets. Keep keys server-side, rotate keys from /account, and never hardcode them in Chrome extensions or browser JavaScript. Use a backend token exchange for browser/extension flows.
See Privacy, Security, Subprocessors, and Status.