v1

latestOpenAPI 3.0.12026-07-22231676.5 KB
Completion

Completion

Harvey's Completion API provides access to Harvey's models via our orchestration engine, allowing users to ask complex, freeform questions and receive detailed legal-grade responses programmatically. It can also be used in conjunction with files attached to the request, Vaults, and Regional Knowledge Sources.

<Info>Access to this API requires Assistant access via API permission, which is only available in your workspace with an additional purchase. To get started, contact your Account Manager or reach out to us at support@harvey.ai to discuss an agreement.</Info>

post/api/v2/completion

Query parameters

include_citationsboolean

Whether to include citations in the response output. When set to false, citations are skipped and the response is returned more quickly. Defaults to true.

Response

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

responsestring

The completion of the input prompt.

response_with_citationsstring nullable

The completion with inline citations, e.g. [1][2], which correspond to the sources below. Only returned when include_citations=true.

Example response

{
  "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.",
  "response_with_citations": "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.[1] Limitation of liability clauses cap the amount or types of damages one party can recover from the other, often excluding indirect or consequential losses.[2]",
  "sources": [
    {
      "citation_num": 1,
      "document_name": "MyDocument.pdf",
      "page": 2,
      "text": "<mark>Quoted snippet...</mark>"
    }
  ]
}