POST
/
api
/
v2
/
completion
Completion with Vault RAG
curl --request POST \
  --url https://api.harvey.ai/api/v2/completion \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'prompt=Summarize these documents.' \
  --form stream=false \
  --form 'file=[
  null
]' \
  --form mode=draft \
  --form 'knowledge_sources=[{"type":"vault","folder_id":"01952015-8033-7abb-8222-b93fd355136e","file_ids":["01952015-93c8-7924-a968-dbb9dc1ea54f"]}]'
{
  "response": "Summary of the Book:\\n\\\"The Cat in the Hat\\\" is a whimsical children's story about a mischievous cat who brings chaos and fun to two children, Sally and her brother, on a rainy day while their mother is away. The narrative is written in rhyming verse and is accompanied by illustrations.",
  "response_with_citations": "Summary of the Book:\\n\\\"The Cat in the Hat\\\" is a whimsical children's story about a mischievous cat who brings chaos and fun to two children, Sally and her brother, on a rainy day while their mother is away.[5] The narrative is written in rhyming verse and is accompanied by illustrations.",
  "sources": {
    "citation_num": 5,
    "document_name": "UNKNOWN_1eac8861-ba7e-4e65-bb65-13c9f003a0cf.pdf",
    "page": 60,
    "text": "Well... What would you do If your mother asked you? 61 <mark>The Beginner Book Story 'Ten years ago, Dr. Seuss took 220 words, rhymed them, and turned out THE CAT IN THE HAT, a little volume of absurdity that worked like a karate chop on the weary little world of Dick, Jane and Spot.\"</mark> —Ellen Goodman, THE DETROIT FREE Press, Nov. 1966 From this magically right beginning came the concept of Beginner Books, exacting blends of words and pic- tures that encourage children to read — all by themselves. Hailed by elementary educators and remedial reading specialists, these enor- mously popular books are now used in schools and libraries throughout 4 the English-speaking world."
  }
}

Authorizations

Authorization
string
header
required

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

Body

multipart/form-data

Response

200
application/json

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

The response is of type object.