---
title: "Extract Agent"
method: POST
path: "/api/v0/extract"
tags: ["Agents"]
---

# Extract Agent

`POST /api/v0/extract`

Build a chart-ready dataset from unstructured text, images, PDFs, or .xlsx spreadsheets. Provide sourceText, attachments, or both.

The response is a Server-Sent Events (SSE) stream with progress, complete, and error events.

## Request body

- ExtractRequest — Provide sourceText, attachments, or both — at least one is required. images and attachments are mutually exclusive.
  - `sourceText` string — Raw text to extract data from
  - `attachments` ExtractAttachment[] — Images (max 8), PDFs (max 2), and spreadsheets (max 2). Preferred over images[].
    - `kind` 'image' | 'document' | 'spreadsheet', required
    - `mimeType` string, required — e.g. image/png, application/pdf, or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
    - `dataBase64` string, required — RFC 4648 standard base64 of the file bytes (raw bytes, not a data URL)
    - `filename` string — Optional; spreadsheets only
  - `images` object[] — Deprecated — use attachments with kind "image".
    - `mimeType` string
    - `dataBase64` string
  - `metadata` Metadata — Optional tracking information for requests
    - `callId` string, required — Required when metadata is provided. Unique identifier for tracking and debugging.
    - `locale` 'EN_GB' | 'EN_US' | 'AR' | 'PT_PT' — Locale for responses
    - `effort` 'low' | 'medium' | 'high' — Preferred invocation tier; forwarded on the invocation (including nested agents). When omitted, it can be inferred from `storytellingEffort` or defaults to `medium`.
    - `storytellingEffort` 'none' | 'low' | 'medium' | 'high' — Deprecated. Prefer `effort`. When set without `effort`, the server derives `effort` for propagation. For chart generation, an explicit value still controls narrative richness when both `effort` and `storytellingEffort` are present (`storytellingEffort` wins for the chart).

## Response `200`

SSE stream with progress and completion events

## Other responses

- `400` — Bad Request - Invalid request body
- `401` — Unauthorized - Invalid or missing API key

---

[API](https://skmtc.dev/graphy/apis/graphy-ai-agents-api.md) · [All operations](https://skmtc.dev/graphy/apis/graphy-ai-agents-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/graphy/graphy-ai-agents-api/revisions/f181a68b6e0c/schema)
