This guide walks you through creating a workspace, ingesting a document, and running your first query against it.

Prerequisites

Before you begin, you need:
  • An AiQL API key from the Dashboard
  • A source document to ingest (a URL or storage path AiQL can reach)
  • curl, or the Python or TypeScript SDK installed
Store your API key in an environment variable rather than pasting it into commands. The examples below read from AIQL_API_KEY.

Get started

1

Set your API key

Export your key so the following commands can use it.
export AIQL_API_KEY="your_api_key"
2

Create a workspace

A workspace holds your ingested data. Create one and note the id in the response.
curl -X POST https://api.aiql.io/workspaces \
  -H "Authorization: Bearer $AIQL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Quickstart"}'
3

Ingest a document

Start an ingestion to run the full convert → split → shape → extract pipeline and load the result into your workspace. Pass the workspace ID in the AiQL-Workspace header.
curl -X POST https://api.aiql.io/ingestions \
  -H "Authorization: Bearer $AIQL_API_KEY" \
  -H "AiQL-Workspace: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{"source": "https://example.com/report.pdf"}'
4

Check ingestion status

Ingestions run asynchronously. Poll the ingestion until it finishes.
curl https://api.aiql.io/ingestions/YOUR_INGESTION_ID \
  -H "Authorization: Bearer $AIQL_API_KEY" \
  -H "AiQL-Workspace: YOUR_WORKSPACE_ID"
5

Run a query

Once the ingestion finishes, query your data in natural language.
curl -X POST https://api.aiql.io/queries \
  -H "Authorization: Bearer $AIQL_API_KEY" \
  -H "AiQL-Workspace: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{"text": "summarize the key findings"}'

Next steps

Authentication

Learn how Bearer tokens and the workspace header secure your requests.

SDKs

Use the typed Python and TypeScript clients in your application.

Pricing

See how credits are billed across tools, ingestions, and queries.

Tools

Run individual pipeline steps with convert, split, shape, and extract.
Need help? Reach out at support@aiql.io.