PoloAPI 接口文档
首页Polo首页
首页Polo首页
  1. Openai
  • 模型接口
    • 调用基础
      • 常见问题及解决办法
      • 批量请求示例
    • Openai
      • 文本生成
        POST
      • 文本生成---上下文阅读
        POST
      • 图片理解
        POST
      • 图片生成(gpt-image-1)
        POST
      • 图片编辑/edits
        POST
      • 图片编辑 / 网页版
        POST
      • 函数调用 tools
        POST
      • v1/Responses / 通用
        POST
      • 创建文本嵌入
        POST
      • 批量创建嵌入
        POST
      • 文本转语音 / TTS
        POST
      • 语音转文本 / whisper-1
        POST
      • 语音转文本 / gpt-4o-transcribe
        POST
      • 音频翻译
        POST
      • Audio接口 / 输出
        POST
      • Audio接口 / 输入
        POST
      • 内容补全接口
        POST
      • 创建内容审核
        POST
      • PDF文件分析
        POST
      • deep-research / 深度研究
        POST
      • Web search / 联网搜索
        POST
      • response_format
        POST
    • Anthropic Claude
      • 原生接口
        • 文本生成
        • 图片理解
        • 文本生成 / 强制返回思考
        • 函数调用
        • Web search / 联网搜索
        • 文本生成 (思考配置)
      • OpenAI兼容接口
        • 文本生成
        • 图片理解
        • 文本生成 / 强制返回思考
        • 函数调用
        • Web search / 联网搜索
    • Google Gemini
      • OpenAI兼容接口(推荐)
        • 文本生成
        • 文本生成 / 强制返回思考
        • 图片理解
        • 图片生成
        • 图片修改
        • 图片生成 / Imagen 4
        • 音频理解
        • 视频理解
        • 文本转语音 / TTS
        • 图片编辑(Nano-banana)
        • 图片编辑(Nano-banana) base64格式
      • Google Gemini接口
        • 文本生成
        • 文字转语音
        • 音频转文
        • 视频转文
        • 图片理解
        • 图片编辑(gemini-2.5-flash-image-preview)
    • Midjourney
      • Openai兼容/chat格式
        • MJ视频 (chat格式)
      • 原生接口
        • 文生图(Imagine)
        • 图片融合(Blend)
        • 按钮点击(Action)
        • 窗口执行(Modal)
        • 生成视频(Video)
        • 图生文(Describe)
        • 编辑图片(Edit)
        • 上传(upload)
        • 换脸(FaceSwap)
        • 缩短提示词(Shorten)
        • 查询
        • 获取种子(Seed)接口
        • 批量查询
        • 文生图 / OpenAI兼容
    • 文生图接口
      • flux / OpenAI兼容接口
      • flux-kontext-pro / OpenAI兼容接口
      • stable-diffusion / OpenAI兼容接口
      • ideogram / OpenAI兼容接口
      • recraftv3 / OpenAI兼容接口
      • flux携带参考图 / OpenAI兼容接口
    • Suno
      • 生成歌曲
      • 生成歌词
      • 查询任务状态(批量)
      • 查询任务状态(单个)
    • 3D模型
      • Hunyuan3D-2
    • veo
      • 图生视频
      • 文生视频
      • 查询视频生成状态
      • 图生视频(chat格式)
    • FLUX
      • /fal-ai/nano-banana 文生图
      • /fal-ai/nano-banana/edit 图片编辑
    • 豆包
      • doubao-seedream-4-0-250828-文生图
      • doubao-seedream-4-0-250828-图生图
      • doubao-seedream-4-0-250828-多图生图
  1. Openai

response_format

正式环境
https://poloai.top
正式环境
https://poloai.top
POST
https://poloai.top
/v1/chat/completions
最后修改时间:2025-07-19 02:59:00
官方结构化输出

请求参数

Header 参数

Body 参数application/json

示例
{
  "model": "gpt-4o-2024-08-06",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful math tutor."
    },
    {
      "role": "user",
      "content": "solve 8x + 31 = 2"
    }
  ],
  "response_format": {
    "type": "json_schema",
    "json_schema": {
      "name": "math_response",
      "strict": true,
      "schema": {
        "type": "object",
        "properties": {
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "explanation": {
                  "type": "string"
                },
                "output": {
                  "type": "string"
                }
              },
              "required": ["explanation", "output"],
              "additionalProperties": false
            }
          },
          "final_answer": {
            "type": "string"
          }
        },
        "required": ["steps", "final_answer"],
        "additionalProperties": false
      }
    }
  }
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://poloai.top/v1/chat/completions' \
--header 'Accept;' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "gpt-4o-2024-08-06",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful math tutor."
    },
    {
      "role": "user",
      "content": "solve 8x + 31 = 2"
    }
  ],
  "response_format": {
    "type": "json_schema",
    "json_schema": {
      "name": "math_response",
      "strict": true,
      "schema": {
        "type": "object",
        "properties": {
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "explanation": {
                  "type": "string"
                },
                "output": {
                  "type": "string"
                }
              },
              "required": ["explanation", "output"],
              "additionalProperties": false
            }
          },
          "final_answer": {
            "type": "string"
          }
        },
        "required": ["steps", "final_answer"],
        "additionalProperties": false
      }
    }
  }
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "id": "chatcmpl-123",
    "object": "chat.completion",
    "created": 1677652288,
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "\n\nHello there, how may I assist you today?"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 9,
        "completion_tokens": 12,
        "total_tokens": 21
    }
}
修改于 2025-07-19 02:59:00
上一页
Web search / 联网搜索
下一页
文本生成
Built with