Getting Started

Get up and running with Smole in minutes.

Quick Start

Smole is a document extraction API that converts documents to Markdown and extracts structured data using AI. Get started in minutes with just a few API calls. See for details on how the pipeline works.

1. Get your API key

Sign up for an account and create an API key from your dashboard. Your API key starts with ak_. See for best practices on storing your keys.

2. Register a schema

Create a JSON schema that defines the structure of data you want to extract. See for a complete guide on schema structure, supported types, and best practices.

curl -X POST https://api.smole.tech/api/schemas \
  -H "X-API-Key: ak_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Invoice Schema",
    "jsonSchema": {
      "type": "object",
      "properties": {
        "invoiceNumber": { "type": "string" },
        "total": { "type": "number" },
        "date": { "type": "string" }
      },
      "required": ["invoiceNumber", "total"]
    }
  }'

Save the returned id - you'll use it for extraction jobs.

Tip: Don't want to write JSON Schema by hand? Use /api/schemas/generate to have AI create one from simple field definitions. See for a full example.

3. Upload a document

Send a document file with your schema ID to start extraction:

curl -X POST https://api.smole.tech/api/pipeline/file \
  -H "X-API-Key: ak_your_api_key" \
  -F "file=@invoice.pdf" \
  -F "schemaId=your_schema_id"

4. Poll for results

The pipeline returns a job ID. Poll the status endpoint until the job completes:

curl https://api.smole.tech/api/pipeline/{job_id} \
  -H "X-API-Key: ak_your_api_key"

When status is "completed", the result field contains your extracted JSON data.

Tutorials

Dive deeper with step-by-step guides: