---
name: ai-image-check
description: Check whether an image or photo is AI-generated with the Ringing Bytes API. Use when the user asks if a picture looks AI-made, generated or edited, or wants to screen image files or URLs for signs of AI generation. Covers getting an API key with the user's approval, sending the image, reading the verdict, and handling 401, 402, 403 and 429 responses.
---

# Check images for AI generation with Ringing Bytes

API: https://api.ringingbytes.com. Every request needs an API key in `Authorization: Bearer <key>`.

A result is a signal for a person to review, never proof. Report the verdict and its confidence; never call an image or the person who sent it "fake" or "fraud".

## 1. Get a key

If `RINGING_BYTES_API_KEY` is set, use it and skip to step 2.

Otherwise ask the user for access. Start a device authorization (no key needed):

```sh
curl -s -X POST https://api.ringingbytes.com/v1/agent/device/code \
  -H "Content-Type: application/json" \
  -d '{"client_name": "My coding agent", "requested_scopes": ["checks:create", "account:read"]}'
```

Set `client_name` to a short plain name the user will recognise (no links or email addresses). Show the user `verification_uri_complete` and `user_code`. Tell them to sign in, check that the page shows the same code, and approve. Keep `device_code` to yourself.

Poll every `interval` seconds (5) until you get the key:

```sh
curl -s -X POST https://api.ringingbytes.com/v1/agent/device/token \
  -H "Content-Type: application/json" \
  -d '{"device_code": "<device_code>"}'
```

- HTTP 400 `authorization_pending`: keep polling. `slow_down`: wait 5 seconds longer each time.
- `access_denied`: the user said no; stop. `expired_token`: start again (codes last 15 minutes).
- HTTP 200: `api_key` is the key, shown once. Ask the user to store it as `RINGING_BYTES_API_KEY`. Never print it again, write it into code, or commit it.

The user chooses the key's permissions and a monthly spending cap. You can't change either.

## 2. Check an image

By URL (the image must be publicly reachable):

```sh
curl -s -X POST https://api.ringingbytes.com/v1/detect \
  -H "Authorization: Bearer $RINGING_BYTES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/photo.jpg"}'
```

A local file, as multipart form data:

```sh
curl -s -X POST https://api.ringingbytes.com/v1/detect \
  -H "Authorization: Bearer $RINGING_BYTES_API_KEY" \
  -F file=@photo.jpg
```

JPEG, PNG, WebP, GIF, TIFF, BMP, AVIF and MPO, up to 25 MB. HEIC is not supported. One image per request. Each check uses one of the organization's image checks.

## 3. Read the result

- `verdict`: `likely_ai` ("Likely AI"), `uncertain` ("Uncertain") or `likely_human` ("No AI signs found": not proof the image is authentic).
- `confidence`: `low`, `medium` or `high`. Always give it with the verdict.
- `signals`: each detector's finding, with a readable `detail`. Use them to explain the verdict.
- `score`: 0 to 1, for sorting only. Don't present it as a percentage or probability.
- `status: "failed"` with an `error`: the image couldn't be checked, and nothing was charged.

## 4. Handle errors

Errors are JSON: `{ "code", "status", "message", "data" }`.

- 401: the key is missing, wrong or revoked. Go back to step 1.
- 402 `PAYMENT_REQUIRED`: read `data.reason` and follow `data.next`. For `free_checks_exhausted`, a key with `billing:checkout` can `POST https://api.ringingbytes.com/v1/billing/checkout` with `{"plan": "<id from data.next.plans>"}` and give the returned `url` to the user: only a person can pay. For `payment_failed`, `key_cap_reached` or `org_cap_reached`, tell the user what `data.next.description` says. Don't retry in a loop.
- 403 `INSUFFICIENT_SCOPE`: the key lacks a permission (`data.required_scopes`). Ask an owner or admin to change it in the dashboard (https://app.ringingbytes.com/api-keys).
- 429: too many requests. Wait for the `Retry-After` header's seconds, then retry.

## More

- Plan, image checks left, caps and spending: `GET https://api.ringingbytes.com/v1/account` (needs `account:read`).
- Prices: https://api.ringingbytes.com/pricing.md. Don't quote prices from memory.
- MCP server with the same key: https://api.ringingbytes.com/mcp (tools take an image URL, not a local file).
- Full guide: https://ringingbytes.com/docs/agents
