We build custom applications 5x faster and cheaper 🚀
Book a Free Consultation
Stuck on an error? Book a 30-minute call with an engineer and get a direct fix + next steps. No pressure, no commitment.
You integrate an AI picture-book generator with OpenClaw by building a skill that orchestrates prompt creation, calls external image-generation and storage APIs (authenticated via OAuth or API keys configured in ClawHub), performs long-running or stateful work outside the agent (workers, DB, cloud storage), and returns assembled pages (images + text) to users; configure the skill in ClawHub, store secrets as environment variables or service credentials, handle async webhooks or polling from the image provider, validate webhooks, and debug via logs, API-response inspection, and credential/scope checks.
POST /jobs
Content-Type: application/json
Authorization: Bearer <SERVICE_API_KEY>
{
"user\_id": "user-123",
"title": "The Little Star",
"pages": [
{"text": "Once there was a little star...", "style": "watercolor", "prompt\_overrides": {}},
{"text": "It traveled across the sky...", "style": "watercolor", "prompt\_overrides": {}}
],
"output": {"format": "pdf", "page\_size": "A4"}
}
POST https://api.imaginary-image-provider.example/v1/generate
Content-Type: application/json
Authorization: Bearer <IMAGE_API_KEY>
{
"prompt": "A watercolor illustration of a small glowing star flying across a night sky, soft colors, child-friendly",
"width": 2048,
"height": 1536,
"safe\_mode": true,
"callback\_url": "https://jobs.example.com/webhook/image-callback" // optional for async providers
}
const express = require('express');
const bodyParser = require('body-parser');
const crypto = require('crypto');
const app = express();
app.use(bodyParser.json());
app.post('/webhook/image-callback', (req, res) => {
// Verify signature if provider sends HMAC header, e.g. X-Signature
const sig = req.headers['x-signature'] || '';
const secret = process.env.IMAGE_PROVIDER_WEBHOOK\_SECRET;
const computed = crypto.createHmac('sha256', secret).update(JSON.stringify(req.body)).digest('hex');
if (sig !== computed) {
return res.status(401).send('invalid signature');
}
// req.body should contain job_id and image_url or base64 data
const { job_id, image_url } = req.body;
// Mark job state in DB and enqueue assembly task
// saveImageAndEnqueueAssembly(job_id, image_url);
res.status(200).send('ok');
});
app.listen(8080);
const AWS = require('aws-sdk');
const fetch = require('node-fetch');
const s3 = new AWS.S3();
async function saveRemoteImageToS3(remoteUrl, bucket, key) {
// download
const r = await fetch(remoteUrl);
const buffer = await r.buffer();
// upload
await s3.putObject({
Bucket: bucket,
Key: key,
Body: buffer,
ContentType: r.headers.get('content-type')
}).promise();
return `https://s3.amazonaws.com/${bucket}/${key}`; // or use signed URL
}
from PIL import Image
from reportlab.lib.pagesizes import A4
from reportlab.pdfgen import canvas
def create_pdf(image_paths, out\_path):
c = canvas.Canvas(out\_path, pagesize=A4)
for img_path in image_paths:
img = Image.open(img\_path)
img_w, img_h = img.size
a_w, a_h = A4
// scale to fit A4 while preserving aspect
scale = min(a_w / img_w, a_h / img_h)
w = img\_w \* scale
h = img\_h \* scale
x = (a\_w - w) / 2
y = (a\_h - h) / 2
c.drawImage(img\_path, x, y, width=w, height=h)
c.showPage()
c.save()
Speak one‑on‑one with a senior engineer about your no‑code app, migration goals, and budget. In just half an hour you’ll leave with clear, actionable next steps—no strings attached.
1
Store the API key with clawctl secret create, then reference that secret as an environment variable in your agent's claw.yaml. This keeps credentials out of source and lets the OpenClaw runtime inject them at execution time.
clawctl secret create my-service-api-key --from-literal=API_KEY=sk_ABC123
# claw.yaml snippet
env:
- name: API_KEY
valueFrom:
secretKeyRef:
name: my-service-api-key
key: API_KEY
2
Yes — upload images to your OpenClaw Asset Registry by POSTing the image+metadata to the registry's REST endpoint (using an API key or OAuth token from an environment variable), capture the returned asset_id or URL, and include that reference in the Claw Pipeline/ClawTask payload so the runtime fetches the asset at execution time.
// Upload image
const form = new FormData();
// <b>//</b> append image and metadata
form.append('file', fs.createReadStream('ai.png'));
form.append('meta', JSON.stringify({source:'ai', tags:['generated']}));
const res = await fetch(process.env.ASSET_REGISTRY_URL+'/assets', {
method:'POST',
headers:{ Authorization:`Bearer ${process.env.ASSET_REGISTRY_TOKEN}` },
body: form
});
const { asset_id, url } = await res.json();
// <b>//</b> include asset_id in ClawTask payload
const task = { type:'image-process', inputs:{ assetRef: asset_id } };
3
Run your image-render job by launching a Claw Worker container built with the GPU-enabled runtime (CUDA or ROCm libs), expose the GPU to the container (Docker or Kubernetes), and set the worker concurrency in the claw-worker configuration (usually an env var or config file) so the worker spawns the desired number of render workers.
// run container with GPU access and set concurrency to 2
docker run --gpus '"device=0"' -e WORKER_CONCURRENCY=2 myorg/claw-worker:gpu
4
Configure an external webhook to POST to a Claw Event Connector you create in ClawHub, validate/authenticate the webhook, and in the Event Connector map the incoming JSON fields to the ClawTask inputs used by your Pipeline. Ensure the agent runtime has required credentials (env vars/API keys/OAuth) so the skill can run when the Pipeline is triggered.
This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.
From startups to enterprises and everything in between, see for yourself our incredible impact.
Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We’ll discuss your project and provide a custom quote at no cost.Â