Installation & Setup
Get up and running with DocuDevs in just a few minutes. This guide covers everything you need to start processing documents with our platform.
Prerequisites
- Python 3.9+ (for SDK usage)
- API Key from DocuDevs platform
- Internet connection for API access
Step 1: Get Your API Key
Your API key is required to authenticate with the DocuDevs platform.
Creating an API Key
- Sign up at DocuDevs.ai (currently in private beta)
- Navigate to Settings → API Keys after login
- Create a new API key for your project
- Copy the API key (it looks like:
1234567890abcdef1234567890abcdef
)
- Store your API key securely like a password
- Never commit API keys to code repositories
- Don't include API keys in client-side code
- Revoke and regenerate if compromised
Managing API Keys
- Multiple Keys: Create separate keys for different projects/environments
- Revocation: Revoke keys anytime from the portal
- Regeneration: Generate new keys as needed
- Monitoring: Track usage per API key
Step 2: Install the SDK
- pip
- poetry
- conda
# Install the latest version
pip install docu-devs-api-client
# Or install a specific version
pip install docu-devs-api-client==1.0.1
# Add to your project
poetry add docu-devs-api-client
# Or specify version
poetry add docu-devs-api-client==1.0.1
# Install from PyPI via conda
conda install -c conda-forge pip
pip install docu-devs-api-client
Verify Installation
# Test your installation
from docudevs.docudevs_client import DocuDevsClient
print("DocuDevs SDK installed successfully!")
Step 3: Configure Your Environment
Set up your API key for easy access across your projects.
- Environment Variable
- Python Code
- .env File
Linux / macOS:
export API_KEY="your-api-key-here"
Windows (Command Prompt):
set API_KEY=your-api-key-here
Windows (PowerShell):
$env:API_KEY="your-api-key-here"
import os
from docudevs.docudevs_client import DocuDevsClient
# Option 1: Direct initialization
client = DocuDevsClient(token="your-api-key-here")
# Option 2: From environment variable
api_key = os.getenv('API_KEY')
client = DocuDevsClient(token=api_key)
# Option 3: With error handling
api_key = os.getenv('API_KEY')
if not api_key:
raise ValueError("API_KEY environment variable not set")
client = DocuDevsClient(token=api_key)
Create a .env
file in your project root:
# .env file
API_KEY=your-api-key-here
DOCUDEVS_API_URL=https://api.docudevs.ai
Then load it in your Python code:
from dotenv import load_dotenv
import os
from docudevs.docudevs_client import DocuDevsClient
# Load environment variables from .env file
load_dotenv()
client = DocuDevsClient(token=os.getenv('API_KEY'))
Install python-dotenv:
pip install python-dotenv
Step 4: Test Your Connection
Verify everything is working with a quick test:
import asyncio
import os
from docudevs.docudevs_client import DocuDevsClient
async def test_connection():
# Initialize client
client = DocuDevsClient(token=os.getenv('API_KEY'))
try:
# Test connection by listing configurations
response = await client.list_configurations()
print("✅ Connection successful!")
print(f"Status code: {response.status_code}")
return True
except Exception as e:
print("❌ Connection failed!")
print(f"Error: {e}")
return False
# Run the test
success = asyncio.run(test_connection())
if success:
print("🎉 You're ready to start processing documents!")
else:
print("🔧 Please check your API key and network connection.")
Alternative Integration Methods
Direct API Usage (cURL)
If you prefer direct API calls without the SDK:
# Test your API key
curl -X GET https://api.docudevs.ai/configuration \
-H "Authorization: Bearer $API_KEY"
# Upload and process a document
curl -X POST https://api.docudevs.ai/document/upload-files \
-H "Authorization: Bearer $API_KEY" \
-F "document=@your-document.pdf"
CLI Tool
The CLI tool is included with the SDK installation and provides convenient command-line access to all DocuDevs functionality:
# CLI is included with SDK installation
pip install docu-devs-api-client
# Set up authentication (choose one method)
export DOCUDEVS_TOKEN=your-api-key-here
# OR
export API_KEY=your-api-key-here
# OR pass token with each command using --token
# High-level document processing (upload + process + wait for result)
docudevs process document.pdf --prompt="Extract invoice data"
# OCR-only processing
docudevs ocr document.pdf --format=markdown
# Upload and process with a saved configuration
docudevs process-with-config document.pdf my-invoice-config
# Case management
docudevs create-case "Invoice Batch 2024-01"
docudevs list-cases
docudevs upload-case-document 123 document.pdf
# Configuration management
docudevs list-configurations
docudevs save-configuration my-config config.json
# Template management
docudevs list-templates
docudevs fill template-name data.json
# Operations (error analysis, etc.)
docudevs error-analysis job-guid-here
# Low-level commands (for advanced usage)
docudevs upload-document document.pdf # Upload only
docudevs process-document GUID config.json # Process uploaded doc
docudevs status GUID # Check job status
docudevs result GUID # Get job result
docudevs wait GUID # Wait for completion
CLI Authentication
The CLI supports multiple authentication methods:
-
Environment Variable (Recommended):
export DOCUDEVS_TOKEN=your-api-key-here
docudevs process document.pdf -
Legacy Environment Variable:
export API_KEY=your-api-key-here
docudevs process document.pdf -
Command Line Option:
docudevs --token=your-api-key-here process document.pdf
CLI Features
- High-level Commands:
process
,ocr
,process-with-config
handle the full workflow - Case Management: Create and manage document cases
- Configuration Management: Save and reuse processing configurations
- Template Operations: Fill and manage document templates
- Operations: Submit and monitor advanced operations like error analysis
- Automatic Waiting: Commands automatically wait for results by default
- Environment Integration: Respects environment variables for authentication
For complete CLI documentation including all commands and options, see the CLI Reference.
Configuration Options
API Endpoint Configuration
# Default endpoint (production)
client = DocuDevsClient(token=api_key)
# Custom endpoint (if using different environment)
client = DocuDevsClient(
api_url="https://api.staging.docudevs.ai",
token=api_key
)
Timeout Configuration
# Configure custom timeouts
client = DocuDevsClient(
token=api_key,
timeout=30 # 30 seconds timeout
)
Troubleshooting
Common Issues
Authentication Errors
401 Unauthorized - Invalid API key
Solution: Verify your API key is correct and active
Network Errors
Connection timeout or network unreachable
Solutions:
- Check internet connection
- Verify firewall settings
- Try different network if behind corporate firewall
Import Errors
ModuleNotFoundError: No module named 'docudevs'
Solutions:
- Reinstall the SDK:
pip install --upgrade docu-devs-api-client
- Check Python environment:
pip list | grep docudevs
- Verify Python version:
python --version
Environment Variable Issues
API key not found or None
Solutions:
- Check environment variable:
echo $API_KEY
- Restart terminal/IDE after setting variables
- Use absolute path for .env files
Getting Help
If you encounter issues:
- Check the Troubleshooting Guide
- Review Common Error Codes
- Contact Support: support@docudevs.ai
Next Steps
Now that you have DocuDevs installed and configured:
Quick Start
- 5-Minute Tutorial - Process your first document
- First Document Guide - Comprehensive walkthrough
Learn Core Features
- Simple Documents - Basic document processing
- Cases - Organize related documents
- Templates - Reusable processing workflows
Explore Advanced Features
- SDK Methods - Complete method reference
- Best Practices - Production deployment tips
- Use Cases - Real-world examples
Ready to process your first document? Continue with the Quick Start tutorial!