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:
  • TypeScript / JavaScript - For Node.js, Deno, Bun, and browsers
  • Python - Synchronous and async support
  • C# / .NET - .NET Standard 2.0+ support
  • Java - Java 8+ with sync and async clients
  • PHP - PHP 8.1+ with PSR-18 support
  • Go - Full type-safe Go SDK
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

C#

NuGet

Installation

dotnet add package Casedev
Requires .NET Standard 2.0 or later.

Quick Start

using System;
using Casedev;
using Casedev.Models.Llm.V1.Chat;

// Configured using the CASEDEV_API_KEY environment variable
CasedevClient client = new();

ChatCreateCompletionParams parameters = new()
{
    Messages =
    [
        new()
        {
            Role = Role.User,
            Content = "Summarize this contract...",
        },
    ],
};

var response = await client.Llm.V1.Chat.CreateCompletion(parameters);
Console.WriteLine(response);

Features

  • .NET Standard 2.0+ and .NET 8+ support
  • Async/await throughout
  • Automatic retries with exponential backoff
  • Raw HTTP response access via WithRawResponse
  • Configuration via environment variables or fluent API

Repository

github.com/CaseMark/casedev-csharp

Java

Maven Central

Installation

implementation("dev.case.api:casedev-java:0.2.1")
Requires Java 8 or later.

Quick Start

import dev.case.api.client.CasedevClient;
import dev.case.api.client.okhttp.CasedevOkHttpClient;
import dev.case.api.models.llm.v1.chat.ChatCreateCompletionParams;
import dev.case.api.models.llm.v1.chat.ChatCreateCompletionResponse;

// Configures using the CASEDEV_API_KEY environment variable
CasedevClient client = CasedevOkHttpClient.fromEnv();

ChatCreateCompletionParams params = ChatCreateCompletionParams.builder()
    .addMessage(ChatCreateCompletionParams.Message.builder()
        .role(ChatCreateCompletionParams.Message.Role.USER)
        .content("Summarize this contract...")
        .build())
    .build();

ChatCreateCompletionResponse response = client.llm().v1().chat().createCompletion(params);

Features

  • Java 8+ support
  • Synchronous and asynchronous clients (via .async())
  • Immutable request/response objects with builders
  • Automatic retries with exponential backoff
  • Configurable via environment variables or builder API

Repository

github.com/CaseMark/casedev-java

PHP

Packagist

Installation

composer require casemark/casedev
Requires PHP 8.1 or later.

Quick Start

<?php

use CaseDev\Client;

$client = new Client(
    apiKey: getenv('CASEDEV_API_KEY') ?: 'My API Key',
    environment: 'production'
);

$response = $client->llm->v1->chat->createCompletion(
    messages: [['role' => 'user', 'content' => 'Summarize this contract...']]
);

var_dump($response->id);

Features

  • PHP 8.1+ with named parameters
  • PSR-18 HTTP client support
  • Automatic retries with exponential backoff
  • Typed error classes for all API error codes
  • Value objects with static ::with() constructors

Repository

github.com/CaseMark/casedev-php

Go

Installation

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

Quick Start

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.
# 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