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

# AI visibility endpoints

> Run visibility reports, track competitors, and fetch historical AI search performance data.

Base path: `/v1/ai/generate`

AI visibility endpoints measure how your website and competitors appear across AI models. These are the primary API routes for integrating Krastie into analytics dashboards, agency workflows, or custom reporting tools.

<Note>
  Each report refresh counts toward your plan's AI refresh usage usage. See the [pricing page](https://www.krastie.ai/pricing) for refresh limits on your plan.
</Note>

## POST `/seo-site-report`

Start a new visibility report or refresh an existing one.

**Body:**

| Field | Type | Required | Description |
| - | - | - | - |
| `websiteurl` | string | Yes\* | Site to analyze (\*required for new reports) |
| `competitors` | string\[] | No | Competitor domains for comparison |
| `prompts` | string\[] | No | Natural-language queries to test |
| `refresh` | boolean | No | Set `true` to refresh the latest report |

**New report example:**

```bash theme={null}
curl -X POST https://api.krastie.ai/v1/ai/generate/seo-site-report \
  -H "Content-Type: application/json" \
  -H "api-key: krastie_YOUR_KEY" \
  -d '{
    "websiteurl": "https://example.com",
    "competitors": ["https://competitor-a.com", "https://competitor-b.com"],
    "prompts": [
      "best AI visibility tools",
      "how to get mentioned in ChatGPT"
    ]
  }'
```

**Refresh example:**

```bash theme={null}
curl -X POST https://api.krastie.ai/v1/ai/generate/seo-site-report \
  -H "Content-Type: application/json" \
  -H "api-key: krastie_YOUR_KEY" \
  -d '{"refresh": true}'
```

**Response:** Report object with visibility scores, per-prompt results, competitor comparisons, and recommendations.

## POST `/seo-site-report/prefill`

Suggest competitors and prompts before running a full report.

**Body:**

| Field | Type | Required | Description |
| - | - | - | - |
| `websiteurl` | string | Yes | Site to analyze |

```bash theme={null}
curl -X POST https://api.krastie.ai/v1/ai/generate/seo-site-report/prefill \
  -H "Content-Type: application/json" \
  -H "api-key: krastie_YOUR_KEY" \
  -d '{"websiteurl": "https://example.com"}'
```

Use the returned suggestions to populate a full report request.

## GET `/seo-site-report`

Fetch the latest visibility report for the authenticated workspace.

```bash theme={null}
curl https://api.krastie.ai/v1/ai/generate/seo-site-report \
  -H "api-key: krastie_YOUR_KEY"
```

## GET `/seo-site-report/history`

Retrieve historical visibility data to track mention rates, citation rates, and competitor positioning over time.

```bash theme={null}
curl https://api.krastie.ai/v1/ai/generate/seo-site-report/history \
  -H "api-key: krastie_YOUR_KEY"
```

## GET `/assistant/context`

Returns workspace summary data available to the assistant, including visibility metrics, traffic, and documents.

```bash theme={null}
curl https://api.krastie.ai/v1/ai/generate/assistant/context \
  -H "api-key: krastie_YOUR_KEY"
```

Use this endpoint to verify what visibility data is available before calling chat with `useWorkspaceContext: true`.

## Report data model

Reports typically include:

| Field | Description |
| - | - |
| Visibility score | Aggregate performance across prompts and models |
| Prompt results | Per-query mention and citation status |
| Competitor metrics | Side-by-side comparison data |
| Model breakdown | Results segmented by AI provider |
| Recommendations | Prioritized actions with difficulty ratings |

Exact field names may vary by API version. Treat responses as the source of truth for your integration.

## Workflow example

```bash theme={null}
# 1. Prefill competitors and prompts
curl -X POST https://api.krastie.ai/v1/ai/generate/seo-site-report/prefill \
  -H "Content-Type: application/json" \
  -H "api-key: krastie_YOUR_KEY" \
  -d '{"websiteurl": "https://example.com"}'

# 2. Run the full report
curl -X POST https://api.krastie.ai/v1/ai/generate/seo-site-report \
  -H "Content-Type: application/json" \
  -H "api-key: krastie_YOUR_KEY" \
  -d '{
    "websiteurl": "https://example.com",
    "competitors": ["https://competitor.com"],
    "prompts": ["best tools for AI search visibility"]
  }'

# 3. Poll history after implementing recommendations
curl https://api.krastie.ai/v1/ai/generate/seo-site-report/history \
  -H "api-key: krastie_YOUR_KEY"
```

## Related endpoints

Content tools that support visibility improvements are documented separately:

* [AI generation endpoints](/api-reference/ai-generation) — Content generation, SEO scoring, and improvement
* [Chat sessions](/api-reference/chat-sessions) — Assistant with workspace visibility context


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.