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

# How do I generate AI visibility reports through the API?

> Create website audits with a workspace API key or an origin-restricted embed key, then retrieve the resulting report link.

Use the website audit API to accept a domain in your own application and retrieve an AI visibility report. Each audit belongs to the workspace associated with the calling key.

## Create an audit

Send a server-side request with your workspace API key:

```bash theme={null}
curl --request POST 'https://app.chatobserver.com/api/v1/audits' \
  --header "x-api-key: $CHATOBSERVER_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"website":"example.com"}'
```

The JSON body contains only `website`, a non-empty string of up to 2,048 characters. A successful request returns `201` and an audit object containing `id`, `status`, `statusStage`, `progressPercent`, `estimatedReadyAt`, `reportUrl`, and `deduped`.

## Retrieve the report link

Request `GET /api/v1/audits/{id}` using the same workspace credentials. Keep the identifier returned by creation, check the audit status, and open `reportUrl` once it is available. A newly accepted audit can have a null report URL. Use bounded checks rather than repeatedly creating the same audit.

## Embed the request in a website

A publishable audit embed key is restricted to its configured origins. Present it in `x-api-key`; the browser's `Origin` must match an allowed origin. Keep ordinary workspace API keys on your server. They are not publishable embed keys.

The audit endpoints accept `x-api-key` or bearer authentication. Their header contract differs from the `x-chatobserver-key` header used by other visibility endpoints. See [authentication](/docs/developers/authentication).

## Handle errors

Audit errors include `error.code` and `error.message`. Correct invalid websites and origin restrictions before retrying. Creation is limited to 60 requests per key per hour, subject to the service-wide abuse limit. Honour a rate-limit response and stop after a bounded number of retries.
