> ## Documentation Index
> Fetch the complete documentation index at: https://developers.harvey.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Assistant

> Transform legal workflows with powerful AI-powered reasoning

Harvey's Assistant API enables powerful legal reasoning over your documents and data. With a single endpoint, you can embed natural language queries, document analysis, and grounded legal insights directly into your applications and workflows.

<Note>
  The current API request rate limit for Assistant API endpoint is **20 requests per minute**.
</Note>

```bash theme={null}
POST /api/v2/completion
```

## Overview

The Assistant API provides AI-powered responses to complex legal questions, document analysis, and specialized tasks. Use it to build intelligent legal applications that deliver accurate, context-aware results to your users.

### Key Capabilities

* **Natural Language Processing**: Process complex legal queries with nuanced understanding
* **Document Analysis**: Extract insights from contracts and legal documents
* **Knowledge Grounding**: Upload relevant documents to provide context
* **Content Generation**: Create professional drafts for emails and responses

## Use Cases

### Use Case 1: Internal Knowledge Chatbot

**Challenge**: Attorneys often need quick access to firm policies, past contract negotiations, case law, or regulatory updates. Searching through internal databases or asking colleagues takes time and disrupts workflows. By integrating Harvey’s AI into internal chatbots, firms empower attorneys to instantly retrieve relevant legal insights, improving efficiency without sacrificing accuracy.

**Solution**: Integrate the Assistant API into a secure internal chatbot to return policy guidance, research, and previous work product on demand.

```json theme={null}
{
  "prompt": "Summarize our indemnity position in past vendor contracts.",
  "stream": false
}
```

### Use Case 2: Self-Serve Legal Guidance

**Challenge**: Business teams frequently need input on policies, contracts, compliance, and other complex topics. Waiting for expert review slows down workflows and creates bottlenecks.

**Solution**: Embed the Assistant API in internal tools to offer reliable, policy-grounded answers instantly.

```json theme={null}
{
  "prompt": "Can I sign this NDA or does it need legal review?",
  "stream": false
}
```

### Use Case 3: Drafting Responses to Legal Inquiries

**Challenge**: Drafting accurate and professional responses for routine legal questions is repetitive and time-consuming.

**Solution**: Use the Assistant API to generate draft replies to client or internal questions directly within email tools.

```json theme={null}
{
  "prompt": "Draft a response to this client email about contract renewal timing: 'Hi, our agreement is coming up for renewal next month. Can you please advise on our options and the timeline we should follow?'",
  "mode": "draft",
  "stream": false
}
```

### Use Case 4: Document Ingestion in ETL Pipelines

**Challenge**: Manually ingesting and analyzing documents from diverse sources slows down workflows.

**Solution**: Automate document classification and summarization as part of backend ingestion systems.

```json theme={null}
{
  "prompt": "Extract key clauses and obligations from the attached contract.",
  "stream": false
}
```

### Use Case 5: AI-Powered Document Review in Third-Party Platforms

**Challenge**: Assessing vendor documents for compliance with regulations or internal policies is repetitive and resource-intensive.

**Solution**: Integrate Harvey with vendor management tools to automatically review documents against internal playbooks.

```json theme={null}
{
  "prompt": "Does this MSA comply with our internal data security standards?",
  "stream": false
}
```

## Best Practices

### Optimize Prompts

* **Avoid**: "Review this contract"
* **Use**: "Identify and summarize indemnity clauses in this vendor MSA and flag any deviations from our standard policy."

### Stay Within Prompt Limits

If you're uploading a file, limit the prompt to 4,000 characters. Without a file, prompts can be up to 20,000 characters.

### Stream vs. Non-Stream

Set `stream: true` if you want to receive partial results as they are generated. Default is `false`.

### Model selection

You can pass an optional **model** form parameter to choose which model handles the request. Omit the parameter to use your workspace's default model.

**Supported model slugs:** `gpt-5`, `gpt-5-1`, `gpt-5-2`, `gpt-5-4`, `gpt-5-4-mini`, `gpt-5-5`, `gpt-4-1`, `claude-opus-4-5`, `claude-sonnet-4-5`, `claude-opus-4-6`, `claude-opus-4-7`.

## Error Handling

The Assistant API uses standard HTTP status codes. Always check and handle error responses appropriately.

| Status Code | Description                             | Example Error Message                       |
| ----------- | --------------------------------------- | ------------------------------------------- |
| 200         | Success                                 | N/A                                         |
| 400         | Bad Request – Invalid parameters        | `{ "error": "Missing prompt parameter" }`   |
| 401         | Unauthorized – Invalid API key          | `{ "error": "Invalid API key provided" }`   |
| 429         | Too Many Requests – Rate limit exceeded | `{ "error": "Rate limit exceeded" }`        |
| 500         | Internal Server Error                   | `{ "error": "An internal error occurred" }` |

***

Need help getting started? Contact your Harvey Customer Success Manager for more information.
