---
title: "Production analyze endpoint: deterministic rules + Galvanize 2 neural engine"
method: POST
path: "/v30/analyze"
---

# Production analyze endpoint: deterministic rules + Galvanize 2 neural engine

`POST /v30/analyze`

## Request

- Base URL: `https://api.usezn.com`
- URL: `https://api.usezn.com/v30/analyze`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (client credentials, token URL `https://dev-hpfq4tffrj4acggc.us.auth0.com/oauth/token`, scopes: `write:analyze`)

A request is evaluated by deterministic regex & AST rules (<0.1 ms) and scored by the Galvanize 2 neural engine (fine-tuned from Horizon-Labs/prompt-injection-guard-small, Apache-2.0; scores 512 tokens at a time, and inputs of more than 2,000 characters in windows; full-precision ONNX on CPU). The verdict is block when the rules engine matches or the model score reaches the applied threshold (0.662); allow otherwise. If Galvanize 2 is unavailable, the previous model, Galvanize-60M, scores the request at its own threshold (0.95). Response bodies carry the model version (zn-galvanize2-fp32-s512, or zn-galvanize60m-int8-s512 when the fallback decided), the applied threshold and which signal decided the outcome. Self-hosted deterministic rules run in <0.1 ms. Held-out results for Galvanize 2 at 0.662: 83.4% recall, 0.81% false positive rate.

## Request body

- AnalyzeRequest
  - `input` string, required: The exact text you intend to pass to your tool. Analyze it BEFORE executing the tool call.
  - `text` string: Alias of input. Send either input or text; input wins when both are present.
  - `long_input` 'windows': Score an input of 2,000 characters or fewer in overlapping 512-token windows too. Inputs of more than 2,000 characters are always scored in windows (up to 20). Window scoring answers within about 7 seconds; set a client timeout of at least 10 seconds.

## Response `200`

Combined verdict for the submitted input. Includes model observability headers whenever the model ran.

- VerdictV30: Verdict: core allow/block contract plus model observability fields.
  - `verdict` 'allow' | 'block', required: Block on "block" before executing the tool call.
  - `confidence` number, float, required: Confidence score of the decision.
  - `rule` string, required: Identifier of the deterministic rule that matched; "none" when allowed.
  - `reason` string, nullable, required: Human-readable explanation of the match, or null.
  - `rules_version` string, required: Version of the rules engine that produced this verdict (for reproducible audits).
  - `evidence_id` string, required: ID of the stored evidence record for this decision.
  - `latency_ms` integer, required: End-to-end processing time in milliseconds.
  - `score` number, float, nullable: Model probability in [0,1] (Galvanize 2, or Galvanize-60M on fallback). null when the model mode is off or the engine was unavailable.
  - `threshold` number, float: Decision threshold applied to score when combining the model verdict: 0.662 (0.661988004118821) for Galvanize 2, 0.95 when Galvanize-60M decides on fallback.
  - `decided_by` 'rules' | 'ml' | 'deep' | 'ml-error-rules-fallback' | 'deep-failopen': Which signal produced the final verdict: deterministic rules, the neural model, or a fallback after a neural-engine error.
  - `ml_version` string, nullable: Identifier of the model whose score was used (zn-galvanize2-fp32-s512, or zn-galvanize60m-int8-s512 on fallback); null when the model did not run.
  - `ml_threshold` number, float: Threshold reported alongside ml_version for reproducibility (0.661988004118821 for Galvanize 2, 0.95 for Galvanize-60M).
  - `mode` 'shadow' | 'active' | 'off': ML integration mode of this deployment: active (rules OR the neural model decides; current default), shadow (observed only), off (pure rules).
  - `input_chars` integer: Characters of input, counted as Unicode code points.
  - `billed_calls` integer: Calls billed: 1 up to 2,000 characters, one more for each extra 1,000 characters or part of them.
  - `long_input` object: Present when windows apply: more than 2,000 characters, or asked for with long_input.
    - `mode` 'windows' | 'truncate'
    - `reason` 'fallback' | 'not_scored': With mode truncate: fallback (the fallback model decided on the first 512 tokens) or not_scored (no model ran). One call is billed.
    - `windows` integer
    - `scored` integer
    - `top_window` integer
    - `capped` boolean
    - `partial` boolean
  - `router_level` 'rules' | 'advanced' | 'deep': Which path decided: rules, advanced (neural model) or deep. Same value as the X-ZN-Router-Level header.
  - `deep_score` number, float: Present only when the deep engine scored the input.
  - `deep_mode` string: Deep-engine integration mode of this deployment.
  - `tier` 'free' | 'pro' | 'scale' | 'team' | 'internal': Plan tier the call was served under.

## Other responses

- `400`: The body has no string input (or text) field, or input is longer than 20,000 UTF-16 code units.
- `401`: Missing or invalid API key.
- `402`: A Team subscription is not active (trial over or payment due) and no credits are left.
- `429`: Monthly call limit reached for the plan and no credits remain (MONTHLY_LIMIT_REACHED), or the input needs more calls than are left (INSUFFICIENT_QUOTA, with required and remaining). Buy credits or upgrade at https://usezn.com/pricing/. RateLimit headers are returned.
- `500`: Unexpected server-side failure, including a request body that is not valid JSON. A failed request is not billed.

## Changes

- **2026-10-20** `2e48398b21da`: 6 info
  - added the optional property `allOf[subschema #2]/deep_mode` to the response with the `200` status
  - added the optional property `allOf[subschema #2]/deep_score` to the response with the `200` status
  - added the optional property `allOf[subschema #2]/router_level` to the response with the `200` status
  - added the optional property `allOf[subschema #2]/tier` to the response with the `200` status
  - …2 more
- **2026-10-20** `f190092548c8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/usezn/apis/usezn-api/changes/v30/analyze/post.md)

---

[API](https://skmtc.dev/usezn/apis/usezn-api.md) · [All operations](https://skmtc.dev/usezn/apis/usezn-api/llms.txt) · [OpenAPI document](https://skmtc.dev/usezn/apis/usezn-api/revisions/2e48398b21da?raw)
