API · Queries
List a document's queries
/api/v1/documents/{id}/queries
Newest first. Every question ever asked of this document, with its answer.
Path parameters
-
idstring requiredThe document's id.
Query parameters
-
limitinteger optional default 20How many to return.
Example:
limit=50
Returns 200
The document's questions.
-
objectstringAlways
list. -
dataarray of QueryNewest first, each with its answer.
13 fields
-
idstringThe query's id.
-
objectstringAlways
query. -
answerQueryAnswerThe answer, once
statusiscompleted. SeeQueryAnswer.4 fields
-
answerobjectA string, or an object following the query's
schema. -
citationsarray of objectEvery page and quote the answer came from.
2 fields
-
pageinteger -
quotestring
-
-
confidencenumberHow sure the model is, from 0 to 1.
at least 0 · at most 1
-
not_foundbooleantruewhen the document does not answer the question.
-
-
completed_atstringWhen it was answered.
-
costobjectHeld, then charged, in micro-USD.
2 fields
-
estimated_microinteger -
settled_microinteger
-
-
created_atstringWhen you asked.
-
document_idstringThe document it was asked of.
-
errorobjectWhy it failed.
2 fields
-
messagestring -
typeinsufficient_credits | document_too_large | document_expired | schema_mismatch | query_failed
-
-
instructionsstringThe instructions you sent, if any.
-
modelobjectThe model you asked for and the one that answered.
2 fields
-
requestedstring -
usedstring
-
-
questionstringWhat you asked.
-
schemaobjectThe JSON Schema you asked the answer to follow, if any.
-
statusqueued | processing | completed | failedcompletedmeansansweris ready;failedmeans readerror.
-
-
document_idstringThe document these belong to.
Errors
-
401Missing, revoked or expired key
-
402Payment required. Either the plan's monthly request quota is spent (
quota_exceeded, trial plans only — pay as you go is never capped) or the workspace is out of credit (insufficient_credits). -
404No document or query with that id for this key (documents are scoped to the key's workspace and live/test mode)
-
429Per-second burst limit for the plan exceeded; retry after
Retry-Afterseconds
Every error has the same shape. See Errors.