Suggest prompts
Generates AI Visibility prompt ideas for one URL and brand.
Use this when you want Sleepwalker to propose realistic prompts before creating an AI Visibility run.
Endpoint
Section titled “Endpoint”POST /v1/visibility/prompts/suggestAuthentication
Section titled “Authentication”| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer sw_api_live_... |
Content-Type | Yes | application/json |
Required scope:
visibility:prompts:suggestRequest Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Page URL to analyze. |
brand_name | string | Yes | Brand or entity the prompts should target. |
language | string | No | Language code. Defaults to en. |
country | string | No | Country/market code. Defaults to US. |
Example Request
Section titled “Example Request”curl -s https://api.sleepwalker.ai/v1/visibility/prompts/suggest \ -H "Authorization: Bearer sw_api_live_..." \ -H "Content-Type: application/json" \ -d '{ "url": "https://www.sleepwalker.ai", "brand_name": "Sleepwalker", "language": "en", "country": "US" }'The same request in Python and JavaScript:
import requests
resp = requests.post( "https://api.sleepwalker.ai/v1/visibility/prompts/suggest", headers={"Authorization": "Bearer sw_api_live_..."}, json={ "url": "https://www.sleepwalker.ai", "brand_name": "Sleepwalker", "language": "en", "country": "US", },)resp.raise_for_status()print(resp.json())const resp = await fetch("https://api.sleepwalker.ai/v1/visibility/prompts/suggest", { method: "POST", headers: { Authorization: "Bearer sw_api_live_...", "Content-Type": "application/json", }, body: JSON.stringify({ url: "https://www.sleepwalker.ai", brand_name: "Sleepwalker", language: "en", country: "US", }),});const data = await resp.json();console.log(data);Response
Section titled “Response”{ "prompt_suggestion": { "url": "https://www.sleepwalker.ai", "brand_name": "Sleepwalker", "language": "en", "country": "US", "prompts": [ "What are the best AI visibility tools for SEO teams?", "Which tools track brand mentions in AI search results?" ], "prompt_count": 2, "billing": { "billable": true, "estimated_credits": "1.00" }, "payload_limits": { "max_prompts": 5 } }}- The endpoint returns up to 5 prompts.
- Prompt suggestions are not saved as a run.
- To execute prompts, pass them to Create AI Visibility Run.
Credits
Section titled “Credits”A successful billable prompt suggestion response costs 1 credit.
If prompts cannot be generated because the page is blocked or has insufficient content, the response includes billing.billable: false.
Errors
Section titled “Errors”| Status | Meaning |
|---|---|
400 | Missing URL or brand name. |
401 | Missing or invalid API key. |
402 | Insufficient credits for a billable request. |
403 | API key is missing visibility:prompts:suggest. |