Prerequisites
- Python 3.10 or later
- A FlexOrch API key (format:
dfx_<random_string>) — find yours in the FlexOrch dashboard
Installation
If
FLEXORCH_API_KEY is set in your environment, you can omit the api_key
argument entirely — the SDK picks it up automatically.Pass any local file path to
client.documents.upload(). The method returns a Job object immediately.job = client.documents.upload("invoice.pdf")
print(f"Job created: {job.id} | Status: {job.status}")
Call
job.wait_until_done() to block until the job reaches a terminal state (completed or failed). The SDK handles polling and back-off for you.Full working example
Processing time depends on file size and plan tier. Most documents under 10 MB
complete within 30 seconds on the Growth plan.
Next steps
Upload Documents
Learn single-file, batch, and connector-based upload patterns.
Manage Jobs
Poll job status, filter by quality grade, and submit feedback.
Build Datasets
Combine completed jobs into exportable, LLM-ready datasets.
API Reference
Full class and method reference for the Python SDK.