ChainHub API Guide
  1. Chat (Responses)
  • 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
          POST
      • 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
        • Create text - flow
        • Text generation + thinking-flow
        • Image generation
        • Image generation gemini-2.5-flash-image: Controlling aspect ratio
        • Image generation gemini-3-pro-image-preview controls aspect ratio and sharpness.
        • Image editing
        • google search
        • TTS Text-to-speech
        • Text generation gemini-3-pro-preview:generateContent
        • Imagen Generate image
    • 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. Chat (Responses)

Create function call Copy

POST
/v1/responses
https://platform.openai.com/docs/api-reference/responses/create Some OpenAI models only support the Response format, such as o3-pro and codex-mini-latest.

Request

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

Body Params application/json

Examples

Responses

🟢200
application/json
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1/responses' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "input": [
        {
            "role": "user",
            "content": "Please help me do the following things simultaneously:\n1. Get the current system time\n2. Check system information (operating system, memory, etc.)\n3. Calculate the result of 123.5 + 456.7\n4. Generate 3 random numbers between 1 and 100\n\nThis is a parallel tool invocation test, please execute these tasks simultaneously."
        }
    ],
    "metadata": {
        "model_id": "32"
    },
    "model": "gpt-4.1",
    "tool_choice": "auto",
    "tools": [
        {
            "type": "function",
            "name": "random_generator",
            "description": "Generate random numbers within a specified range, supporting batch generation",
            "parameters": {
                "type": "object",
                "properties": {
                    "min": {
                        "description": "Minimum value (default 1)",
                        "type": "integer"
                    },
                    "max": {
                        "description": "Maximum value (default 100)",
                        "type": "integer"
                    },
                    "count": {
                        "description": "Number to generate (default 1, maximum 10)",
                        "type": "integer"
                    }
                }
            }
        },
        {
            "type": "function",
            "name": "system_info",
            "description": "Retrieve basic information about the current system, including operating system, Java version, memory usage, etc.",
            "parameters": {
                "type": "object",
                "properties": {}
            }
        },
        {
            "type": "function",
            "name": "math_calculator",
            "description": "Performs basic mathematical operations, supporting addition, subtraction, multiplication, division, and exponentiation.",
            "parameters": {
                "type": "object",
                "properties": {
                    "a": {
                        "description": "The first number",
                        "type": "number"
                    },
                    "b": {
                        "description": "The second number",
                        "type": "number"
                    },
                    "operation": {
                        "description": "Operation type: add, subtract, multiply, divide, power",
                        "type": "string"
                    }
                },
                "required": [
                    "operation",
                    "a",
                    "b"
                ]
            }
        },
        {
            "type": "function",
            "name": "current_time",
            "description": "Get the current system time",
            "parameters": {
                "type": "object",
                "properties": {}
            }
        }
    ]
}'
Response Response Example
{
    "id": "resp_68ac1558e9488190bcc2cbb94c7d7a140b8064b15a091a77",
    "object": "response",
    "created_at": 1756108120,
    "status": "completed",
    "background": false,
    "content_filters": null,
    "error": null,
    "incomplete_details": null,
    "instructions": null,
    "max_output_tokens": null,
    "max_tool_calls": null,
    "model": "gpt-4.1-data",
    "output": [
        {
            "id": "fc_68ac15594be88190a58217f75a6a54cc0b8064b15a091a77",
            "type": "function_call",
            "status": "completed",
            "arguments": "{\"sign\":\"Aquarius\"}",
            "call_id": "call_6kbB2GTk62PPUNdGuBJPx9KQ",
            "name": "get_horoscope"
        }
    ],
    "parallel_tool_calls": true,
    "previous_response_id": null,
    "prompt_cache_key": null,
    "reasoning": {
        "effort": null,
        "summary": null
    },
    "safety_identifier": null,
    "service_tier": "default",
    "store": true,
    "temperature": 1,
    "text": {
        "format": {
            "type": "text"
        }
    },
    "tool_choice": "auto",
    "tools": [
        {
            "type": "function",
            "description": "Get today's horoscope for an astrological sign.",
            "name": "get_horoscope",
            "parameters": {
                "properties": {
                    "sign": {
                        "description": "An astrological sign like Taurus or Aquarius",
                        "type": "string"
                    }
                },
                "required": [
                    "sign"
                ],
                "type": "object"
            },
            "strict": true
        }
    ],
    "top_p": 1,
    "truncation": "disabled",
    "usage": {
        "input_tokens": 62,
        "input_tokens_details": {
            "cached_tokens": 0
        },
        "output_tokens": 18,
        "output_tokens_details": {
            "reasoning_tokens": 0
        },
        "total_tokens": 80
    },
    "user": null,
    "metadata": {}
}
Modified at 2026-02-08 06:57:56
Previous
Creation complete
Next
GPTs Dialogue
Built with