Skip to main content

Install the SDK

npm install casedev

Initialize the client

import Casedev from 'casedev';

const client = new Casedev({
  apiKey: process.env.CASEDEV_API_KEY
});

Your first API call

Let’s build a simple legal extraction feature—pulling parties from a case description.
195+ Models Available: Browse all available models with pricing and capabilities at case.dev/models.
const response = await client.llm.v1.chat.createCompletion({
  model: 'anthropic/claude-sonnet-4.5',
  messages: [
    {
      role: 'system',
      content: 'You are a legal assistant. Extract the Plaintiff and Defendant from the text.'
    },
    {
      role: 'user',
      content: 'Smith v. Jones Construction, filed in the Superior Court of California. John Smith alleges negligence regarding...'
    }
  ]
});

console.log(response.choices[0].message.content);
// Output: "Plaintiff: John Smith\nDefendant: Jones Construction"

What’s next?

Document Search

Build semantic search across thousands of documents for your users

OCR Integration

Add document digitization to extract text from scanned PDFs

Audio Transcription

Enable your users to convert audio recordings to searchable text

Authentication

Get your API key from the Console. You get 10freeusageeverymonth,or10 free usage** every month, or **30/month when you add a payment method. All requests require your API key in the Authorization header:
Authorization: Bearer sk_case_YOUR_API_KEY
Keep your API key secret. Don’t commit it to version control. Use environment variables.