Coze Integration — Image Generation for AI Bots
Add image generation to Coze bots using workflow HTTP nodes or custom plugins. Generate images from HTML with RendShot.
Coze is a platform for building AI bots and agents. You can integrate RendShot in two ways: via Workflow HTTP nodes (no code) or via Custom Plugins (API-based tools the bot can call).
Prerequisites
- A RendShot API key (get one free)
- A Coze account at coze.com
Option 1: Workflow HTTP Node (Recommended)
Use the HTTP Request node in a Coze Workflow to call the RendShot API.
Create a Workflow
- Go to your bot → Workflows → Create Workflow
- Add an HTTP Request node
Configure the HTTP Request
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://api.rendshot.ai/v1/image |
| Headers | Authorization: Bearer rs_live_YOUR_KEY |
| Headers | Content-Type: application/json |
| Body Type | JSON |
Set the request body
{
"template_id": "social-card",
"variables": {
"title": "{{input.title}}",
"author": "{{input.author}}"
},
"width": 1080,
"height": 1080,
"format": "png"
}Use Coze's variable syntax ({{input.field}} or {{node.output}}) to pass dynamic data from the user's message or upstream nodes.
Use the result
The response contains a url field with the CDN-hosted image. Pass it to:
- A Reply node to send the image back to the user
- Another HTTP node to post it somewhere (Slack, social media, etc.)
Option 2: Custom Plugin
Create a custom plugin so the bot can call RendShot as a tool during conversations.
Create the plugin
- Go to Personal → Plugins → Create Plugin
- Choose Create by API
- Add a tool:
| Field | Value |
|---|---|
| Tool name | generate_image |
| API URL | https://api.rendshot.ai/v1/image |
| Method | POST |
Define input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | No | Raw HTML to render (use if no template) |
template_id | string | No | Template ID (use if templates are set up) |
variables | object | No | Key-value pairs for template variables |
width | integer | Yes | Image width in pixels |
height | integer | Yes | Image height in pixels |
format | string | No | png, jpeg, or webp (default: png) |
Configure authentication
Set the Authorization header:
- Type: Custom Header
- Header name:
Authorization - Header value:
Bearer rs_live_YOUR_KEY
Define output
The API returns:
{
"url": "https://assets.rendshot.ai/img/abc123.png",
"id": "img_abc123",
"format": "png",
"width": 1080,
"height": 1080
}Map the url field as the output so the bot can display or reference the generated image.
Example Bot Scenarios
Social card generator bot
User: "Generate a card for my post: Building APIs That Scale"
Bot calls generate_image plugin:
template_id: "social-card"
variables: { title: "Building APIs That Scale" }
width: 1080, height: 1080
Bot replies: "Here's your social card: [image URL]"Product image assistant
User: "Create a promo banner for our new headphones, price $149"
Bot calls generate_image plugin:
template_id: "product-card"
variables: { name: "Wireless Pro", price: "$149", badge: "NEW" }
width: 1200, height: 630
Bot replies with the generated banner imageURL Screenshots
For capturing live webpages, create a second tool pointing to the screenshot endpoint:
| Field | Value |
|---|---|
| Tool name | screenshot_url |
| API URL | https://api.rendshot.ai/v1/screenshot |
| Method | POST |
| Parameters | url (string, required), width (integer), height (integer) |
Troubleshooting
| Issue | Fix |
|---|---|
| 401 Unauthorized | Check the Authorization header — must include Bearer prefix |
| Plugin not called by bot | Ensure the plugin is enabled in your bot's tool list |
| Image not displaying in chat | Use the url from the response in a markdown image or direct link |
| Variables not substituted | Check Coze variable syntax matches your workflow/plugin configuration |
Next steps
- API Reference — all endpoints and parameters
- Integrations Overview — other platforms
Dify Integration — Image Generation in AI Workflows
Generate images from HTML in Dify workflows using the HTTP Request node. Add image generation to any AI agent or chatflow.
GitHub Actions — Auto-Generate OG Images on Deploy
Generate OG images automatically in your CI/CD pipeline using GitHub Actions and the RendShot API or CLI.