Overview
API Base:https://api.kie.ai/api/v1/jobs/
Model: nano-banana-pro
Capabilities:
- Text-to-image generation
- Image transformation (up to 8 input images)
- Multiple aspect ratios (1:1, 16:9, 9:16, etc.)
- High resolution output (1K, 2K, 4K)
- Fast generation (typically 30-90 seconds)
Setup
API endpoints
Create task
Endpoint:POST https://api.kie.ai/api/v1/jobs/createTask
Request:
Query task status
Endpoint:GET https://api.kie.ai/api/v1/jobs/queryTask?taskId={taskId}
Response:
pending- Task queuedprocessing- Image generatingsuccess- Complete, image readyfail- Generation failed
Usage in Pulse Content
Generate infographic
Transform existing image
Configuration options
Aspect ratios
Image dimensions. Supported values:
1:1- Square (1024×1024)16:9- Widescreen (1920×1080)9:16- Vertical (1080×1920)4:3- Standard (1600×1200)3:4- Portrait (1200×1600)21:9- Ultrawide (2560×1080)2:3- Tall portrait (1365×2048)3:2- Wide landscape (2048×1365)4:5- Instagram portrait (1080×1350)5:4- Near square (1350×1080)auto- AI chooses best ratio
Resolution
Output image quality:
1K- Low resolution (faster, smaller files)2K- Standard resolution (balanced)4K- High resolution (slower, larger files)
Output format
Image file format:
png- Lossless, transparency supportjpg- Compressed, no transparency
Image input
URLs of existing images to transform (up to 8 images).Use cases:
- Add branding to existing images
- Remix guest photos with infographic elements
- Apply style transfer
- Combine multiple images into collage
Polling behavior
Default settings
Custom polling
Progress tracking
Prompt engineering
Infographic prompts
Generated by AI spec generator based on:- Layout structure (28 types)
- Content template (10 types)
- Visual style system
- YBH brand guidelines
- Episode context
Quote card prompts
Example:Career timeline prompts
Example:Error handling
Task timeout
Generation failure
Missing image URL
Performance optimization
Parallel generation
Cache generated images
Store image URLs in Sanity to avoid regenerating:Pregenerate common assets
Generate career timelines immediately after LinkedIn scrape:Cost management
Generation costs
Per image generation:- Resolution affects cost (4K costs more than 2K)
- Aspect ratio doesn’t affect cost
- Image transformations cost the same as new generations
Reduce costs
Callback integration
Kie.ai can notify your server when generation completes:Troubleshooting
API key invalid
KIEAI_API_KEY is set correctly:
Task not found
Generation takes too long
Causes:- Complex prompts with many elements
- High resolution (4K)
- Multiple image inputs
- High API load
- Reduce to 2K resolution
- Simplify prompt
- Try again during off-peak hours
- Increase
maxAttemptsinwaitForTask
Image quality issues
Problem: Generated image doesn’t match prompt Solutions:- Refine prompt with more specific details
- Include layout structure and style guidelines
- Add negative prompts (“no logos”, “no watermarks”)
- Regenerate with adjusted prompt
Best practices
- Always specify aspect ratio: Default
16:9may not suit all use cases - Use 2K for social media: Sufficient quality, faster generation
- Include brand guidelines: Mention YBH colors, fonts, and style in prompts
- Test prompts iteratively: Refine prompts based on generation results
- Store successful prompts: Save working prompts in knowledge base for reuse
- Monitor generation status: Use progress callbacks to show users real-time updates
- Handle failures gracefully: Provide retry options and clear error messages