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 git+ssh://[email protected]:stainless-sdks/router-typescript.git
Note: Once published to npm, this will become: 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/stainless-sdks/router-typescript

Python

PyPI

Installation

pip install git+ssh://[email protected]/stainless-sdks/router-python.git
Note: Once published to PyPI, this will become: 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/stainless-sdks/router-python

PHP

Installation

composer require casedev/casedev-php:dev-main
Note: Once published to Packagist, this will become: composer require casedev/casedev-php

Quick Start

<?php
require_once 'vendor/autoload.php';

use Casedev\Client;

$client = new Client([
    'api_key' => 'sk_case_...',
    'environment' => 'production'
]);

// Create a vault
$vault = $client->vault->create([
    'name' => 'My Documents',
    'description' => 'Legal document repository'
]);

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

echo $response->choices[0]->message->content;

Features

  • ✅ Modern PHP with type declarations
  • ✅ PSR-4 autoloading
  • ✅ Comprehensive error handling
  • ✅ PHP 8.0+ support

Repository

github.com/stainless-sdks/router-php

C#

NuGet

Installation

dotnet add package CaseDev

Quick Start

using Casedev;

var client = new CasedevClient(
    apiKey: "sk_case_...",
    environment: CasedevEnvironment.Production
);

// Create a vault
var vault = await client.Vault.CreateAsync(new VaultCreateParams
{
    Name = "My Documents",
    Description = "Legal document repository"
});

// Chat with an LLM
var response = await client.Llm.V1.Chat.CreateCompletionAsync(
    new ChatCreateCompletionParams
    {
        Model = "anthropic/claude-3-5-sonnet-20241022",
        Messages = new[]
        {
            new Message { Role = "user", Content = "Summarize this contract..." }
        }
    }
);

Console.WriteLine(response.Choices[0].Message.Content);

Features

  • ✅ Full .NET type safety
  • ✅ Async/await support
  • ✅ .NET Standard 2.0+ compatibility
  • ✅ Works with .NET Framework, .NET Core, and .NET 5+

Repository

github.com/stainless-sdks/router-csharp

Java

Maven Central

Installation

Gradle:
implementation("dev.casedev:casedev-java:0.0.1")
Maven:
<dependency>
  <groupId>dev.casedev</groupId>
  <artifactId>casedev-java</artifactId>
  <version>0.0.1</version>
</dependency>

Quick Start

import dev.casedev.client.CasedevClient;
import dev.casedev.client.okhttp.CasedevOkHttpClient;
import dev.casedev.models.vault.VaultCreateParams;
import dev.casedev.models.llm.v1.chat.ChatCreateCompletionParams;

CasedevClient client = CasedevOkHttpClient.builder()
    .apiKey("sk_case_...")
    .environment(CasedevEnvironment.PRODUCTION)
    .build();

// Create a vault
Vault vault = client.vault().create(
    VaultCreateParams.builder()
        .name("My Documents")
        .description("Legal document repository")
        .build()
);

// Chat with an LLM
ChatCreateCompletionResponse response = client.llm().v1().chat().createCompletion(
    ChatCreateCompletionParams.builder()
        .model("anthropic/claude-3-5-sonnet-20241022")
        .addMessage(Message.builder()
            .role(Message.Role.USER)
            .content("Summarize this contract...")
            .build())
        .build()
);

System.out.println(response.getChoices().get(0).getMessage().getContent());

Features

  • ✅ Full type safety with Java generics
  • ✅ Builder pattern for all requests
  • ✅ OkHttp client for reliable HTTP
  • ✅ Java 8+ support

Repository

github.com/stainless-sdks/router-java

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.

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