Skip to main content
Official client libraries for integrating Case.dev into your application, generated with Stainless.

Available SDKs

We provide official SDKs for the following languages: All SDKs are type-safe, well-documented, and maintained automatically from our OpenAPI specification.

TypeScript

npm

Installation

npm install casedev

Quick Start

import Casedev from 'casedev';

const client = new Casedev({
  apiKey: process.env.CASEDEV_API_KEY,
  environment: 'production' // or 'local' for development
});

// Create a vault
const vault = await client.vault.create({
  name: 'My Documents',
  description: 'Legal document repository'
});

// Chat with an LLM
const response = await client.llm.v1.chat.createCompletion({
  model: 'anthropic/claude-3-5-sonnet-20241022',
  messages: [
    { role: 'user', content: 'Summarize this contract...' }
  ]
});

Features

  • ✅ Full TypeScript support with type inference
  • ✅ Promise-based async API
  • ✅ Automatic retries with exponential backoff
  • ✅ Streaming support for real-time responses
  • ✅ Works in Node.js, Deno, Bun, and browsers

Repository

github.com/CaseMark/casedev-typescript

Python

PyPI

Installation

pip install casedev

Quick Start

from casedev import Casedev

client = Casedev(
    api_key="sk_case_...",
    environment="production"  # or "local"
)

# Create a vault
vault = client.vault.create(
    name="My Documents",
    description="Legal document repository"
)

# Chat with an LLM
response = client.llm.v1.chat.create_completion(
    model="anthropic/claude-3-5-sonnet-20241022",
    messages=[
        {"role": "user", "content": "Summarize this contract..."}
    ]
)

print(response.choices[0].message.content)

Async Support

from casedev import AsyncCasedev
import asyncio

async def main():
    async with AsyncCasedev(api_key="sk_case_...") as client:
        response = await client.llm.v1.chat.create_completion(
            messages=[{"role": "user", "content": "Hello!"}]
        )
        print(response.choices[0].message.content)

asyncio.run(main())

Features

  • ✅ Full type hints with modern Python
  • ✅ Synchronous and asynchronous clients
  • ✅ aiohttp support for better async performance
  • ✅ Automatic retries and error handling
  • ✅ Python 3.9+ support

Repository

github.com/CaseMark/casedev-python

Authentication

All SDKs require an API key from the Case.dev dashboard.
# Set as environment variable
export CASEDEV_API_KEY=sk_case_...
API keys starting with sk_case_ are production keys. Development keys are available for testing.

Scoped Permissions

API keys can be scoped to specific services with read or write access. If your key lacks permission for a service, you’ll receive a 403 Forbidden error. Check your key’s permissions in the dashboard.

Error Handling

All SDKs provide typed error classes for handling API errors: TypeScript:
try {
  await client.vault.retrieve('invalid-id');
} catch (error) {
  if (error instanceof Casedev.NotFoundError) {
    console.log('Vault not found:', error.status);
  }
}
Python:
from casedev import NotFoundError

try:
    client.vault.retrieve('invalid-id')
except NotFoundError as e:
    print(f'Vault not found: {e.status}')

Rate Limits

All API requests are subject to rate limits based on your plan. SDKs automatically handle rate limit responses with exponential backoff retries.

Support

Open Source

All SDKs are open source under the Apache 2.0 license. Contributions are welcome!

Next Steps