Mindlogic Logo
Docs

API 레퍼런스

OpenAI Responses API

요약

OpenAI의 최신 Responses API를 지원하는 엔드포인트입니다.
o-시리즈 추론 모델, Codex 코드 생성 모델(gpt-5.2-codex, gpt-5.1-codex-max) 등 Responses API 전용 모델을 사용하려면 이 엔드포인트를 이용해주세요. 백그라운드 실행과 폴링을 통한 장시간 작업도 지원합니다.
  • 공식 레퍼런스: OpenAI Responses API
Responses API는 messages 대신 input을, max_tokens 대신 max_output_tokens를 사용합니다. OpenAI 모델만 지원됩니다.

응답 생성

POST
/v1/gateway/responses/
OpenAI Responses API 형식으로 응답을 생성합니다.

추가 엔드포인트

MethodPath설명
GET/v1/gateway/responses/{id}/백그라운드 응답 폴링
POST/v1/gateway/responses/{id}/cancel/백그라운드 응답 취소

파라미터

model
string
required
OpenAI 모델 이름.
input
array
required
입력 메시지 (role + content).
instructions
string
시스템 프롬프트 대체. input 전에 적용됩니다.
max_output_tokens
integer
최대 출력 토큰 (기본값: 4096).
stream
boolean
SSE 스트리밍 활성화.
reasoning
object
추론 설정: {"effort": "low" | "medium" | "high", "summary": "auto" | "none"}.
text
object
구조화된 출력을 위한 출력 형식 설정.
background
boolean
백그라운드 작업으로 실행 — 즉시 반환 후 폴링.
previous_response_id
string
다중 턴 대화를 위한 응답 체이닝.

응답 형식

json

{
  "id": "resp_abc123",
  "object": "response",
  "created_at": 1720000000,
  "status": "completed",
  "model": "gpt-5.2",
  "output": [
    {
      "type": "message",
      "id": "msg_abc",
      "role": "assistant",
      "content": [
        {"type": "output_text", "text": "The answer is 42."}
      ]
    }
  ],
  "usage": {
    "input_tokens": 25,
    "output_tokens": 30,
    "output_tokens_details": {
      "reasoning_tokens": 512
    }
  }
}

사용 예제

python

import httpx

BASE = "https://factchat-cloud.mindlogic.ai/v1/gateway"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}

# 응답 생성
r = httpx.post(f"{BASE}/responses/", json={
    "model": "gpt-5.2-codex",
    "input": [{"role": "user", "content": "Analyze this dataset..."}],
}, headers=HEADERS, timeout=120.0)
data = r.json()

if data["status"] == "completed":
    print(data["output"][-1]["content"][0]["text"])

지원 모델

패밀리예시비고
Codex 시리즈gpt-5.2-codex, gpt-5.1-codex-maxResponses API 전용 — Chat Completions에서 사용 시 404 반환
Standardgpt-5.2, gpt-5.1, gpt-5Chat Completions로도 사용 가능

제한 사항

  • OpenAI 모델만 지원됩니다
  • Anthropic 모델은 Messages API를 사용하세요
  • Codex 모델(gpt-5.2-codex, gpt-5.1-codex-max)은 이 엔드포인트에서만 지원됩니다 — /chat/completions/에서 사용하면 404가 반환됩니다

마지막 수정 날짜: Feb 24, 2026

이전

/messages

다음

/audio/speech