Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.case.dev/llms.txt

Use this file to discover all available pages before exploring further.

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

Shell
npm install casedev

Quick Start

Typescript
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

Shell
pip install casedev

Quick Start

Python
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

Python
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

Go

Installation

Shell
go get -u github.com/CaseMark/casedev-go
Requires Go 1.22+.

Quick Start

Go
package main

import (
	"context"
	"fmt"

	casedev "github.com/CaseMark/casedev-go"
	"github.com/CaseMark/casedev-go/option"
)

func main() {
	client := casedev.NewClient(
		option.WithAPIKey("sk_case_YOUR_API_KEY"),        // or set CASEDEV_API_KEY env var
		option.WithEnvironmentProduction(),                // default
	)

	// Create a vault
	vault, _ := client.Vault.New(context.TODO(), casedev.VaultNewParams{
		Name:        casedev.F("My Documents"),
		Description: casedev.F("Legal document repository"),
	})

	// Chat with an LLM
	resp, _ := client.Llm.V1.Chat.NewCompletion(context.TODO(), casedev.LlmV1ChatNewCompletionParams{
		Model: casedev.F("anthropic/claude-sonnet-4.5"),
		Messages: casedev.F([]casedev.LlmV1ChatNewCompletionParamsMessage{{
			Role:    casedev.F(casedev.LlmV1ChatNewCompletionParamsMessagesRoleUser),
			Content: casedev.F("Summarize this contract..."),
		}}),
	})

	fmt.Println(resp.Choices[0].Message.Content)
}

Features

  • Full type safety with Go generics
  • Automatic retries with exponential backoff (2 retries by default)
  • Configurable via option.With* helpers
  • Environment variable auto-detection (CASEDEV_API_KEY)
  • Raw HTTP response access via option.WithResponseInto

Repository

github.com/CaseMark/casedev-go

Authentication

All SDKs require an API key from the Case.dev dashboard.
Shell
# Set as environment variable
export CASEDEV_API_KEY=sk_case_...
The Go SDK automatically reads the CASEDEV_API_KEY environment variable. No additional configuration is needed. 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:
try {
  await client.vault.retrieve('invalid-id');
} catch (error) {
  if (error instanceof Casedev.NotFoundError) {
    console.log('Vault not found:', error.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

Getting Started

Integration tutorials with step-by-step examples

Services Catalog

Browse all available services

Cookbooks

Reference implementations and architecture patterns