The shape tool inspects your chunks and infers the schema of the data they contain. It returns the fields, their types, and their structure so you know what is available to extract.

Prerequisites

  • An AiQL API key in the AIQL_API_KEY environment variable
  • Chunks from the Split step

Infer the schema

Send the chunks you want to inspect. Tool requests authenticate with a Bearer token and do not need a workspace.
curl -X POST https://api.aiql.io/shape \
  -H "Authorization: Bearer $AIQL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"chunks": ["First chunk of text...", "Second chunk of text..."]}'
The response describes the inferred schema: each field’s name and type. Use it to decide which fields to pull in the next step.

Next step

Pass the inferred fields to Extract to pull their values out of the text.
shape is billed at 10 credits per 1,000 words, with a minimum of 1 credit. See Pricing for details.