Introducing our new Monitoring feature Learn more

Documentation

Generate

Generate text, chat replies, images, brand voices, SEO reports, and content improvements via the Krastie API.

Generate

Base path: /v1/ai/generate

All endpoints require the api-key header. See Authentication.

Generate text

POST /v1/ai/generate/text

curl https://api.krastie.ai/v1/ai/generate/text \
  -H "api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","text":"Write a short product intro."}'
FieldTypeRequiredDescription
modelstringYesModel to use
textstringYesPrompt
useWorkerbooleanNoQueue the job instead of running inline
optionsobjectNoOptions for the worker payload
jobTypestringNoJob name when queuing (default ai_tool_content)

When useWorker is true, the API returns 202:

{ "message": "Content generation queued", "jobId": "123" }

Poll with Async jobs.

Generate chat message

POST /v1/ai/generate/chat

FieldTypeDescription
modelstringModel to use
textstringUser message
sessionIdstringExisting chat session id (when continuing a thread)

Session CRUD lives under Chat.

Assistant workspace context

GET /v1/ai/generate/assistant/context

Returns a summary of workspace context available to the assistant (visibility, traffic, documents, and related signals).

AI traffic stats (generate alias)

GET /v1/ai/generate/ai-traffic

Convenience alias for traffic stats. Prefer the dedicated AI traffic routes for site management.

Generate image

POST /v1/ai/generate/image

FieldTypeDescription
textstringImage prompt
sizestringSize string accepted by the selected model
modelstringdall-e-3 or stability-ultra
curl https://api.krastie.ai/v1/ai/generate/image \
  -H "api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"dall-e-3","text":"Minimal product hero illustration","size":"1024x1024"}'

Brand voice from website

POST /v1/ai/generate/brand-voice/website

FieldTypeDescription
websiteurlstringHTTPS URL to analyze
namestringOptional display name
fetchIntervalstringOptional refresh interval
scopestringteam (default) or personal
{
  "message": "Brand voice created successfully.",
  "data": {
    "id": "...",
    "name": "Brand Voice - 7/9/2026",
    "url": "https://example.com",
    "contentLength": 12000,
    "type": "website"
  }
}

Brand voice from text

POST /v1/ai/generate/brand-voice/text

FieldTypeDescription
contentstringSource text
namestringOptional name
scopestringteam or personal

Brand voice from file URL

POST /v1/ai/generate/brand-voice/file

FieldTypeDescription
filestringURL to a .md, .txt, .html, or .json file
namestringOptional name
scopestringteam or personal

Manage existing voices with Brand voice.

SEO visibility report

Visibility report endpoints are documented on AI visibility:

  • POST /v1/ai/generate/seo-site-report
  • POST /v1/ai/generate/seo-site-report/prefill
  • GET /v1/ai/generate/seo-site-report
  • GET /v1/ai/generate/seo-site-report/history

Calculate SEO score

POST /v1/ai/generate/calculate-seo-score

FieldTypeDescription
contentstringRequired body text
titlestringOptional title
keywordsstring[]Optional keywords
autoExtractKeywordsbooleanExtract keywords when none are provided (default true)

Process blog post with images

POST /v1/ai/generate/process-blog-post-with-images

Processes blog content and associated images through the content pipeline. Send the same payload fields your app uses for blog processing (content, image references, and options).

Improve content

POST /v1/ai/generate/improve-content-with-validation — improve content and return validation/SEO signals.

POST /v1/ai/generate/improve-content-simple

FieldTypeDescription
contentstringOriginal content
improvePromptstringInstructions for the improvement
metricTypestringOptional metric label

Feedback

POST /v1/ai/generate/feedback

Submit feedback on a generation result (used by the product UI; include the identifiers your client already sends).