ChainHub API Guide
  1. Native Format
  • How to use ChainHub
  • Overview
    • Quick Start
    • Important Guidelines
    • Examples
    • Pricing
    • Error Codes
  • Chat
    • Chat
    • ChatGPT Interface
      • ChatGPT Audio
        • Audio to text conversion gpt-4o-transcribe
        • Creating voice gpt-4o-mini-tts
        • Create Translation (Not Supported)
      • ChatGPT Embeddings
        • Create an embed
      • ChatGPT Auto-Completion
        • Creation complete
      • Chat (Responses)
        • Create function call Copy
      • GPTs Related
        • GPTs Dialogue
    • Google Gemini API
      • Gemini Chat
      • Chat Compatible Format
        • Gemini-2.5-flash-all
        • Chat interface
        • Image recognition interface
      • Native Format
        • Embeddings
          POST
        • Create text - flow
          POST
        • Text generation + thinking-flow
          POST
        • Image generation
          POST
        • Image generation gemini-2.5-flash-image: Controlling aspect ratio
          POST
        • Image generation gemini-3-pro-image-preview controls aspect ratio and sharpness.
          POST
        • Image editing
          POST
        • google search
          POST
        • TTS Text-to-speech
          POST
        • Text generation gemini-3-pro-preview:generateContent
          POST
        • Imagen Generate image
          POST
    • Anthropic Claude Interface
      • Anthropic Claude
      • Chat Compatible Format
        • Create Chat Completion (Streaming)
        • Create Extended Thinking Chat
        • Create Chat Vision (Non-Streaming)
        • Create Chat Vision (Streaming)
        • Create Chat Completion (Non-Streaming)
      • Native Format
        • Create function calls (streaming)
        • Create chat autocomplete (streaming)
        • Create formatted output
        • Create a Thinking Chat
        • Internet search
        • PDF support
  • Image Models
    • Qwen Series
      • qwen-image-edit-2509
      • qwen-image-max
      • z-image-turbo
    • Tencent AIGC
      • Create Task
      • Get the request result
    • Midjourney
      • Upload Image
      • Submit Imagine Task
      • Query task status by task ID
      • Search for tasks based on the ID list
      • Get the seed for the task image
      • Execute Action
      • Submit Blend task
      • Submit Describe task
      • Submit Model
    • Ideogram
      • Generate 3.0 (Text and Image) Generate
      • Generate 3.0 (Image Editing) Edit
      • Generate 3.0 (Image Remix) Remix
      • Generate 3.0 (Image Reframe) Reframe
      • Generate 3.0 (Replace Background) Replace Background
      • ideogram (Text to Image)
      • Remix (Image Remix)
      • Upscale (Upscale)
      • Describe (Describe)
    • Fal.AI Platform
      • /fal-ai/nano-banana Text-to-Image
      • /fal-ai/nano-banana/edit Image Editing
      • Get the request result
    • FLUX Series
      • OpenAI Compatible Format
        • Flux Image Editing (OpenAI dall-e-3 format)
        • Flux creation (OpenAI dall-e-3 format)
      • Replicate Official Format
        • Query task
    • GPT Image Series
      • Create gpt-image-1
      • Edit gpt-image-1
      • mask gpt-image-1
      • Create gpt-image-1.5
      • Edit gpt-image-1.5
      • Mask gpt-image-1.5
  • Video Models
    • grok Video Generation
      • Video Unified Format
        • Create video
        • Query task
    • luma Video Generation
      • Official API Format
        • Submit video generation task
        • Extend video
      • Query a single task
        • Query a single task
      • Batch retrieval tasks
        • Batch retrieval tasks
    • Runway Video Generation
      • Submit video generation task
      • Query video task (free)
    • Sora Video Generation
      • OpenAI Official Video Format
        • openai Create video (with Character)
        • openai Query task
        • openai Download video
        • openai Edit video
        • Create videos with images using OpenAI.
        • Create a video with images using OpenAI in private mode.
        • Create videos using storyboards
      • Chat Format
        • Create video
        • Continuous modification to generate video
        • Create a video with images
      • Unified Video Format
        • Query task
        • Create a video with images using sora-2
        • Create video sora-2
        • Creating videos with sora-2-pro
        • Create a video (with a character)
      • Create character
    • Minimax Hailuo Video Generation
      • First and last frame video
      • Video task status query
    • Tencent AIGC Video Generation
      • Get request result
      • Create task
    • Doubao Video Generation
      • seedance-1-5-pro
      • Query video generation task list - search multiple task IDs
      • Query a single task
      • Wensheng Video Example
      • Image-based video - first frame
      • seedance-lite-first and last frames
      • Image-based video - base64 encoded
      • Seedance-Lite Reference Image
      • Query video generation task list - default
      • Query video generation task list - search multiple task ID
      • seedance-1-5-pro-first and last frames
    • Wan Video Generation
      • Generate video
      • Video query
  • Music Suno
    • Suno API Documentation
    • Task Submission
      • Generate song (concatenate song)
      • Generate lyrics
      • Concatenate songs
      • Report upload completion
      • Query upload processing status
      • Initialize audio clip
      • Request upload authorization
      • s3 upload example
      • Scenario 3: Pure Music - Custom
      • Song splicing
      • Generate a song (custom mode)
      • Generate a song (Inspiration Mode)
      • Generate a song (continuation mode)
      • Generate songs (singer style)
      • Generate a song (upload a song for secondary creation).
      • Generate a song (compose a song)
      • Report uploaded
      • Initialize audio file
      • Scene 1: Inspiration Mode
      • Scenario 2: Custom lyrics and song title
    • Query Interface
      • Batch fetch tasks
      • Query single task
      • Get wav
      • Timing: lyrics, audio timeline
      • Feed details retrieval
  • Kling Platform
    • Callback Protocol
    • Omni-Image
      • Query Task (Single)
      • Omni-Image
    • Omni-Video
      • Omni-Video
    • Custom Elements
      • Custom Elements
    • Motion Control
      • Motion Control
      • Query Task (Single)
    • Image Generation
      • Image Generation
      • Query Task (Single)
    • Image Recognition
      • Image Recognition
    • Image to Video
      • Image to Video
    • Image
      • Video
        • Query task (single)
    • Multi-image reference generation
      • Multi-image reference generation
      • Query task (single)
    • Multi-image reference video generation
      • Multi-image reference video generation
      • Query task (single)
    • Multi-modal video editing
      • Initialize video to be edited
      • Add video selection
      • Delete video selection
      • Preview selected area video
      • Multi-modal video
      • Query task (single)
    • Lip Sync
      • Face identification
      • Lip sync
    • lip-syncing
      • Query Task (Single)
      • Facial recognition
      • Lip-syncing
    • image expansion
      • Image Expansion
      • Query Task (Single)
    • digital human
      • Image to Video
      • Query Task (Single)
    • text to video
      • Text to Video
      • Query Task (Single)
    • text to audio
      • Text-to-Audio
      • Query Task (Single)
    • custom voice
      • Custom Voice
      • Query Custom Voice (Single)
      • Query Official Voices
      • Delete Custom Voice
    • virtual try-on
      • Virtual Try-On
      • Query Task (Single)
    • video extension
      • Video Extension
      • Query Task (Single)
    • video effects
      • Video Effects
      • Query Task (Single)
    • video to audio
      • Video to Audio
      • Query Task (Single)
    • text-to-speech
      • Text-to-Speech
  • Fal-ai aggregation platform
    • Integration Tutorial
    • falai-veo3 video generation
      • /fal-ai/veo3
      • /fal-ai/veo3/fast/image-to-video
      • /fal-ai/veo3/fast
      • /fal-ai/veo3/requests/{request_id}
      • /fal-ai/veo3/image-to-video
    • Get the request result
    • /fal-ai/flux-1/dev
    • /fal-ai/flux-1/dev/image-to-image
    • /fal-ai/flux-1/dev/redux
    • /fal-ai/flux-1/schnell/redux
    • /fal-ai/flux-pro/kontext
    • /fal-ai/flux-pro/kontext/text-to-image
    • /fal-ai/flux-pro/kontext/max
    • /fal-ai/flux-pro/kontext/max/multi
    • /fal-ai/wan/v2.2-a14b/image-to-image
    • /fal-ai/bytedance/seedream/v4/text-to-image
    • /fal-ai/bytedance/seedream/v4/edit
    • /fal-ai/vidu/reference-to-image
    • /fal-ai/imagen4/preview
    • /fal-ai/qwen-image-edit-lora
    • /fal-ai/qwen-image-edit-plus
    • /fal-ai/kling-video/v2.5-turbo/pro/text-to-video
    • /fal-ai/kling-video/v2.5-turbo/pro/image-to-video
    • /fal-ai/flux-lora
    • /fal-ai/flux-lora/image-to-image
    • /fal-ai/flux-lora/inpainting
  • Replicate Aggregation Platform
    • Access Tutorial
    • Create task black-forest-labs/flux-kontext-dev
    • Query task
    • Create task lucataco/remove-bg
    • Create task ideogram-ai/ideogram-v2-turbo
    • Create task minimax/video-01-live
    • Create task minimax/video-01
    • Create task recraft-ai/recraft-v3
    • Create task recraft-ai/recraft-v3-svg
    • Create task black-forest-labs/flux-1.1-pro-ultra
    • Create task black-forest-labs/flux-kontext-pro
    • Create task black-forest-labs/flux-kontext-max
    • Create task flux-kontext-apps/multi-image-kontext-max
    • Create task flux-kontext-apps/multi-image-kontext-pro
    • Create task riffusion/riffusion
    • Create task black-forest-labs/flux-fill-dev
    • Create task black-forest-labs/flux-fill-pro
    • Create task google/imagen-4-fast
    • Create task google/imagen-4-ultra
    • Create task google/imagen-4
    • Create task prunaai/vace-14b
    • Create task bytedance/seedream-4
  • Rerank Rerank Model
    • Rerank
  • Python Configuration
    • Python Basics Discussion
    • Using gpt-4o in Python to recognize images
    • Using Claude in Python to Recognize Images
    • Python OpenAI official libraries
    • Python continuous dialogue
    • Using Python to convert speech to text
    • Using Python to convert text to speech
    • Vectorization using Embeddings in Python
    • Python calls DALL·E
    • Simple Python function calling demo
    • Simple Python LangChain calling OpenAI demo
    • Python llama\Index configuration
    • Using gpt-4o in Python to recognize local images
    • Python library for streaming output
    • GPT Realtime Model Call
    • Python request request streaming demo
    • Using Python to create and edit images with gpt-image-1
  1. Native Format

Image editing

POST
/v1beta/models/gemini-2.0-flash-exp-image-generation:generateContent
Official documentation: https://ai.google.dev/gemini-api/docs/image-generation?hl=en#gemini-image-editing

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Query Params

Header Params

Body Params application/json

Examples

Responses

🟢200
application/json
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '/v1beta/models/gemini-2.0-flash-exp-image-generation:generateContent?key={{YOUR_API_KEY}}' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "'\''Hi, This is a picture of me. Can you add a llama next to me"
                },
                {
                    "inline_data": {
                        "mime_type": "image/jpeg",
                        "data": "iVBORw0KGgoAAAANSUhEUgAABAAAAAKoCAIAAABm4BptAAAAiXpUWHRSYXcgcHJvZmlsZSB0eXBlIGlwdGMAAAiZTYwxDgIxDAT7vOKekDjrtV1T0VHwgbtcIiEhgfh/QaDgmGlWW0w6X66n5fl6jNu9p+ULkapDENgzpj+Kl5aFfa6KnYWgSjZjGOiSYRxTY/v8KIijI/rXyc236kHdAK22RvHVummEN+91ML0BQ+siou79WmMAAAKHaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjUuMCI+IDxyZGY6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kRXc2afqLn1l7K6yI5shBYceIUwcaT6Kb6WHC8fH50x0VRwN3P72BgffETd7ek320c1egE+ItGfhf7rd/nHYxrrwa1ltE6SYv9ZDAT3A5THuMbrbyFxKWVzQcVFB9BBR/8TQzGcq4Nsp80wWfUjhjrbpj8vyk7e5ibKX0g1zdswPLcW1EdH9zZIFi3l0rY0yHkTRMv6bSlvuG4t/b993Q2t0O+2prO2y0I7QAZeDqwbbRagIYsseT2c6ums7wZB7CmeS2Ev81Jfql36UQ/OVbMObsX3uhYTSv0TtOGG0xRzisOZsDRrbSYOuM1e20kppbE5zn03e+7RykZvAwJ/dbX+wFTxWY9J72NGwTUk5WFwEXu+4JygtK/19VWd7EscCZ2VmKZtb5mOq4xi06rbwbi74oF0o2U8w4PCyxQ0H65MEB1Hdd+NI58/5aA2Py/h5r7m+fJcWU4F+chVM8SUHIlMTpC2Jaft/KEtWhb0S0OVayMoY5UOD4Q9y4q/H0SuyGLVQppZV0sMe0xDGmQXkwAzY3PLWt1A/rysxEs1h+GlR5uuOhA16pllfxWZy905wxJ6xphDkmyX2w77VDFRhMc2VZXJl0UFDZKaAeZjc8nHd7BkPLRP2G2wSOOeMwBuhLcd/4GOVdyjBGdGraYMoZeYrQ9iOj6l+cEC9GFzUS4jUIL0txFL0muZzSvh/ACSGW72pnM2CCXa2MxRFEnrMEd5RTVYoCnlYgjO+vPq
Response Response Example
{}
Modified at 2026-02-08 06:57:56
Previous
Image generation gemini-3-pro-image-preview controls aspect ratio and sharpness.
Next
google search
Built with