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

# POST /hash

> Compute cryptographic hash digests (MD5, SHA-1, SHA-256, SHA-512, and more) from any string.

## Endpoint

```
POST https://api.bunny.build/api/v1/hash
```

## Authentication

| Header         | Required | Value                    |
| -------------- | -------- | ------------------------ |
| `X-API-Key`    | Yes      | Your API key (`bun_...`) |
| `Content-Type` | Yes      | `application/json`       |

## Overview

Compute cryptographic hash digests for any input string using one or more algorithms in a single request. The response returns hex-encoded digests keyed by algorithm name, making it easy to compare or store multiple hashes simultaneously without running separate requests.

## Use cases

* Verify file or payload integrity using checksum comparison
* Migrate legacy password hashes during authentication system upgrades
* Generate consistent fingerprints for deduplication pipelines
* Produce content-addressable identifiers for caching layers

## Request body

| Field        | Type             | Required | Description                                                                                                |
| ------------ | ---------------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| `input`      | string           | Yes      | The string to hash                                                                                         |
| `algorithms` | array of strings | No       | Algorithms to compute. Defaults to all. Options: `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha512-256` |

### Example

```json theme={null}
{
  "input": "hello world",
  "algorithms": ["sha256", "md5"]
}
```

## Response

### 200 OK

| Field    | Type   | Description                                 |
| -------- | ------ | ------------------------------------------- |
| `input`  | string | The original input string                   |
| `hashes` | object | Map of algorithm name to hex-encoded digest |

**Example**

```json theme={null}
{
  "input": "hello world",
  "hashes": {
    "sha256": "b94d27b9934d3e08a52e52d7da7dabfac484efe04294e576f01c87a7cbc1ab15",
    "md5": "5eb63bbbe01eeed093cb22bb8f5acdc3"
  }
}
```

### 401 Unauthorized

```json theme={null}
{
  "detail": "Missing API key. Include X-API-Key header."
}
```

### 402 Payment Required

```json theme={null}
{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}
```

### 422 Unprocessable Entity

```json theme={null}
{
  "detail": "Field 'input' is required."
}
```

### 429 Too Many Requests

```json theme={null}
{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}
```

## cURL example

```bash theme={null}
curl -X POST https://api.bunny.build/api/v1/hash \
  -H "X-API-Key: bun_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"input": "hello world", "algorithms": ["sha256", "md5"]}'
```
