Skip to main content
POST
/
v1
/
responses
curl -X POST https://qingbo.dev/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5",
    "input": "解释一下冒泡排序算法。"
  }'
{
  "id": "resp_09e342953eda0be6006905acbcvoik1nhmezpmzzl7lex552vq",
  "object": "response",
  "created_at": 1761979488,
  "model": "gpt-5-2025-08-07",
  "status": "completed",
  "output": [
    {
      "id": "rs_09e342953eda0be6006905ac62b6f48197aefa292b7dcdd477",
      "type": "reasoning",
      "summary": []
    },
    {
      "id": "msg_09e342953eda0be6006905ac649e0081979f9859a09c70d4db",
      "type": "message",
      "role": "assistant",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "一幅温暖的插画:一只灰色虎斑猫正抱着一只带红色围巾的水獭,两只动物都闭着眼微笑,呈现亲密友好的场景。",
          "annotations": [],
          "logprobs": []
        }
      ]
  }
],
"usage": {
    "input_tokens": 642,
    "output_tokens": 184,
    "total_tokens": 826,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens_details": {
      "reasoning_tokens": 128
    }
  },
  "reasoning": {
    "effort": "medium",
    "summary": null
  },
  "temperature": 1,
  "top_p": 1,
  "tool_choice": "auto",
  "tools": [],
  "parallel_tool_calls": true,
  "store": true,
  "service_tier": "default",
  "truncation": "disabled",
  "background": false,
  "content_filters": null,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "max_tool_calls": null,
  "metadata": {},
  "previous_response_id": null,
  "prompt_cache_key": null,
  "safety_identifier": null,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "top_logprobs": 0,
  "user": null
}
  • Fully compatible with the OpenAI Responses API format
  • Supports multimodal input with text and images
  • Supports tool extensions: web search, file search, function calling, remote MCP
curl -X POST https://qingbo.dev/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5",
    "input": "解释一下冒泡排序算法。"
  }'
{
  "id": "resp_09e342953eda0be6006905acbcvoik1nhmezpmzzl7lex552vq",
  "object": "response",
  "created_at": 1761979488,
  "model": "gpt-5-2025-08-07",
  "status": "completed",
  "output": [
    {
      "id": "rs_09e342953eda0be6006905ac62b6f48197aefa292b7dcdd477",
      "type": "reasoning",
      "summary": []
    },
    {
      "id": "msg_09e342953eda0be6006905ac649e0081979f9859a09c70d4db",
      "type": "message",
      "role": "assistant",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "一幅温暖的插画:一只灰色虎斑猫正抱着一只带红色围巾的水獭,两只动物都闭着眼微笑,呈现亲密友好的场景。",
          "annotations": [],
          "logprobs": []
        }
      ]
  }
],
"usage": {
    "input_tokens": 642,
    "output_tokens": 184,
    "total_tokens": 826,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens_details": {
      "reasoning_tokens": 128
    }
  },
  "reasoning": {
    "effort": "medium",
    "summary": null
  },
  "temperature": 1,
  "top_p": 1,
  "tool_choice": "auto",
  "tools": [],
  "parallel_tool_calls": true,
  "store": true,
  "service_tier": "default",
  "truncation": "disabled",
  "background": false,
  "content_filters": null,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "max_tool_calls": null,
  "metadata": {},
  "previous_response_id": null,
  "prompt_cache_key": null,
  "safety_identifier": null,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "top_logprobs": 0,
  "user": null
}

Authorizations

Authorization
string
required
All endpoints require Bearer Token authenticationObtain an API Key:Visit the API Key management page to get your API KeyAdd the following to your request headers:
Authorization: Bearer YOUR_API_KEY

Body

model
string
required
Model nameSupported models include:
  • gpt-5 - OpenAI latest multimodal model
  • gpt-4o - GPT-4 optimized multimodal model
  • gpt-4-vision - GPT-4 vision understanding model
  • More models are continuously being added…
input
string or array
required
Input content, supports a string or message arrayString form is for simple text input; array form supports multi-turn conversations and multimodal content:
tools
array
Tool list, optional configurationSupported tool types:
  • web_search - Web search
  • file_search - File search
  • function - Function calling
  • remote_mcp - Remote MCP service
temperature
number
Controls output randomness, range 0-2Default: 1.0
max_tokens
integer
Maximum number of tokens to generate
stream
boolean
Whether to enable streaming outputDefault: false

Response

id
string
Unique identifier for the response
object
string
Object type, always response
created_at
integer
Creation timestamp
model
string
The model name actually used (e.g., gpt-5-2025-08-07)
status
string
Response statusPossible values:
  • completed - Completed
  • in_progress - In progress
  • failed - Failed
  • cancelled - Cancelled
output
array
Output content array
usage
object
Token usage statistics
reasoning
object
Reasoning configuration (thinking models only)
temperature
number
Actual sampling temperature used
top_p
number
Actual nucleus sampling parameter used
tool_choice
string
Tool selection strategy
tools
array
List of tools used
parallel_tool_calls
boolean
Whether parallel tool calls are allowed
store
boolean
Whether conversation history is stored
service_tier
string
Service tier
truncation
string
Truncation strategy
text
object
Text format configuration
background
boolean
Whether this is a background task
error
object
Error information (if any)
metadata
object
Metadata

Usage Examples

Image Analysis

{
  "model": "gpt-5",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "这张图片里有什么?请详细描述"
        },
        {
          "type": "input_image",
          "image_url": "https://example.com/image.jpg"
        }
      ]
    }
  ]
}

Video Analysis

{
  "model": "gemini-2.5-pro",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "分析一下这个视频的内容"
        },
        {
          "type": "input_video",
          "video_url": "https://example.com/video.mp4"
        }
      ]
    }
  ],
  "max_tokens": 5000
}

Using Web Search Tool

{
  "model": "gpt-5",
  "tools": [
    {"type": "web_search"}
  ],
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "2025年最新的AI技术趋势是什么?"
        }
      ]
    }
  ]
}

Using Function Calling

{
  "model": "gpt-5",
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "获取城市天气信息",
        "parameters": {
          "type": "object",
          "properties": {
            "city": {
              "type": "string",
              "description": "城市名称,例如:北京"
            }
          },
          "required": ["city"]
        }
      }
    }
  ],
  "input": "北京今天天气怎么样?"
}

Content Type Reference

input_text

Text input type Properties:
  • type: Always "input_text"
  • text: Text content (string)

input_image

Image input type Properties:
  • type: Always "input_image"
  • image_url: Image URL or Base64-encoded data URI
Supported image formats:
  • JPEG
  • PNG
  • GIF
  • WebP
Image size limits:
  • Maximum file size: 20MB
  • Recommended resolution: up to 2048x2048 pixels

input_video

Video input type (supported by some models) Properties:
  • type: Always "input_video"
  • video_url: Video URL
Supported video formats:
  • MP4
  • MOV
  • AVI
  • WebM
Video size limits:
  • Maximum file size: 200MB
  • Maximum duration: 10 minutes
  • Recommended resolution: 1080p

Tool Usage Details

The web search tool enables models to access real-time internet information. Configuration example:
{
  "tools": [{"type": "web_search"}]
}
Use cases:
  • Querying latest news and current events
  • Retrieving real-time data (stocks, weather, exchange rates, etc.)
  • Searching for the latest technical documentation and resources
  • Verifying factual information
The file search tool allows models to search within uploaded documents for relevant information. Configuration example:
{
  "tools": [{"type": "file_search"}]
}
Use cases:
  • Analyzing internal enterprise documents
  • Searching technical specifications and manuals
  • Querying contracts and legal documents
  • Knowledge base Q&A systems

Function Calling

Define custom functions to enable models to call external APIs or perform specific operations. Full configuration example:
{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_stock_price",
        "description": "获取股票的实时价格",
        "parameters": {
          "type": "object",
          "properties": {
            "symbol": {
              "type": "string",
              "description": "股票代码,例如:AAPL"
            },
            "currency": {
              "type": "string",
              "enum": ["USD", "CNY"],
              "description": "货币单位",
              "default": "USD"
            }
          },
          "required": ["symbol"]
        }
      }
    }
  ]
}
Parameter descriptions:
  • name: Function name (required)
  • description: Function description (required)
  • parameters: Parameter definitions in JSON Schema format
    • type: Parameter type
    • properties: Parameter property definitions
    • required: Required parameter list
Use cases:
  • Calling third-party APIs
  • Executing database queries
  • Triggering business workflows
  • Integrating with internal systems

Remote MCP

Connect to remote Model Context Protocol (MCP) services to extend model capabilities. Configuration example:
{
  "tools": [
    {
      "type": "remote_mcp",
      "remote_mcp": {
        "url": "https://your-mcp-server.com/api",
        "auth_token": "your_auth_token",
        "timeout": 30
      }
    }
  ]
}
Parameter descriptions:
  • url: MCP server address (required)
  • auth_token: Authentication token (optional)
  • timeout: Timeout in seconds, default 30
Use cases:
  • Connecting to enterprise AI services
  • Using specialized domain models
  • Accessing protected data sources
  • Distributed AI system integration

Tool Response Format

When the model uses tools, the response format includes tool call information:
{
  "id": "resp-123456",
  "object": "response",
  "created": 1677652288,
  "model": "gpt-5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": null,
        "tool_calls": [
          {
            "id": "call_abc123",
            "type": "function",
            "function": {
              "name": "get_weather",
              "arguments": "{\"city\": \"北京\"}"
            }
          }
        ]
      },
      "finish_reason": "tool_calls"
    }
  ]
}
Tool calling workflow:
  1. Model receives user input
  2. Analyzes whether tool usage is needed
  3. If needed, returns a tool call request
  4. Client executes the tool call
  5. Tool result is sent back to the model
  6. Model generates the final response

Important Notes

  1. Image URL requirements:
    • Must be publicly accessible URLs
    • Or use Base64-encoded Data URI format
  2. Token billing:
    • Images consume tokens based on their resolution
    • High-resolution images are automatically resized to optimize costs
    • Tool calls also consume additional tokens
  3. Content ordering:
    • The order of elements in the content array affects model understanding
    • It is recommended to place text instructions before images/videos
  4. Multimodal combinations:
    • Multiple text and image inputs can be mixed in a single request
    • Multi-turn conversations are supported, maintaining contextual coherence
  5. Tool usage limits:
    • When using multiple tools simultaneously, the model intelligently selects the most appropriate tool
    • Function calls require clear function definitions and parameter descriptions
    • Web search results may be subject to geographic and temporal limitations
  6. API compatibility:
    • Fully compatible with the OpenAI Responses API format
    • Seamless migration of existing OpenAI code
    • Supports all OpenAI tool extension features