POST
/
extract
import os
from reducto import Reducto

client = Reducto(
    api_key=os.environ.get("REDUCTO_API_KEY"),  # This is the default and can be omitted
)
extract_response = client.extract.run(
    document_url="string",
    schema={},
)
print(extract_response.citations)
{
  "usage": {
    "num_pages": 123,
    "num_fields": 123
  },
  "result": [
    "<any>"
  ],
  "citations": [
    "<any>"
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
document_url
required

The URL of the document to be processed. You can provide one of the following:

  1. A publicly available URL
  2. A presigned S3 URL
  3. A reducto:// prefixed URL obtained from the /upload endpoint after directly uploading a document
  4. A job_id (jobid://) or a list of job_ids (jobid://)
schema
any
required

The JSON schema to use for extraction.

options
object
advanced_options
object
experimental_options
object
system_prompt
string
default:Be precise and thorough.

A system prompt to use for the extraction. This is a general prompt that is applied to the entire document before any other prompts.

generate_citations
boolean
default:false

If citations should be generated for the extracted content.

array_extract
object

The configuration options for array extract

Response

200
application/json
Successful Response
usage
object
required
result
any[]
required

The extracted response in your provided schema. This is a list of dictionaries. If disbale_chunking is True (default), then it will be a list of length one.

citations
any[] | null
required

The citations corresponding to the extracted response.