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.
curl -X POST https://api.case.dev/llm/v1/chat/completions \ -H "Authorization: Bearer $CASEDEV_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-4.5", "messages": [ {"role": "system", "content": "You are a legal assistant. Extract the Plaintiff and Defendant."}, {"role": "user", "content": "Smith v. Jones Construction..."} ] }'
casedev llm:v1:chat create-completion \ --model anthropic/claude-sonnet-4.5 \ --message '{role: system, content: "You are a legal assistant. Extract the Plaintiff and Defendant from the text."}' \ --message '{role: user, content: "Smith v. Jones Construction, filed in the Superior Court of California..."}'
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"
response = client.llm.v1.chat.create_completion( 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...' } ])print(response.choices[0].message.content)# Output: "Plaintiff: John Smith\nDefendant: Jones Construction"
resp, _ := client.Llm.V1.Chat.NewCompletion(ctx, casedev.LlmV1ChatNewCompletionParams{ Model: casedev.F("anthropic/claude-sonnet-4.5"), Messages: casedev.F([]casedev.LlmV1ChatNewCompletionParamsMessage{ { Role: casedev.F(casedev.LlmV1ChatNewCompletionParamsMessagesRoleSystem), Content: casedev.F("You are a legal assistant. Extract the Plaintiff and Defendant from the text."), }, { Role: casedev.F(casedev.LlmV1ChatNewCompletionParamsMessagesRoleUser), Content: casedev.F("Smith v. Jones Construction, filed in the Superior Court of California. John Smith alleges negligence regarding..."), }, }),})fmt.Println(resp.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:
Shell
Authorization: Bearer sk_case_YOUR_API_KEY
Keep your API key secret. Don’t commit it to version control. Use environment variables.