Skip to main content

Client Initialization

Synchronous Client

Asynchronous Client

Client Configuration

Parameters

string
required
Your Cerevox API key. Get one at cerevox.ai/lexa
string
default:"https://data.cerevox.ai"
Base URL for the Cerevox API endpoint
float
default:"60.0"
Request timeout in seconds for API calls
int
default:"3"
Maximum number of retry attempts for failed requests
float
default:"1.0"
Delay in seconds between retry attempts

Environment Variables

Client Methods

Core Parsing Methods

Parse local files or file-like objects.
Parse files from URLs.
Get the current status of a parsing job.

Cloud Storage Methods

Processing Modes

Choose the right processing mode for your use case:

DEFAULT

Fast and efficient
  • Optimized for speed
  • Good accuracy
  • Lower resource usage
  • Recommended for most use cases

ADVANCED

Maximum accuracy
  • Highest accuracy
  • Enhanced table extraction
  • More thorough analysis
  • Best for complex documents

Error Handling

The Lexa client provides comprehensive error handling:

Best Practices

Use the async client for better performance when processing multiple files:
Use progress callbacks for long-running operations:
Properly manage client resources:

Next Steps

Ready to start parsing? Check out our quickstart guide or explore real-world examples.