Skip to content

Responses

文本请求

bash
curl --request POST \
  --url https://api.uniapi.io/v1/responses \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <your-api-key>' \
  --data '{
    "model": "gpt-4.1",
    "input": "Tell me a three sentence bedtime story about a unicorn."
  }'

图像输入(示例)

bash
curl --request POST \
  --url https://api.uniapi.io/v1/responses \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <your-api-key>' \
  --data '{
    "model": "gpt-4.1",
    "input": [
      {
        "role": "user",
        "content": [
          {"type": "input_text", "text": "what is in this image?"},
          {"type": "input_image", "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"}
        ]
      }
    ]
  }'

工具:web_search_preview

bash
curl --request POST \
  --url https://api.uniapi.io/v1/responses \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <your-api-key>' \
  --data '{
    "model": "gpt-4.1",
    "tools": [{"type": "web_search_preview"}],
    "input": "What was a positive news story from today?"
  }'

推理参数(reasoning)

bash
curl --request POST \
  --url https://api.uniapi.io/v1/responses \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <your-api-key>' \
  --data '{
    "model": "o3-mini",
    "input": "How much wood would a woodchuck chuck?",
    "reasoning": {"effort": "high"}
  }'

相关内容