VindexDocs

API reference

Check

Screen a prompt against a policy and get a decision back.

Screen a prompt against a policy

POST/v1/check

Runs every enabled check of the policy in one call to the screening engine, applies the code-side floors and the policy, logs the decision, and (unless dry-run) opens a review item and queues webhooks. latency_ms is received → decided; Server-Timing breaks it down.

Parameters

  • idempotency-keystringheader

    Retries with the same key (per tenant) return the first decision instead of screening again.

  • x-vindex-dry-runstringheader

    true: evaluate and log, but open no review item and send no webhooks.

Body

  • inputobjectrequired
  • input.promptstringrequired

    1–10000 chars

  • input.negative_promptstring

    ≤ 5000 chars

  • input.contextstring[]

    Surrounding text (earlier chat turns, a title). Stored with the decision; not screened yet. ≤ 20 items

  • policystring

    Policy id. Defaults to the tenant's default policy. 1–64 chars

  • userstring

    Your id for the end user this prompt is from. Stored with the decision; rules count, tag and pause per user. A paused user's checks are blocked. 1–128 chars

  • policy_versioninteger

    Screen against this version of the policy, published or not, instead of its current one. Dry-run only (X-Vindex-Dry-Run: true): for comparing versions. ≥ 1

  • metadataobject

    Your own JSON (at most 4096 bytes), stored with the decision and returned by GET /v1/decisions/:id.

Request

cURL
curl -X POST "https://api.getvindex.com/v1/check" \
  -H "Authorization: Bearer $VINDEX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"prompt":"a lighthouse at dusk, oil painting"}}'

Response 200

The decision. Idempotent-Replayed: true when returned for a repeated Idempotency-Key.

Example
{
  "id": "dec_3f2a0c9e8b7d4c6a9f1e2d3c4b5a6978",
  "outcome": "allow",
  "tags": [],
  "checks": {
    "minors_sexual": {
      "score": 0.01,
      "review_score": 0.01,
      "fired": []
    },
    "adult": {
      "score": 0.01,
      "review_score": 0.01,
      "fired": []
    },
    "real_person": {
      "score": 0.01,
      "review_score": 0.01,
      "fired": []
    },
    "copyrighted_ip": {
      "score": 0.01,
      "review_score": 0.01,
      "fired": []
    }
  },
  "policy": {
    "id": "pol_3f2a0c9e8b7d4c6a9f1e2d3c4b5a6978",
    "version": 1
  },
  "engine_version": "2026.09",
  "latency_ms": 412,
  "dry_run": false,
  "mode": "test",
  "shadow_mode": false
}

Errors

  • 400Invalid request (malformed JSON, or the body/query failed validation).
  • 401Missing, malformed, unknown or revoked API key.
  • 402Nothing was screened. subscription_paused: a payment has been failing for 14 days. subscription_inactive: the plan has ended (read-only). plan_required: a live key on a workspace with no plan, or a test key past the free allowance.
  • 404policy names no policy of this tenant (policy_not_found).
  • 422No policy and no default policy (no_default_policy), or an Idempotency-Key reused with a different body (idempotency_key_reused).
  • 429Rate limit exceeded for this API key. See Retry-After.
  • 503The screening engine is unavailable (screening_unavailable); nothing was decided. See Retry-After.