Skip to main content
POST
/
api
/
v2
/
completion
Completion
curl --request POST \
  --url https://api.harvey.ai/api/v2/completion \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'prompt=In 3 sentences, can you explain how indemnity and limitation of liability clauses typically work in commercial contracts?' \
  --form stream=false \
  --form mode=draft
{
  "response": "Indemnity clauses in commercial contracts require one party to compensate the other for certain losses or damages arising from specified events, such as breaches or third-party claims. Limitation of liability clauses cap the amount or types of damages one party can recover from the other, often excluding indirect or consequential losses. Together, these clauses allocate and manage risk between the parties, providing predictability and protecting against potentially catastrophic financial exposure."
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
prompt
string
default:In 3 sentences, can you explain how indemnity and limitation of liability clauses typically work in commercial contracts?
required

A string question that you want to ask Harvey. The prompt may be up to 20,000 characters.

Maximum length: 20000
Example:

"In 3 sentences, can you explain how indemnity and limitation of liability clauses typically work in commercial contracts?"

stream
boolean
default:false

A boolean value that lets you either stream or receive the entire output at once.

file
file[]

Paths of files you want to upload to provide additional context for the prompt.

mode
enum<string>

Optional mode to specify the behavior of the completion.

Available options:
draft,
assist
Example:

"draft"

Response

The response object includes the response field which is the completion of the input prompt sent to the model.

response
string

The completion of the input prompt.

Example:

"Indemnity clauses in commercial contracts require one party to compensate the other for certain losses or damages arising from specified events, such as breaches or third-party claims. Limitation of liability clauses cap the amount or types of damages one party can recover from the other, often excluding indirect or consequential losses. Together, these clauses allocate and manage risk between the parties, providing predictability and protecting against potentially catastrophic financial exposure."