メインコンテンツへスキップ
The Responses API is OpenAI’s newer stateful conversation API. LemonData supports this format as an advanced optional path for compatible models; use POST /v1/chat/completions as the default OpenAI-compatible route unless you explicitly need Responses-specific behavior.

リクエストボディ

model
string
必須
使用するモデルの ID。利用可能なオプションは Models を参照してください。
input
array
必須
会話を構成する入力アイテムのリスト。各アイテムは次のいずれかになります:
  • message: ロールとコンテンツを持つ会話メッセージ
  • function_call: 関数呼び出しのリクエスト
  • function_call_output: 関数呼び出しからの出力
マルチモーダル入力の場合、message.content はプレーンな文字列かコンテンツブロックの配列のいずれかになります。GPT-5.4 系列のような画像対応モデルでは、URL や Base64 文字列をプレーンテキストに直接埋め込むのではなく、input_image ブロックとして画像を渡してください。Example content blocks:
  • { "type": "input_text", "text": "Describe this image" }
  • { "type": "input_image", "image_url": "https://example.com/image.jpg" }
  • { "type": "input_image", "image_url": "data:image/png;base64,..." }
instructions
string
モデルへのシステム指示(system message と同等)。
max_output_tokens
integer
生成する最大の token 数。
temperature
number
デフォルト:"1"
サンプリングの温度。0 から 2 の間で指定します。
tools
array
モデルが呼び出す可能性のあるツールのリスト。
stream
boolean
デフォルト:"false"
true の場合、イベントのストリームを返します。
previous_response_id
string
会話を続けるための前回のレスポンスの ID。
store
boolean
デフォルト:"true"
後で取得するためにレスポンスを保存するかどうか。
metadata
object
追跡目的でレスポンスに添付するメタデータ。
text
object
テキスト生成の設定オプション。text.format の挙動は選択したモデルと経路によって異なり、すべてのモデルで一様に保証されるわけではありません。
parallel_tool_calls
boolean
デフォルト:"true"
複数のツール呼び出しを並列で許可するかどうか。
top_p
number
Nucleus サンプリングのパラメータ(0〜1)。
reasoning
object
GPT-5 系列などの推論対応モデル向けの推論設定。
  • effort (string): 推論の努力レベル(lowmediumhigh

レスポンス

id
string
レスポンスの一意の識別子。
object
string
常に response です。
created
integer
レスポンスが作成された時刻の Unix タイムスタンプ。
output
array
モデルが生成した出力アイテムのリスト。
usage
object
token 使用統計。
curl -X POST "https://api.lemondata.cc/v1/responses" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "input": [
      {"type": "message", "role": "user", "content": "Hello!"}
    ],
    "max_output_tokens": 1000
  }'
{
  "id": "resp_abc123",
  "object": "response",
  "created": 1706000000,
  "model": "gpt-4o",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        {"type": "text", "text": "Hello! How can I help you today?"}
      ]
    }
  ],
  "usage": {
    "input_tokens": 10,
    "output_tokens": 12,
    "total_tokens": 22
  }
}