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

Authentication

Get your API key from the Console. You get 10freecrediteverymonth,or10 free credit** every month, or **30 free credit 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.