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 형식으로 응답을 생성합니다.
추가 엔드포인트
| Method | Path | 설명 |
|---|---|---|
| GET | /v1/gateway/responses/{id}/ | 백그라운드 응답 폴링 |
| POST | /v1/gateway/responses/{id}/cancel/ | 백그라운드 응답 취소 |
파라미터
modelstring
required
inputarray
required
role + content).instructionsstring
input 전에 적용됩니다.max_output_tokensinteger
streamboolean
reasoningobject
{"effort": "low" | "medium" | "high", "summary": "auto" | "none"}.textobject
backgroundboolean
previous_response_idstring
응답 형식
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-max | Responses API 전용 — Chat Completions에서 사용 시 404 반환 |
| Standard | gpt-5.2, gpt-5.1, gpt-5 | Chat Completions로도 사용 가능 |
제한 사항
- OpenAI 모델만 지원됩니다
- Anthropic 모델은 Messages API를 사용하세요
- Codex 모델(
gpt-5.2-codex,gpt-5.1-codex-max)은 이 엔드포인트에서만 지원됩니다 —/chat/completions/에서 사용하면 404가 반환됩니다
마지막 수정 날짜: Feb 24, 2026