Skip to main content
POST
qa_file

Authorizations

X-API-Key
string
header
required

Headers

prefer
string | null
Idempotency-Key
string | null

Use the same key to recover an earlier request. A replay returned as a Job carries Idempotent-Replayed: true and replayed: true without a new charge; Job credits keeps the original cost. Re-serving a settled inline tool answer reports zero credits for that call and also carries Idempotent-Replayed: true; a fresh re-execution after a transient failure carries no header. The key is kept with the job for replay and never cleared, so it must not contain personal data.

Maximum string length: 200

Path Parameters

workspace_id
string<uuid>
required

Workspace identifier.

Body

application/json

Request body for qa-file.

path names an uploaded source file — the same addressing as file-metadata; a workspace-internal derivative path is refused with invalid_request. component scopes the question to one public component by name (a pdf section or a workbook tab — the names file-metadata lists). For a PDF it may also name one of the figures file-metadata lists (figure p3-1: vision over that picture alone) or a page (page 3: vision over the whole rendered page).

path
string
required

The uploaded file's full path relative to the workspace root, exactly as it was uploaded and as listings and search results print it — e.g. evidence/doc-7f83/contract.pdf. Not a bare file name (a file's file_name), a folder, a file id, or a path that starts with the workspace id.

Required string length: 1 - 1024
query
string
required
Required string length: 1 - 4096
component
string | null
include_citations
boolean
default:true
output_schema
Output Schema · object | null

A JSON Schema (Draft 2020-12, object root, local non-recursive $ref only, no pattern, patternProperties or unevaluated*) the answer must follow. When set, the agent writes answer as JSON text conforming to it, the run checks that and asks the agent to correct a mismatch, and the result carries the parsed value in structured_answer. A field the source does not state comes back null, whatever type the schema gives it. Explanation goes to reasoning where the result has one, and evidences are unchanged. If the answer still misses the schema, the run succeeds with answer as written and structured_answer null. Omit for a prose answer.

Response

Successful Response

Response body for qa-file.

engine reports what answered: recursive_llm for prose, vision for an image, and agent when the file has several parts and a QA agent worked across them. Citations always name the uploaded file, never anything internal.

job_id is the durable job row created for this run; poll or retrieve it via GET /v1/jobs/{job_id} to get the stored answer after the fact.

Billing: a question answered by recursive_llm or vision (one piece of content: a text section, transcript, image, page or figure, including a component-scoped question) is not billed. An agent answer bills one unit per agent step.

unavailable is always empty since table files moved to query-tables (which reports unqueryable selections there); the field is retained for wire compatibility.

answer
string
required
citations
Evidence · object[]
required
engine
enum<string>
required
Available options:
recursive_llm,
vision,
agent
confidence
enum<string> | null

The engine's self-graded confidence in the answer — how well the file content it read supports it, on the shared six-level scale (certain / very_high / high / medium / low / speculative). Null when the engine could not grade (a timeout's partial answer, a legacy run).

Available options:
certain,
very_high,
high,
medium,
low,
speculative
credits
integer | null

Credits billed for this call; zero for a free answer or replay, null when a billing receipt is unavailable.

Required range: x >= 0
job_id
string<uuid> | null
structured_answer
any | null

answer parsed as JSON, set only when the request carried output_schema and the answer validates against it; a field the source does not state is null whatever type the schema gives it. Null on every run without a schema, and on a run whose answer still missed the schema after its corrections, where answer holds the text as written.

timed_out
boolean
default:false
unavailable
UnavailableTable · object[]
waiver
enum<string> | null

Why this call is free: repeat_of_job reuses an earlier answer; no_job answers without creating a job.

Available options:
repeat_of_job,
no_job