Use this file to discover all available pages before exploring further.
The Hog’s generate endpoint lets you produce text, structured data, images, and social content using AI models grounded in your GTM context. There are three main modes: prompt mode for general text or image generation, AI mode for multi-provider structured output, and social/context mode for generating replies and quotes tied to specific social posts or signals. Short text responses are synchronous; long-form generation and images have their own delivery paths.
Pass your X-Project-Id header (or include projectId in the request body) on every generate call. When a project is set, The Hog automatically applies your brand voice, messaging guidelines, and competitive context to every piece of generated content — no extra prompting required.
Use prompt + length to generate free-form text. Short content is returned synchronously (HTTP 200); long content is queued and returned as an async operation (HTTP 202).
POST https://api.thehog.ai/api/generate
Field
Type
Values
Description
prompt
string
—
Your instruction or content brief
length
string
"short" / "long"
"short" → sync 200, "long" → async 202
output
string
"text" (default) / "image"
Use "image" for base64 image output
projectId
string
—
Project context for brand-aligned generation
curl -X POST https://api.thehog.ai/api/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -H "X-Project-Id: proj_abc123" \ -d '{ "prompt": "Write a two-sentence cold email subject line and opening for a VP of Sales at a Series B SaaS company that just raised funding.", "length": "short" }'
{ "data": { "content": "Subject: Congrats on the Series B — quick question\n\nHi Jordan, saw the news about your funding round — exciting milestone. I'd love to show you how teams scaling through a Series B are using [Product] to hit revenue targets faster.", "mode": "prompt" }, "meta": { "requestId": "req_01hxyz", "cost": { "estimated": 1, "actual": 1 } }}
Mode 2: AI mode (multi-provider + structured output)
AI mode gives you direct access to specific models with optional structured output via JSON Schema. Use this when you need deterministic output shapes, want to choose your model, or need to tune temperature and token limits.
Field
Type
Description
prompt
string
Your instruction
model
string
Provider and model, e.g. "openai:gpt-4.1" or "google-vertex:gemini-2.5-flash-lite"
schema
object
JSON Schema for structured output — response data conforms to this schema
systemPrompt
string
Override the default system message
temperature
number
Sampling temperature between 0 and 2
maxTokens
number
Cap on output tokens
curl -X POST https://api.thehog.ai/api/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Extract the three most compelling pain points for a VP of Sales from this product description: [your description here]", "model": "openai:gpt-4.1", "schema": { "type": "object", "properties": { "painPoints": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "severity": { "type": "string", "enum": ["high", "medium", "low"] } }, "required": ["title", "description", "severity"] } } }, "required": ["painPoints"] }, "temperature": 0.3 }'
Include output: "image" in a standard generate request. The response includes imageBase64 (decode for display) and imageMimeType.
curl -X POST https://api.thehog.ai/api/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A professional banner image for a B2B SaaS product focused on revenue intelligence. Clean, modern, dark blue and white.", "output": "image" }'
Use this endpoint when you want to pipe the image directly to disk or a file upload. The response is raw image bytes with Content-Disposition: attachment.
curl -X POST https://api.thehog.ai/api/generate/image \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A clean hero image for a GTM intelligence platform. Abstract data network on dark background.", "filename": "hero-banner.png" }' \ --output hero-banner.png
The filename field sets the suggested download filename (.png is appended automatically if missing).
Social mode generates context-aware replies or quote reposts tied to specific social content in your project. This is useful for automating or accelerating social engagement as part of your GTM motion.