Image API documentation
Generate an image, collect the result and connect your tools.
Start with one image
Base URL: https://blogora.si. Create a key in Images → Credits & API keys and keep it on your server or in your automation’s credentials. Each delivered image uses one credit ($0.040). Monthly Blogora plans include 100, 300, 1,000 credits respectively; top-ups share the same balance.
- Submit
POST /api/v1/jobswith your key, JSON body and a stableIdempotency-Key. - Save the returned
id. A 202 response means the job was accepted, not that an image is ready. - Poll
GET /api/v1/jobs/JOB_IDwhile status isqueuedorprocessing. - On
completed, collectdata[].imageUrl. Onpartial,failedorcancelled, retain any delivered results and inspecterror.
Polling and downloading are free. Repeat an uncertain submission with the same key and identical body. Changing its body returns 409. A timeout is a reason to resume that job, not submit a new generation.
Code examples
Use a different stable task key for each intended new generation. These examples stop after ten minutes of polling; keep the job ID to resume later.
curl
# Set BLOGORA_API_KEY privately in your environment.
curl --fail-with-body --silent --show-error https://blogora.si/api/v1/jobs \
-H "Authorization: Bearer $BLOGORA_API_KEY" \
-H "Idempotency-Key: article-123-cover-v1" \
-H "Content-Type: application/json" \
--data '{"prompt":"A warm overhead photo of homemade lemon pasta","size":"1024x1024","n":1,"enhancePrompt":false,"output_format":"png"}'
# Copy the response id. Repeat this GET while status is queued or processing.
curl --fail-with-body --silent --show-error \
"https://blogora.si/api/v1/jobs/JOB_ID" \
-H "Authorization: Bearer $BLOGORA_API_KEY"
# completed: use data[].imageUrl. failed/partial/cancelled: inspect error/data.
# A network retry of the POST must keep the same key and identical body.Python
# Python 3; uses only the standard library.
import json, os, time
from urllib.request import Request, urlopen
from urllib.error import HTTPError
base = os.environ.get('BLOGORA_BASE_URL', 'https://blogora.si')
key = os.environ['BLOGORA_API_KEY']
def api(path, body=None):
headers = {'Authorization': 'Bearer ' + key, 'Content-Type': 'application/json'}
if body is not None:
headers['Idempotency-Key'] = os.environ.get('BLOGORA_IDEMPOTENCY_KEY', 'article-123-cover-v1')
request = Request(base + path, data=None if body is None else json.dumps(body).encode(), headers=headers)
try:
with urlopen(request, timeout=30) as response:
return json.load(response)
except HTTPError as error:
detail = json.loads(error.read())
raise RuntimeError(str(error.code) + ': ' + detail.get('error', 'Request failed')) from error
job = api('/api/v1/jobs', {"prompt":"A warm overhead photo of homemade lemon pasta","size":"1024x1024","n":1,"enhancePrompt":False,"output_format":"png"})
deadline = time.monotonic() + 600
while job['status'] in ('queued', 'processing'):
if time.monotonic() >= deadline:
raise TimeoutError('Still processing; resume polling job ' + job['id'])
time.sleep(2)
job = api('/api/v1/jobs/' + job['id'])
if job['status'] != 'completed':
raise RuntimeError(json.dumps({'id': job['id'], 'status': job['status'], 'error': job.get('error'), 'delivered': job.get('data', [])}))
print([image['imageUrl'] for image in job['data']])Node.js
// Node.js 20+. Set BLOGORA_API_KEY and a stable key for this task.
const base = process.env.BLOGORA_BASE_URL || 'https://blogora.si';
const key = process.env.BLOGORA_API_KEY;
if (!key) throw new Error('Set BLOGORA_API_KEY');
async function api(path, body) {
const response = await fetch(base + path, {
method: body === undefined ? 'GET' : 'POST',
headers: {Authorization: 'Bearer ' + key, 'Content-Type': 'application/json',
...(body === undefined ? {} : {'Idempotency-Key': process.env.BLOGORA_IDEMPOTENCY_KEY || 'article-123-cover-v1'})},
...(body === undefined ? {} : {body: JSON.stringify(body)}),
signal: AbortSignal.timeout(30000)
});
const result = await response.json();
if (!response.ok) throw new Error(response.status + ': ' + (result.error || 'Request failed'));
return result;
}
let job = await api('/api/v1/jobs', {"prompt":"A warm overhead photo of homemade lemon pasta","size":"1024x1024","n":1,"enhancePrompt":false,"output_format":"png"});
const deadline = Date.now() + 600000;
while (['queued', 'processing'].includes(job.status)) {
if (Date.now() >= deadline) throw new Error('Still processing; resume polling job ' + job.id);
await new Promise(resolve => setTimeout(resolve, 2000));
job = await api('/api/v1/jobs/' + encodeURIComponent(job.id));
}
if (job.status !== 'completed') throw new Error(JSON.stringify({id: job.id, status: job.status, error: job.error, delivered: job.data}));
console.log(job.data.map(image => image.imageUrl));For an inline response, use POST /api/v1/images/generations with async: false and response_format: "url" or "b64_json". Always retain the returned job ID if processing continues.
Image options
| Field | Usage |
|---|---|
| prompt | Required description, 1–16,000 characters. |
| size / width, height | Use WIDTHxHEIGHT, or two whole pixel dimensions from 256 to 2,048. |
| aspect_ratio | 1:1, 2:3, 3:2, 4:5, 5:4, 16:9 or 9:16. Explicit dimensions override the preset. |
| n | 1–8 images. Credits are reserved for requested images; only delivered images are charged. |
| output_format | png (default) or webp. Requested dimensions are retained. |
| enhancePrompt | true uses the text model to refine the brief. Original and enhanced prompts remain in the result. |
| negative_prompt | Optional exclusions, up to 4,000 characters. |
| collection | Optional label, up to 120 characters. |
Use a reference image
Add referenceImageId for an image you already own, or image containing a PNG/JPEG/WebP base64 data URL (up to 10 MiB). Remote image URLs are not accepted. Choose referenceMode: "style" or "subject" for reference-based inspiration. These modes analyze the reference first; when analysis is unavailable, a verified native-editing capability can use the original reference directly.
{"prompt":"Warm natural light, keep the subject recognizable","size":"1024x1024","referenceImageId":"YOUR_OWNED_IMAGE_ID","referenceMode":"subject"}Check GET /api/v1/warmup with your API key for current capabilities. Use referenceMode: "exact" only when capabilities.nativeImageEditing is true. It selects direct editing with the supplied reference; unchanged pixels are not guaranteed. Available reference-analysis support is shown by capabilities.vision. If neither required capability is available, the request returns 422 before reserving credits. Retain the reference and inspect the error before retrying.
Results, balance and recovery
GET /api/v1/credits
GET /api/v1/gallery?limit=50&offset=0
GET /api/v1/assets/IMAGE_ID
POST /api/v1/batch-status {"ids":["JOB_ID"]}
POST /api/v1/jobs/JOB_ID/retry
Authorization: Bearer YOUR_BLOGORA_API_KEYThe authenticated asset endpoint downloads the binary. Result links expire after 24 hours; poll the existing job again for a fresh link. A partial/failed job can retry missing slots without regenerating or charging delivered ones. Download and retain files needed outside your account.
| Status | Next step |
|---|---|
| 400 | Correct the request. Invalid JSON/options create no new job. |
| 401 | Check your active API key; never use a customer session token here. |
| 402 | Check available and reserved credits before retrying. |
| 409 | Keep the original body for this idempotency key, or use a new key for a deliberate new image. |
| 422 | Requested model/reference/provider option is unsupported. Read the error. |
| 429 | Wait for active jobs before submitting more. |
| 5xx / timeout | Keep any returned job ID. Resume polling or replay the same submission key/body. |
Make, n8n and Zapier
Use ordinary authenticated HTTP steps. These are setup recipes, not native Blogora connectors. The request body and status rules are the same as the code examples above.
Make
- Add HTTP → Make a request. POST to
https://blogora.si/api/v1/jobs, send JSON and the Authorization/Idempotency-Key headers. - Parse the JSON response and store
idwith your source task. Never create a new key merely because the scenario retries. - After a delay, use another HTTP request to GET
/api/v1/jobs/plus that ID. Continue a bounded delay/check loop while queued/processing. - Route completed results to
data[].imageUrl. Send partial/failed/cancelled and non-2xx responses to an error/review branch.
n8n
- Use HTTP Request with Header Auth for Authorization, POST the JSON body and add the stable Idempotency-Key.
- Save the submission ID. Connect a Wait step to a GET HTTP Request for
/api/v1/jobs/JOB_ID. - An IF/Switch step sends queued/processing back through Wait with a retry-count/time limit. Completed continues with
data[].imageUrl; other terminal states stop with the retained error/results. - Keep HTTP failures on the workflow’s error path. Do not loop the image-submission node with fresh task keys.
Zapier
- Use Webhooks by Zapier → Custom Request with POST, the exact JSON body and Authorization/Idempotency-Key headers. Store the returned job ID with the source record.
- Add a Delay step, then a GET request to
/api/v1/jobs/JOB_IDwith the same Authorization header. - Filter for completed before using
data[].imageUrl. If still queued/processing, retain the ID for a later scheduled status check; a single delayed check is not guaranteed to be enough. - Use an error/review path for non-2xx or terminal failures. Keep polling bounded; never submit a new image to check status.
Prompt assistance
POST /api/v1/chat answers Blogora/API questions and helps write image prompts. Send prompt or 1–30 text messages with user/assistant roles. The entire prompt or assembled transcript can contain up to 8,000 characters; each reply has a 600-token output budget. Use the WordPress project workflow to generate full articles.
At least one unreserved image credit is required. Assistance uses no image credits and is limited to 20 accepted requests per rolling hour and 100 per rolling 24 hours, shared across all your API keys. Provider failures count toward these limits. A 429 with prompt_assistance_limit means wait until an earlier request leaves the rolling window.