Skip to main content

Claix Python SDK

PyPI Python License: MIT

Official typed Python client for the Claix document intelligence API (OpenAPI 1.8.2).

Extract PDFs, Excel, Word, images, and text into schema-validated JSON. Query persisted documents and knowledge spaces. Drop the same client into LangChain / LangGraph, CrewAI, and LlamaIndex.

Install

pip install claix-ai
pip install 'claix-ai[langchain]'
pip install 'claix-ai[crewai]'
pip install 'claix-ai[llamaindex]'
pip install 'claix-ai[all]'

Requires Python ≥ 3.10. Set CLAIX_API_KEY or pass api_key= to the client.

Quickstart

from claix import ClaixClient

client = ClaixClient()  # reads CLAIX_API_KEY
result = client.extract.pdf("invoice.pdf", schema_id="3c7a9f21-4b8e-4d1a-9c6f-2e0d8a5b7c4f")
print(result.data)

Async:

from claix import AsyncClaixClient

async with AsyncClaixClient() as client:
    doc = await client.extract.pdf("invoice.pdf", schema_id="...")
    answers = await client.context.ask(doc.document_id, ["What is the total?"])

Extraction, context, and spaces

from claix import ClaixClient

client = ClaixClient(api_key="ck_...")

# Standard extraction → POST https://claix.dev/api/pdf-json
extracted = client.extract.pdf("scan.pdf", schema_id="...", space_id=None, is_agent_mode=False)

# Agent Mode → POST https://claix.dev/agent/pdf-json
agented = client.extract.pdf("contract.pdf", schema_id="...", is_agent_mode=True)
print(agented.agent_data)

space = client.spaces.create("Vendors 2026")
client.extract.excel("ledger.xlsx", schema_id="...", space_id=space.space.space_id)

# Cross-document Q&A — ia_response is list[str | None] (native null when missing)
qa = client.spaces.ask(space.space.space_id, ["Which vendor billed the most?"])
print(qa.user_ask, qa.ia_response)

LangGraph (ReAct)

from claix import ClaixClient
from claix.integrations.langchain import (
    ClaixDocumentContextTool,
    ClaixExtractTool,
    ClaixSpaceContextTool,
)
from langgraph.prebuilt import create_react_agent

client = ClaixClient()
tools = [
    ClaixExtractTool(client=client),
    ClaixDocumentContextTool(client=client),
    ClaixSpaceContextTool(client=client),
]
agent = create_react_agent("openai:gpt-4.1", tools)
agent.invoke({
    "messages": [{
        "role": "user",
        "content": "Extract invoice.pdf with schema 3c7a9f21-4b8e-4d1a-9c6f-2e0d8a5b7c4f, "
                   "then ask the document_id for the VAT total.",
    }]
})

create_react_agent builds a StateGraph that loops until the model stops calling tools. ClaixSpaceContextTool is the right primitive for multi-file nodes (compare, sum, reconcile under a space_id).

CrewAI

from crewai import Agent, Crew, Task
from claix import ClaixClient
from claix.integrations.crewai import ClaixDocumentTool, ClaixKnowledgeSpaceTool

client = ClaixClient()
analyst = Agent(
    role="Document auditor",
    goal="Extract contracts and reconcile them against invoices",
    backstory="You never guess missing fields; you trust Claix nulls.",
    tools=[ClaixDocumentTool(client=client), ClaixKnowledgeSpaceTool(client=client)],
)
task = Task(
    description="Extract contracts/ and invoices/ into space {space_id}, then list discrepancies.",
    expected_output="A JSON list of mismatches. Use null when a field is absent.",
    agent=analyst,
)
Crew(agents=[analyst], tasks=[task]).kickoff()

LlamaIndex

from claix import ClaixClient
from claix.integrations.llamaindex import ClaixToolSpec

spec = ClaixToolSpec(client=ClaixClient())
tools = spec.to_tool_list()  # extract_document, ask_document, ask_knowledge_space

SDK map (OpenAPI 1.8.2)

SDK method HTTP
client.extract.pdf(file, schema_id, space_id=None, is_agent_mode=False) POST /api/pdf-json or POST /agent/pdf-json
client.extract.excel(...) POST /api/excel-json or POST /agent/excel-json
client.extract.document(...) POST /api/doc-json or POST /agent/doc-json
client.extract.image(...) POST /api/img-json or POST /agent/img-json
client.extract.text(content, schema_id, ...) POST /api/txt-json or POST /agent/txt-json
client.extract.json_to_excel(schema_id=..., data=...) POST /api/json-excel (binary .xlsx)
client.context.get(document_id) GET https://claix.dev/get-document/{document_id}
client.context.ask(document_id, questions) POST https://claix.dev/document-context/{document_id} (max 5 × 400 chars)
client.context.delete(document_id) DELETE https://claix.dev/delete-document/{document_id}
client.spaces.create(name) POST https://claix.dev/create-space
client.spaces.ask(space_id, questions) POST https://claix.dev/space-context/{space_id}
client.spaces.delete(space_id) DELETE https://claix.dev/delete-space/{space_id}
client.schemas.list() GET /api/schemas
client.schemas.create(name, type, schema_definition, ...) POST /api/create-schema
client.schemas.delete(schema_id) POST /api/delete-schema

Auth header: x-api-key (Bearer is also accepted by the API). Default timeout 120s, with retries on 429/502/503/504 and transport errors.

WindowContextSuccessResponse.ia_response and SpaceContextSuccessResponse.ia_response are typed as list[str | None] so orchestrators can branch on deterministic null.

Errors

ClaixAuthenticationError (401), ClaixNotFoundError (404), ClaixValidationError (400/413/422), ClaixRateLimitError (429), ClaixTimeoutError, ClaixConnectionError, ClaixAPIError (5xx). All subclass ClaixError and expose status_code plus the {error, detalle} payload.

License

MIT

Metadata

Release files for claix-ai 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claix-ai 1.0.0
File Size Uploaded Provenance
claix_ai-1.0.0.tar.gz 13.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for claix-ai 1.0.0
File Interpreter ABI Platform
claix_ai-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.1 kB

Release files / claix_ai-1.0.0.tar.gz

Download URL claix_ai-1.0.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1b30567323774a049778682206f054867d6cbcff21ce32d47b3253a6ef859657
BLAKE2b-256 checksum
How to use checksums
40666b7db9f15b1d5ddb9ddc94e8b628a658a44ac96df3c3b992051930667977
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / claix_ai-1.0.0-py3-none-any.whl

Download URL claix_ai-1.0.0-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a57c4c6908aeffb20a264d7233711a11f77d33e186c61ac590869dce68580499
BLAKE2b-256 checksum
How to use checksums
76f96cd6cdbb3af9137fe68f0400d278719f34690549d52db0b19ac884b3f321
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Security for claix-ai 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page