Parse Your First Document in 3 Minutes ⚡

This quickstart gets you from zero to parsing documents with Lexa. By the end, you’ll have made your first successful API call.

Requirements: Python 3.9+ • 3 minutes of your time

Step 1: Installation (30 seconds)

pip install cerevox

Step 2: Get API Key (30 seconds)

1

Get your API key

Visit cerevox.ai/lexa and sign up for your free API key

2

Copy the key

Save your API key - you’ll need it in the next step

Step 3: Authentication Setup (30 seconds)

Step 4: First API Call (60 seconds)

Copy and run this code to parse your first document:

from cerevox import Lexa

# Initialize client (uses CEREVOX_API_KEY from environment)
client = Lexa()

# Parse a local file - replace with your file path
documents = client.parse(["path/to/your/document.pdf"])

# See what you got back
doc = documents[0]
print(f"✅ Success! Extracted {len(doc.content)} characters")
print(f"📊 Found {len(doc.tables)} tables")
print(f"📄 Content preview: {doc.content[:200]}...")

# That's it! Your document is now structured data

Step 5: Test Your Setup (30 seconds)

Run this verification script to confirm everything works:

from cerevox import Lexa, LexaError

def verify_setup():
    try:
        client = Lexa()
        
        # Quick test with sample content
        test_content = b"Test document for Lexa API verification."
        documents = client.parse(test_content)
        
        if documents and len(documents) > 0:
            print("🎉 Perfect! Lexa is working correctly.")
            print(f"📄 Test result: {documents[0].content}")
            return True
    
    except LexaError as e:
        print(f"❌ API Error: {e.message}")
        print("💡 Check your API key and try again")
        return False
    except Exception as e:
        print(f"❌ Error: {e}")
        return False

# Run verification
if verify_setup():
    print("\n✅ You're ready to parse documents with Lexa!")

You’re Ready! 🎉 Lexa is configured and working. Start parsing your documents!

What’s Next?

Common Next Steps

Having Issues?


Ready to build? Check out our code examples or join the Discord community for help.

Parse Your First Document in 3 Minutes ⚡

This quickstart gets you from zero to parsing documents with Lexa. By the end, you’ll have made your first successful API call.

Requirements: Python 3.9+ • 3 minutes of your time

Step 1: Installation (30 seconds)

pip install cerevox

Step 2: Get API Key (30 seconds)

1

Get your API key

Visit cerevox.ai/lexa and sign up for your free API key

2

Copy the key

Save your API key - you’ll need it in the next step

Step 3: Authentication Setup (30 seconds)

Step 4: First API Call (60 seconds)

Copy and run this code to parse your first document:

from cerevox import Lexa

# Initialize client (uses CEREVOX_API_KEY from environment)
client = Lexa()

# Parse a local file - replace with your file path
documents = client.parse(["path/to/your/document.pdf"])

# See what you got back
doc = documents[0]
print(f"✅ Success! Extracted {len(doc.content)} characters")
print(f"📊 Found {len(doc.tables)} tables")
print(f"📄 Content preview: {doc.content[:200]}...")

# That's it! Your document is now structured data

Step 5: Test Your Setup (30 seconds)

Run this verification script to confirm everything works:

from cerevox import Lexa, LexaError

def verify_setup():
    try:
        client = Lexa()
        
        # Quick test with sample content
        test_content = b"Test document for Lexa API verification."
        documents = client.parse(test_content)
        
        if documents and len(documents) > 0:
            print("🎉 Perfect! Lexa is working correctly.")
            print(f"📄 Test result: {documents[0].content}")
            return True
    
    except LexaError as e:
        print(f"❌ API Error: {e.message}")
        print("💡 Check your API key and try again")
        return False
    except Exception as e:
        print(f"❌ Error: {e}")
        return False

# Run verification
if verify_setup():
    print("\n✅ You're ready to parse documents with Lexa!")

You’re Ready! 🎉 Lexa is configured and working. Start parsing your documents!

What’s Next?

Common Next Steps

Having Issues?


Ready to build? Check out our code examples or join the Discord community for help.