The extract tool is the final step of the pipeline. It pulls the fields you ask for out of the text and returns them as structured values.

Prerequisites

  • An AiQL API key in the AIQL_API_KEY environment variable
  • Text or chunks to extract from, and the fields you want

Extract specific fields

List the fields to pull. Use the schema from Shape to choose which fields are available. Tool requests authenticate with a Bearer token and do not need a workspace.
curl -X POST https://api.aiql.io/extract \
  -H "Authorization: Bearer $AIQL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chunks": ["First chunk of text...", "Second chunk of text..."],
    "fields": ["title", "author", "published_date"]
  }'
The response contains a record per chunk with the requested fields populated from the text.

Next step

To run all four steps as one managed job and load the result into a workspace, see Run a full ingestion.
extract is billed at 30 credits per 1,000 words, with a minimum of 1 credit. See Pricing for details.