Send a POST request toDocumentation Index
Fetch the complete documentation index at: https://docs.thehog.ai/llms.txt
Use this file to discover all available pages before exploring further.
/api/generate/image to generate an image and receive it as a downloadable binary file. The Hog calls Vertex AI Gemini image models with your prompt and streams the result directly to the response body with a Content-Disposition: attachment header, making it suitable for server-side file saving, piping to object storage, or triggering a browser download.
This endpoint returns raw image bytes, not JSON. If you need the image as base64-encoded data inside a JSON response — for example, to display it in a UI without saving to disk — use
POST /api/generate with output: "image" instead.Request
POST https://api.thehog.ai/api/generate/image
The image generation instruction. Describe the image you want in natural language. More detailed prompts generally produce better results.
The suggested filename included in the
Content-Disposition header (e.g. "hero-banner.png"). The filename is sanitized before use — path separators and special characters are replaced with underscores. If omitted, the filename defaults to generated with an extension matching the image MIME type.Response
The response body is the raw image file. There is no JSON envelope.| Header | Value |
|---|---|
Content-Type | One of image/png, image/jpeg, or image/webp depending on what the model returns. |
Content-Disposition | attachment; filename="<filename>" — triggers a download in browsers. |
Comparison with POST /api/generate
POST /api/generate/image | POST /api/generate with output: "image" | |
|---|---|---|
| Response format | Raw binary bytes | JSON with imageBase64 string |
| Use case | Save to disk, pipe to storage | Display in a web UI, process in memory |
| Content-Disposition | Yes, attachment | No |
Example
Usecurl with the -O and -J flags to save the file using the server-provided filename: