# DetectorProof API

Humanize AI text from your own app.

Docs: https://detectorproof.com/api

## Quickstart

Make a key in your dashboard (https://detectorproof.com/dashboard/api), then send your text. Keep the key on your server as `DETECTORPROOF_API_KEY`.

`POST /api/v1/humanize`: Humanize a text

```bash
curl https://detectorproof.com/api/v1/humanize \
  -H "Authorization: Bearer $DETECTORPROOF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Your text"}'
```

`GET /api/v1/usage`: Your balance

```bash
curl https://detectorproof.com/api/v1/usage \
  -H "Authorization: Bearer $DETECTORPROOF_API_KEY"
```

`GET /api/v1/models`: The models

```bash
curl https://detectorproof.com/api/v1/models \
  -H "Authorization: Bearer $DETECTORPROOF_API_KEY"
```

`GET /api/v1/status`: Online or not

```bash
curl https://detectorproof.com/api/v1/status
```

## Humanize a text

Send 30 to 3,000 words. The human version comes back in the same request.

```json
{
  "text": "The human version of your text",
  "model": "dp-v1.14",
  "words": 250,
  "cost": 0.0375,
  "balance": 4.2125,
  "currency": "gbp"
}
```

## Usage

Your balance, and how much a request can take.

```json
{
  "balance": 4.2125,
  "currency": "gbp",
  "words_per_request": 3000,
  "requests_per_minute": 10
}
```

## Errors

Every refusal has a code: `{"error":{"code":"too_short","message":"Add at least 30 words"}}`

- `400 no_text`: There's no "text" in the JSON
- `400 too_short`: The text is under 30 words
- `400 not_english`: The text isn't in English
- `400 too_long`: The text is over 3,000 words
- `400 unknown_model`: The model isn't one the API runs
- `401 invalid_key`: The key is missing, wrong or deleted
- `402 no_credit`: The text costs more than your account's API credit
- `409 busy`: The key already has a text going
- `413 too_large`: The request is over 64 KB
- `429 rate_limited`: More requests this minute than the key allows
- `502 failed`: Humanizing didn't finish
- `503 offline`: The humanizer is offline
- `503 overloaded`: Every place on the GPU is taken

A text over 500 words starts its answer straight away, so an error during it comes with status 200: check every answer for `error`.

## Pricing

Pay only for the words you send: £0.15, $0.20, €0.18, CA$0.28, A$0.30 per 1,000 words. The smallest top-up is £5, $7, €6, CA$10, A$10. Bigger ones cost less: 10% off from 50, 20% off from 100, 30% off from 250 in your currency. Credit never runs out.