LLMs

Chat completions

Changed on

Create a completion for the provided prompt and parameters. Compatible with OpenAI's chat completions API. Supports 40+ models including GPT-4, Claude, Gemini, and CaseMark legal AI models. Includes streaming support, token counting, and usage tracking.

post/llm/v1/chat/completions

Request

  • Base URL
    https://api.case.dev
  • URL
    https://api.case.dev/llm/v1/chat/completions
  • Auth
    HTTP bearer

Headers

ai-reporting-userstring

Stable internal user or customer identifier for AI Gateway cost reporting.

ai-reporting-tagsstring

Comma-separated AI Gateway reporting tags. At most 10 unique tags, each 1–64 characters.

Request body

modelstring

Model to use for completion. Defaults to casemark/core-large if not specified

max_tokensinteger

Maximum number of tokens to generate

temperaturenumber

Sampling temperature between 0 and 2

streamboolean

Whether to stream back partial progress

casemark_show_reasoningboolean

CaseMark-only: controls whether reasoning fields appear in responses. Defaults to false (suppressed) for most CaseMark models; defaults to true for casemark/core-potassium.

top_pnumber

Nucleus sampling parameter

frequency_penaltynumber

Frequency penalty parameter

presence_penaltynumber

Presence penalty parameter

Example request

{
  "model": "casemark/core-large",
  "max_tokens": 1000,
  "temperature": 0.7
}

Response

Successful completion response

idstring

Unique identifier for the completion

objectstring
createdinteger

Unix timestamp of completion creation

modelstring

Model used for completion

Example response

{
  "object": "chat.completion"
}

Changes

    • info

      added the new optional header request parameter ai-reporting-tags

    • info

      added the new optional header request parameter ai-reporting-user