# case.dev API Documentation for AI/LLM Consumption ## Overview case.dev is an API platform for legal tech developers providing document processing, semantic search, 130+ AI models, and workflow automation through one unified API. Base URL: https://api.case.dev Documentation: https://docs.case.dev Console: https://console.case.dev ## Authentication All API requests require an API key in the Authorization header: ``` Authorization: Bearer YOUR_API_KEY ``` Get your API key at: https://console.case.dev --- ## Core Services ### 1. LLMs (AI Models) Access 130+ AI models through OpenAI-compatible API - Endpoint: POST /v1/chat/completions - OpenAI SDK Compatible - Models: GPT-4, GPT-5, Claude, Llama, Gemini, CaseMark Core 1 - Features: Streaming, function calling, vision, JSON mode - Pricing: Pay-per-use with volume discounts Example: ```bash curl https://api.case.dev/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4", "messages": [{"role": "user", "content": "Hello"}] }' ``` ### 2. Vaults (Document Storage + Semantic Search) Encrypted document storage with automatic OCR and semantic search - Create vault: POST /v1/vaults - Upload document: POST /v1/vaults/{id}/documents - Semantic search: POST /v1/vaults/{id}/search - Features: 90% cost savings vs traditional vector DBs, automatic OCR, KMS encryption - Supports: PDF, DOCX, images, up to 500MB Example workflow: ```bash # Create vault curl https://api.case.dev/v1/vaults \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"name": "My Vault"}' # Upload document curl https://api.case.dev/v1/vaults/{vault_id}/documents \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@document.pdf" # Search curl https://api.case.dev/v1/vaults/{vault_id}/search \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"query": "contract terms"}' ``` ### 3. OCR (Optical Character Recognition) Production-grade OCR for legal documents up to 500MB - Endpoint: POST /v1/ocr - Features: Table extraction, searchable PDFs, high accuracy - Supports: PDF, images (JPG, PNG, TIFF) - Output: Text, searchable PDF, structured data Example: ```bash curl https://api.case.dev/v1/ocr \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@document.pdf" \ -F "output_format=searchable_pdf" ``` ### 4. Voice Transcription High-accuracy speech-to-text - Endpoint: POST /v1/audio/transcriptions - Features: Speaker diarization, PII redaction, 100+ languages - Formats: MP3, M4A, WAV, WebM - Use cases: Depositions, court recordings, meetings Example: ```bash curl https://api.case.dev/v1/audio/transcriptions \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@audio.mp3" \ -F "model=whisper-1" ``` ### 5. Workflows 700+ expert-crafted legal workflows - List workflows: GET /v1/workflows - Execute workflow: POST /v1/workflows/{id}/execute - Categories: Document generation, analysis, summarization - Server-side prompts protect your IP Example: ```bash curl https://api.case.dev/v1/workflows/{workflow_id}/execute \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"input": "Your document text"}' ``` ### 6. Actions (Workflow Automation) Build automation pipelines with declarative JSON - Create action: POST /v1/actions - Execute: POST /v1/actions/{id}/execute - Features: Chain OCR, AI, storage with automatic retries - Webhook notifications on completion Example action: ```json { "name": "Process Legal Document", "steps": [ {"type": "ocr", "input": "document"}, {"type": "llm", "model": "gpt-4", "prompt": "Summarize"}, {"type": "vault", "operation": "store"} ] } ``` ### 7. GraphRAG (Coming Soon) Graph-based knowledge retrieval - Endpoint: POST /v1/vaults/{id}/graphrag/search - Discover entity relationships and insights - Natural language queries ### 8. FTR Convert Convert For The Record (FTR) court recordings to M4A - Endpoint: POST /v1/convert/ftr - Output: Standard M4A format for transcription ### 9. Email Send and receive emails with parsing - Send: POST /v1/email/send - Receive: Webhook configuration - Features: Attachment handling, template support --- ## Common Integration Patterns ### Pattern 1: Document Processing Pipeline 1. Upload document to Vault (automatic OCR) 2. Search vault for relevant information 3. Use LLM to analyze results 4. Store analysis back in vault ### Pattern 2: Voice to Insight 1. Transcribe audio file 2. Store transcript in vault 3. Use workflow to analyze transcript 4. Generate structured output ### Pattern 3: Automated Document Analysis 1. Create Action with steps: OCR → LLM → Store 2. Trigger via API or webhook 3. Receive notification on completion 4. Retrieve results --- ## SDKs and Tools ### OpenAI SDK Compatible Use OpenAI's official SDKs by changing the base URL: ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.case.dev/v1" ) ``` ### Model Context Protocol (MCP) Connect via MCP for development tools: ``` npx @case/mcp ``` --- ## Key Features 1. **Developer-First**: Modern REST API, OpenAI compatibility, comprehensive docs 2. **90% Cost Savings**: Proprietary vector storage technology 3. **Enterprise Security**: KMS encryption, audit logs, RBAC, automatic PII redaction 4. **Legal-Specific**: 700+ legal workflows, legal-optimized embeddings 5. **Durable Workflows**: Automatic retries, webhook notifications, resumable execution 6. **Complete Platform**: One API for everything (no vendor stitching) --- ## Rate Limits - Standard: 100 requests/minute - Pro: 1000 requests/minute - Enterprise: Custom limits Contact sales@case.dev for enterprise plans. --- ## Error Handling All errors return JSON with: ```json { "error": { "message": "Error description", "type": "invalid_request_error", "code": "invalid_api_key" } } ``` Common HTTP status codes: - 200: Success - 400: Bad Request - 401: Unauthorized (invalid API key) - 429: Rate limit exceeded - 500: Server error --- ## Support - Documentation: https://docs.case.dev - Email: support@case.dev - Console: https://console.case.dev --- ## Getting Started 1. Sign up at https://console.case.dev 2. Get your API key 3. Make your first request 4. Explore workflows and build For detailed examples and guides, visit: https://docs.case.dev