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"
Get your API key from the Console. You get 10freeusage∗∗everymonth,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.