Skip to content
Docs

Locate text spans in the input

post/span

Returns character offset ranges into state that answer the question. value is an array of {start, end, text} objects, where text is the quoted substring from the input.

/span always runs in fast mode. Sending mode: "deep" or think: true is rejected (422).

Body ParametersExpand Collapse
question: string

What to locate in the text.

documents: optional array of object { b64, filename, mime, url }
b64: optional string

Base64-encoded file bytes.

filename: optional string

Helps format detection (e.g., memo.txt, contract.pdf).

mime: optional string

MIME type of the document.

url: optional string

Public HTTP(S) URL to fetch the document from.

domain: optional string
images: optional array of object { b64, mime, url }

Optional images (spans are still character ranges into state).

b64: optional string

Base64-encoded image bytes (raw base64, not a data: URL). Pair with mime.

mime: optional string

MIME type for b64 content. Must be an image/* type.

url: optional string

Public HTTP(S) image URL. The server fetches it within a shared 60-second budget.

state: optional string

The text to search for spans in.

ReturnsExpand Collapse
SpanDecision = object { evidence, latency_ms, mode, 14 more }
evidence: object { spans }
spans: optional array of object { end, start, text }

Character ranges in the input text that support the decision.

end: number

Exclusive character offset.

start: number

Inclusive character offset into the state text.

text: string

The quoted substring.

latency_ms: number

Server-side processing time in milliseconds.

mode: "fast" or "deep"
Accepts one of the following:
"fast"
"deep"
model: string

The model that produced this decision.

status: "answered" or "abstained"

answered — the model produced a confident answer. abstained — the model was not confident enough; value is null.

Accepts one of the following:
"answered"
"abstained"
thought: boolean

Whether a reasoning trace was actually generated.

type: "span"
Accepts one of the following:
"span"
value: unknown

Text spans found in the input.

verification: object { performed, result }
performed: boolean

Whether the verification step ran (only in deep mode).

result: "passed" or "conflict" or "insufficient" or "not_applicable"

passed — verification confirmed the answer. conflict — verification disagreed (triggers abstention in deep mode). insufficient — not enough evidence to verify. not_applicable — verification was not performed (fast mode).

Accepts one of the following:
"passed"
"conflict"
"insufficient"
"not_applicable"
abstain_reason: optional "low_confidence" or "readout_disagreement" or "insufficient_evidence" or "unresolved_after_thinking"

Why the model abstained. null when status is answered.

  • low_confidence — probability mass was too spread out.
  • readout_disagreement — deep verification found a conflict.
  • insufficient_evidence — not enough context to decide.
  • unresolved_after_thinking — reasoning did not resolve ambiguity.
Accepts one of the following:
"low_confidence"
"readout_disagreement"
"insufficient_evidence"
"unresolved_after_thinking"
billable_tokens: optional number

Billing token count = max(1000, input_tokens). This is the number used for usage metering, with a per-decision floor of 1,000 tokens.

document_notes: optional array of object { document, status, chars, 3 more }

Per-document extraction status. Present when documents were sent.

document: string

Filename or URL of the document.

status: "included" or "truncated" or "skipped"
Accepts one of the following:
"included"
"truncated"
"skipped"
chars: optional number

Number of characters extracted.

reason: optional string

Why the document was truncated or skipped.

tokens: optional number
truncated: optional boolean
document_tokens: optional number

Document-specific subset of input_tokens. Present when documents were sent.

grounded: optional boolean

true when the answer is grounded in the provided context (a direct readout). false when the answer is free-form generation.

image_tokens: optional number

Image-specific subset of input_tokens.

input_tokens: optional number

Total tokens processed (text + images + documents + audio).

think_allowed: optional boolean

Whether thinking was allowed for this call. Only present in fast mode.

Locate text spans in the input
curl https://api.articul8.ai/bivia/span \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $A8_API_KEY" \
    -d '{
          "question": "Where is the auto-renewal clause?"
        }'
{
  "evidence": {
    "spans": [
      {
        "end": 0,
        "start": 0,
        "text": "text"
      }
    ]
  },
  "latency_ms": 0,
  "mode": "fast",
  "model": "dec-1",
  "status": "answered",
  "thought": true,
  "type": "span",
  "value": {},
  "verification": {
    "performed": true,
    "result": "passed"
  },
  "abstain_reason": "low_confidence",
  "billable_tokens": 0,
  "document_notes": [
    {
      "document": "document",
      "status": "included",
      "chars": 0,
      "reason": "reason",
      "tokens": 0,
      "truncated": true
    }
  ],
  "document_tokens": 0,
  "grounded": true,
  "image_tokens": 0,
  "input_tokens": 0,
  "think_allowed": true
}
Returns Examples
{
  "evidence": {
    "spans": [
      {
        "end": 0,
        "start": 0,
        "text": "text"
      }
    ]
  },
  "latency_ms": 0,
  "mode": "fast",
  "model": "dec-1",
  "status": "answered",
  "thought": true,
  "type": "span",
  "value": {},
  "verification": {
    "performed": true,
    "result": "passed"
  },
  "abstain_reason": "low_confidence",
  "billable_tokens": 0,
  "document_notes": [
    {
      "document": "document",
      "status": "included",
      "chars": 0,
      "reason": "reason",
      "tokens": 0,
      "truncated": true
    }
  ],
  "document_tokens": 0,
  "grounded": true,
  "image_tokens": 0,
  "input_tokens": 0,
  "think_allowed": true
}