DexClient
The main client for interacting with the Dex service.Project Management
create_project(name, credentials)- Create a new project with SGP credentialslist_projects()- List all accessible projectsget_project(project_id)- Retrieve a specific projectupdate_project(project_id, updates)- Update project configuration
Project
Represents a Dex project with isolated data and credentials.File Operations
upload_file(file_path)- Upload a document to the projectlist_files()- List all uploaded filesget_file(file_id)- Get file metadatadownload_file(file_id)- Download file content
Vector Store Operations
create_vector_store(name, engine, embedding_model)- Create a vector store with SGP Knowledge Base enginelist_vector_stores()- List all vector storesget_vector_store(vector_store_id)- Get vector store detailsdelete_vector_store(vector_store_id)- Delete a vector store
DexFile
Represents an uploaded file in Dex.Parsing
parse(params)- Parse document to structured format
ParseResult
Represents the result of a document parsing operation.Extraction
extract(ExtractionParameters)- Extract structured data with user prompt, schema, model, and options
user_prompt(str): Natural language instructions for extractionextraction_schema(dict): JSON schema fromYourModel.model_json_schema()model(str): LLM model to use (e.g., “openai/gpt-4o”)generate_citations(bool): Include source citations in resultsgenerate_confidence(bool): Include confidence scores in results
Data Access
data.model_dump()- Access parsed content as dictionary
VectorStore
Represents a vector store for semantic search and RAG-enhanced extraction.Indexing
add_parse_results(parse_result_ids)- Add parsed documents to vector store by parse result IDslist_files()- List indexed filesremove_files(file_ids)- Remove files from index
Search
search(query, top_k, filters)- Semantic search across all documents in the vector storesearch_in_file(file_id, query, top_k, filters)- Search within a specific file with optional filters
Extraction
extract(ExtractionParameters)- Extract structured data from entire vector store with RAG context
Common Types
ProjectCredentials
Contains credentials for SGP and other services. Fields:sgp: SGPCredentials object
SGPCredentials
Contains SGP account credentials. Fields:account_id(str): Your SGP account IDapi_key(str): Your SGP API key
ParseEngine
Enum of available OCR engines. Values:ParseEngine.REDUCTO- Reducto OCR engine (default)ParseEngine.SCALE_OCR- Scale’s custom OCR engine
VectorStoreEngines
Enum of available vector store engines. Values:VectorStoreEngines.SGP_KNOWLEDGE_BASE- SGP Knowledge Base vector store
ReductoChunkingMethod
Enum of chunking methods for Reducto parser. Values:ReductoChunkingMethod.VARIABLE- Variable-size chunks based on contentReductoChunkingMethod.BLOCK- Fixed block-level chunks
Error Handling
The SDK raises exceptions for various error conditions:- File upload errors (invalid format, size limit exceeded)
- Parsing errors (unsupported content, OCR failure)
- Extraction errors (invalid schema, model errors)
- Authentication errors (invalid credentials)
Async/Await Pattern
The Dex SDK is fully async. Useawait with all SDK methods:
See Also
- Getting Started Guide: Learn how to use Dex with examples
- Introduction to Dex: Understand core concepts and architecture

