Key4U
Trang chủGiá cảDanh sách modelĐăng nhậpĐăng ký
Trang chủGiá cảDanh sách modelĐăng nhậpĐăng ký
  1. Chat (Responses)
  • Giới thiệu
  • Liên hệ
  • Bắt đầu nhanh với API
  • Bảng So Sánh Nhóm API
  • Tính Đặc Thù của Nhóm API & Khác Biệt Về Giá
  • Chat
    • ChatGpt interface
      • ChatGPT Audio (Audio)
        • GPT-4o-audio
        • Audio to text whisper-1
        • Audio to text gpt-4o-transcribe
        • Create voice gpt-4o-mini-tts
        • Create translation (not supported)
      • ChatGPT Chat (Chat)
        • Chat completion object
        • Chat completion block object
        • Create chat completion (streaming)
        • Create chat completion (non-stream)
        • Create chat image recognition (streaming)
        • Create chat image recognition (streaming) best64
        • Create chat image recognition (non-stream)
        • Create chat-generated image (non-stream)
        • Official Function calling invocation
        • Official N Test
        • List models
        • Create chat function call
        • Create structured output
        • Control the effort level of the reasoning model
        • Create chat completion qwen-mt-turbo
        • Create chat completion deepseek v3.1 thinking level (streaming)
        • deepseek-ocr recognition
      • ChatGPT Auto Completion (Completions)
        • Complete object
        • Creation completed
      • ChatGPT Embeddings
        • Embedded Object
        • Create Embedding
      • Web search
        • web search
    • Anthropic Claude interface
      • Chat completion object
      • Chat completion block object
      • Create chat completion (streaming) [native format]
      • Create function call (streaming) [native format]
      • Create thinking chat [native format]
      • Create thinking chat
      • Create chat completion (streaming)
      • Create chat completion (non-stream)
      • Create chat image recognition (streaming)
      • Create chat image recognition (non-stream)
      • PDF support [native format]
      • PDF support [native format] base64 format
    • Google Gemini Interface
      • Native format
        • Text Generation
        • text generation-stream
        • Text Generation + Reasoning - Stream
        • Image generation
        • Image generation gemini-2.5-flash-image
        • Image generation gemini-2.5-flash-image controls aspect ratio
        • Image generation gemini-3-pro-image-preview aspect ratio control + clarity
        • Image editing
        • Image Understanding
        • Formatted output
        • Function call
        • Document Understanding
        • URL context [native format]
        • Code execution
        • google search
        • Video Understanding
        • URL context
        • Video Understanding - URL [Native Format] In Development
        • Imagen 4 in development
        • Audio Understanding
        • Embeddings
      • chat compatible format
        • gemini image creation interface [chat compatible format]
        • Chat Interface [chat-compatible format]
        • Chat Interface - Thinking 1 [chat compatible format]
        • Chat Interface - Thinking 2 [chat compatible format]
        • Image recognition interface [chat-compatible format]
        • Chat + Read File Interface [chat-compatible format]
  • Chat (Responses)
    • Comparison between Responses API and Chat API
    • Create Model Response
      POST
    • Create function call
      POST
    • Create model response (streaming return)
      POST
    • Create model response (control thought length)
      POST
    • Create network search
      POST
    • Create model response gpt-5 enable thinking
      POST
    • Create function call Copy
      POST
  • painting model
    • README
    • image object
    • Midjourney
      • Upload image
      • Submit Imagine task
      • Query task status by task ID
      • Query tasks by ID list
      • Get the seed of the task image
      • Execute Action
      • Submit Blend Task
      • Submit Describe Task
      • Submit Modal
    • Ideogram
      • Generate 3.0 (Text-to-Image) Generate
      • Generate 3.0 (Image Editing) Edit
      • Generate 3.0 (Image Remix)
      • Generate 3.0 (Image Reconstruction) Reframe
      • Generate 3.0 (Replace Background) Replace Background
      • ideogram (text-to-image)
      • Remix (Mixed Graph)
      • Upscale (magnify HD)
      • Describe
    • GPT Image-1
      • Create gpt-image-1
      • Edit gpt-image-1
      • mask gpt-image-1
    • Dream Drawing
      • Create Drawing
      • Edit Image
    • DALL·E 3
      • Create DALL·E 3
    • FLUX series
      • gpt compatible format
        • Flux creation (OpenAI dall-e-3 format)
        • Flux editing (OpenAI dall-e-3 format)
      • Official Replicate format
        • Flux resolution
        • Access Tutorial
        • Create task black-forest-labs/flux-kontext-dev
        • Query task
    • Doubao series
      • doubao-seedream-3-0-t2i-250415
      • doubao-seededit-3-0-i2i-250628
      • doubao-seedream-4-0-250828-text-to-image
      • doubao-seedream-4-0-250828-image-to-image
      • doubao-seedream-4-0-250828-multi-image-to-image
    • Fal.ai Platform
      • status code
      • Get request result
      • /fal-ai/nano-banana Text-to-Image
      • /fal-ai/nano-banana/edit Image Editing
    • Qwen-Image series
      • qwen-image-edit-2509
  • video model
    • veo video generation
      • Unified Video Format
        • status code
        • Create Video
        • Create video with image
        • Query task
        • Create video (reference image)
      • OpenAI video format
        • openai create video, with image
        • openai query task
        • openai download video
    • luma video generation
      • Official API Format
        • status code
        • Submit video generation task
        • Extended video
      • Query task
        • Query a single task
        • Batch get tasks
    • Kling Kuaishou Ke Ling
      • Callback protocol
      • image generation
      • Text-to-video
      • Image to Video
      • Query task (free)
      • Multiple image reference live video
      • Virtual Try-On
      • lip sync
      • Video extension
      • Video Effects
    • Runway video generation
      • status code
      • Submit video generation task
      • Query video task (free)
    • Video generation by Jimeng
      • status code
      • Submit video generation task
      • Query video task (free)
    • Video Generation by Conch
      • status code
      • Submit video generation task
      • Video Task Status Query
      • Image to Video
      • First and last frame video
    • Video Generation by Doubao
      • Example of text-to-video generation
      • Image to Video - First Frame
      • seedance-lite-first-and-last-frame
      • Image to video - base64 encoded
      • seedance-lite-reference image
      • Query a single task
      • Query video generation task list - default
      • Query video generation task list - search multiple task IDs
    • sora video generation
      • Unified Video Format
        • Query task
        • Create video with image sora-2
        • Create video sora-2
        • Create video sora-2-pro
        • Create video (with Character)
      • chat format
        • Create Video
        • Create video, with image
        • Continuous modification generates video
      • OpenAI official video format
        • openai query task
        • openai download video
        • openai create video, with image
        • openai create video, with images private mode
        • openai create video (with Character)
        • openai edit video
      • Create Role
    • Qwen Video Generation
      • Generate video
      • Video Query
  • GPTs Related
    • Introduction
    • GPTs conversation
  • System API
    • Get token list
    • Add new token
    • Get token support model
    • Get account information
    • Modify token
    • Search token
    • Delete token
  • Text-to-Music Suno
    • parameter
    • Description
    • Task submission
      • Generate Song (Inspiration Mode)
      • Generate Song (Custom Mode)
      • Generate Song (Continuation Mode)
      • Generate song (singer style)
      • Generate song (upload song for secondary creation)
      • Generate song (concatenate song)
      • Generate lyrics
      • Song Splicing
    • Query Interface
      • Batch get tasks
      • Query a single task
      • Get wav
  • Python configuration method
    • python uses speech-to-text
    • python use text to speech
    • python uses Embeddings for vectorization
    • python calls DALL·E
    • python simple call openai function-calling demo
    • Simple langchain calling openai demo
    • python llama_index configuration
    • Python Basic Dialogue
    • Python uses gpt-4o to recognize images - local images
    • Python uses gpt-4o to recognize images
    • Python uses Claude to identify images
    • python library stream output
    • gpt realtime model call
    • python request stream output demo
    • python uses gpt-image-1 to create and edit images
    • python openai official library (using AutoGPT, langchain, etc.)
    • python continuous dialogue
  • Rerank model
    • Reordering
  • Replicate Aggregation Platform
    • Access Tutorial
    • Flux Resolution
    • Query task
    • Create task - via model version (predictions)
    • Create task stability-ai/stable-diffusion
    • Create task stability-ai/sdxl
    • Create task stability-ai/stable-diffusion-inpainting
    • Create task stability-ai/stable-diffusion-img2img
    • Create task lucataco/flux-schnell-lora
    • Create task lucataco/flux-dev-lora
    • Create task andreasjansson/stable-diffusion-animation
    • Create task sujaykhandekar/object-removal
    • Create task cjwbw/rembg
    • Create task lucataco/animate-diff
    • Create task ideogram-ai/ideogram-v2-turbo
    • Create task black-forest-labs/flux-kontext-dev
    • 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 lucataco/remove-bg
    • 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
  • Fal-ai Aggregate Platform
    • Access 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 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
    • /fal-ai/kling-video/v2.5-turbo/pro/text-to-video
    • /fal-ai/qwen-image-edit-lora
  • PHP configuration method
    • PHP image editing demo
  • Node.js configuration method
    • Node.js basic dialogue
  • Tutorials for using various plugins/software
    • Hướng dẫn cấu hình Codex
    • Hướng dẫn cài đặt và sử dụng Claude Code
    • Hướng dẫn sử dụng với Dify
    • Hướng dẫn cấu hình Cline
    • Sử dụng với Aider AI (Terminal Coding)
    • Hướng dẫn sử dụng LobeChat
    • Sử dụng trong extension trình duyệt ChatGPT Sidebar
    • Hướng dẫn cấu hình ChatGPT GPT Academic để tối ưu cho học thuật
  • Help Center
    • AI response field: Thinking related
    • HTTP status codes and their meanings
    • Self-hosted image hosting API
    • Upload image to image hosting service
  1. Chat (Responses)

Create function call

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

Request

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

Body Params application/json

Example
{
    "input": [
        {
            "role": "user",
            "content": "Please help me do the following tasks at the same time:\n1. Get the current system time\n2. View system information (operating system, memory, etc.)\n3. Calculate the result of 123.5 + 456.7 for me\n4. Generate 3 random numbers between 1 and 100\n\nThis is a parallel tool call 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, supports 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 of values to generate (default 1, maximum 10)",
                        "type": "integer"
                    }
                }
            }
        },
        {
            "type": "function",
            "name": "system_info",
            "description": "Get basic system information including operating system, Java version, memory usage, etc.",
            "parameters": {
                "type": "object",
                "properties": {}
            }
        },
        {
            "type": "function",
            "name": "math_calculator",
            "description": "Perform basic mathematical operations including addition, subtraction, multiplication, division, and exponentiation",
            "parameters": {
                "type": "object",
                "properties": {
                    "a": {
                        "description": "First number",
                        "type": "number"
                    },
                    "b": {
                        "description": "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": {}
            }
        }
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.key4u.shop/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 tasks at the same time:\n1. Get the current system time\n2. View system information (operating system, memory, etc.)\n3. Calculate the result of 123.5 + 456.7 for me\n4. Generate 3 random numbers between 1 and 100\n\nThis is a parallel tool call 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, supports 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 of values to generate (default 1, maximum 10)",
                        "type": "integer"
                    }
                }
            }
        },
        {
            "type": "function",
            "name": "system_info",
            "description": "Get basic system information including operating system, Java version, memory usage, etc.",
            "parameters": {
                "type": "object",
                "properties": {}
            }
        },
        {
            "type": "function",
            "name": "math_calculator",
            "description": "Perform basic mathematical operations including addition, subtraction, multiplication, division, and exponentiation",
            "parameters": {
                "type": "object",
                "properties": {
                    "a": {
                        "description": "First number",
                        "type": "number"
                    },
                    "b": {
                        "description": "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": {}
            }
        }
    ]
}'

Responses

🟢200OK
application/json
Body

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.0,
  "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.0,
  "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 2025-12-02 13:49:34
Previous
Create Model Response
Next
Create model response (streaming return)
Built with