Skip to content

Chat & Images API

WriteIQ provides synchronous utility endpoints for Chat IQ and Images IQ, allowing you to quickly integrate AI capabilities into your applications without waiting for a background workflow.

POST /v1/chat

A conversational endpoint that provides access to the WriteIQ intelligent assistant, featuring optional live web browsing.

FieldTypeDescription
messagesarrayRequired. An array of message objects, each containing a role (“user”, “assistant”) and content string.
useWebSearchbooleanOptional. If true, the assistant will use live SERP data to inform its response. Defaults to false.
Terminal window
curl -X POST https://api.writeiq.com/v1/chat \
-H "Authorization: Bearer wiq_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "What is the latest Google Core Update?" }
],
"useWebSearch": true
}'
{
"response": "The latest Google Core Update, rolled out in..."
}

POST /v1/images

Generate high-quality hero images or infographics using Cloudflare’s native Stable Diffusion XL binding.

FieldTypeDescription
promptstringRequired. A detailed description of the image you want to generate.
stylestringOptional. The visual style (e.g., “photorealistic”, “illustration”, “3d render”). Defaults to “photorealistic”.
Terminal window
curl -X POST https://api.writeiq.com/v1/images \
-H "Authorization: Bearer wiq_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A modern workspace with a mechanical keyboard and a cup of coffee",
"style": "photorealistic"
}'
{
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}

Note: The url field currently returns a Base64 encoded Data URL string representing the raw image bytes. You can directly embed this into an <img> tag or upload it to your own CDN.