OpenAI: GPT-4 Turbo (batch)
GPT-4 Turbo는 텍스트와 이미지를 입력받아 문서, 시각, 코딩 작업용 텍스트를 반환합니다. 개발사 사양은 128,000토큰의 컨텍스트 창과 4,096토큰의 출력 한도, 스트리밍, 함수 호출을 결합합니다.
모델 소개
이 설명은 모델의 기능을 다룹니다. Ailoot에서 사용할 수 있는 입력, 출력 및 옵션은 아래에 선택한 메서드별로 표시됩니다.
GPT-4 Turbo는 텍스트·시각 입력과 텍스트 출력을 위한 OpenAI의 GPT-4 계열 모델입니다. 현재 개발사 Turbo 카드는 미리보기 이름을 구분하면서 시각 이해 기능이 있는 모델을 가리킵니다. 제공된 문서, 이미지, 글과 시각적 근거의 조합에 관한 질문에 사용할 수 있습니다.
문서 작업에는 관련 절과 해당 절이 답해야 할 질문을 제공하세요. 예를 들어 절차를 요구 사항 집합과 비교한 뒤 일치점, 차이점, 미해결 질문을 간결하게 설명하도록 요청할 수 있습니다. 어떤 원본이 우선하는지, 독자를 위해 결과를 재작성할 때 유지해야 할 사실이 무엇인지 지정하세요.
시각 작업에는 스크린샷, 사진, 도표를 제공하고 중요한 세부 사항을 명시합니다. 이미지만으로 사용자의 목표나 레이블의 의미를 확인할 수 없다면 글로 된 맥락을 포함하세요. 지원 답변 제안은 관련 관찰에 부족한 정보를 해결할 질문을 결합할 수 있습니다. 코드 질문에는 구현과 설명하거나 바꿀 동작을 포함할 수 있습니다.
OpenAI는 128,000토큰의 컨텍스트 창, 4,096토큰의 최대 출력, 2023년 12월 1일의 지식 기준일을 명시합니다. 비교적 짧은 출력 한도 때문에 요청한 산출물이 중요합니다. 작업에 실제로 필요한 답변, 절, 결과 집합을 요청하세요. 원본 자료와 생성된 응답은 사용 가능한 컨텍스트를 공유합니다.
원본 개발사 카드는 스트리밍과 함수 호출을 지원하고 스키마 기반 Structured Outputs, 파인 튜닝, Predicted Outputs는 지원하지 않는다고 명시합니다. JSON 모드 지침은 유효한 JSON 응답을 위한 GPT-4 모델 계열을 나열하며, 해당 모드는 특정 스키마를 보장하지 않습니다. 애플리케이션은 반환된 필드를 확인하고 설명된 작업을 실행한 뒤 후속 요청에 실제 도구 결과를 반환합니다.
독자, 어조, 완료 기준을 정의하세요. 분석 결과에는 원본 사실, 결론, 해결되지 않은 조건을 구분합니다. 편집한 문서에는 유지해야 할 의미와 용어를 지정하세요. 유용한 최종 산출물은 중요한 진술을 원본 자료와 대조하고 후속 메시지에서 다듬을 수 있는 집중된 응답이나 절입니다.
Ailoot Ultra · 배치 POST /v1/batches openai/gpt-4-turbo:batch
openai/gpt-4-turbo:batch시작하기
GPT-4 Turbo는 텍스트와 이미지를 입력받아 문서, 시각, 코딩 작업용 텍스트를 반환합니다. 개발사 사양은 128,000토큰의 컨텍스트 창과 4,096토큰의 출력 한도, 스트리밍, 함수 호출을 결합합니다.
- 허용 입력
- 텍스트
- 결과
- 텍스트
Ailoot에서 사용 가능 · 입력 및 메서드
Ailoot Ultra · 배치 POST /v1/batches
- 입력
text- 출력
text- 출력 형식
- 인라인 results[].response.body JSON
| 필드 | 유형 | 요건 | 값과 한도 | 기본값 |
|---|---|---|---|---|
필드endpoint | 유형string | 요건필수 | 값과 한도 /v1/chat/completions | 기본값— |
필드model | 유형string | 요건필수 | 값과 한도 openai/gpt-4-turbo:batch | 기본값— |
필드requests | 유형batch_item[] | 요건필수 | 값과 한도 최소 항목 수: 1 | 기본값— |
필드requests[].custom_id | 유형string | 요건필수 | 값과 한도 | 기본값— |
필드requests[].body.messages | 유형message[] | 요건필수 | 값과 한도 | 기본값— |
필드completion_window | 유형string | 요건선택 사항 | 값과 한도 24h | 기본값— |
필드provider | 유형object|null | 요건선택 사항 | 값과 한도 | 기본값— |
필드requests[].body.model | 유형string | 요건선택 사항 | 값과 한도 openai/gpt-4-turbo:batch, openai/gpt-4-turbo | 기본값— |
필드provider.only | 유형string[] | 요건선택 사항 | 값과 한도 openai | 기본값— |
필드provider.allow_fallbacks | 유형boolean|null | 요건선택 사항 | 값과 한도 false, null | 기본값— |
메서드 매개변수와 수명 주기
| 매개변수 | 명세 |
|---|---|
매개변수content_type | 명세application/json |
매개변수required | 명세endpoint, model, requests |
매개변수material_types | 명세text |
매개변수representation | 명세인라인 requests[]; 각 항목에는 custom_id와 body가 있습니다 |
매개변수request_endpoint_profile | 명세/v1/chat/completions |
매개변수file_material | 명세호출자는 실제 UTF-8 JSONL을 로컬에서 읽어 requests[]에 넣을 수 있습니다. 업로드 목적, input_file_id 또는 파일 참조는 사용하지 않습니다. 고객 자료가 없거나 비어 있으면 POST 전에 준비를 중단합니다. |
매개변수serialization_order | 명세endpoint, model, provider (제공된 경우), completion_window (제공된 경우), requests는 마지막에 |
매개변수optional_controls | 명세provider.only, provider.allow_fallbacks, completion_window |
매개변수schema_scope | 명세문서에 명시된 인라인 배치 요청 구조에 담긴 텍스트 Chat Completions 본문입니다. |
수명 주기: asynchronous
GET /v1/batches/{operation_id} · 최초 생성 응답에서 실제로 반환된 response.id; 동일한 사용자/키/그룹
요금
요금 정보는 요청 옵션을 추가하지 않습니다. 지원되는 매개변수는 선택한 메서드에 표시됩니다.
- 빠른 모드
- 미지정 빠른 모드를 선택한 경우
- Flex 모드
- 미지정 flex 모드를 선택한 경우
- 최대 추론 수준
- 미지정 최대 추론 수준에 default 조정값을 적용하는 경우
- 명시적 캐시 요금
- 활성화되지 않음 명시적 캐시를 요청할 때
Ailoot 요금
설정별 가격
각 요금을 표시된 조건과 대조하세요. 서로 대체되는 설정 묶음마다 하나의 요금만 적용하세요.
| 설정 | 요금표 | 컨텍스트 토큰 수 초과 기준 | 컨텍스트 토큰 수 이하 기준 | 요금 |
|---|---|---|---|---|
| 설정토큰의 기본 단가 | 요금표기본 요금 | 컨텍스트 토큰 수 초과 기준— | 컨텍스트 토큰 수 이하 기준상한 없음 | 요금 입력 · 입력 토큰 $0.01 / 1K 토큰 출력 · 출력 토큰 $0.03 / 1K 토큰 입력 · 캐시 읽기 — / 1K 토큰 입력 · 캐시 쓰기 — / 1K 토큰 입력 · 캐시 쓰기, 1시간 — / 1K 토큰 |
| 설정요청 길이 구간 1 | 요금표— | 컨텍스트 토큰 수 초과 기준0 | 컨텍스트 토큰 수 이하 기준상한 없음 | 요금 입력 · 입력 토큰 $0.01 / 1K 토큰 출력 · 출력 토큰 $0.03 / 1K 토큰 입력 · 캐시 읽기 — / 1K 토큰 입력 · 캐시 쓰기 — / 1K 토큰 입력 · 캐시 쓰기, 1시간 — / 1K 토큰 |
Ailoot는 요청 전에 예상 금액을 미리 확보합니다. 결과를 받은 뒤 측정된 사용량을 기준으로 최종 요금을 정산합니다. 스트리밍 정산에는 최종 사용량 기록을 사용합니다. 금액 확보와 정산 방식 →
요청 예제
Ailoot Ultra · 배치
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
python3 - <<'PY_REQUEST'
import json
from pathlib import Path
body=json.loads('{"endpoint":"/v1/chat/completions","model":"openai/gpt-4-turbo:batch","requests":[{"custom_id":"req-0001","body":{"messages":[{"role":"user","content":"Hello!"}],"max_tokens":16}}]}')
Path("batch-request.json").write_text(json.dumps(body,ensure_ascii=False),encoding="utf-8")
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/batches \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @batch-request.json -D batch-response-headers.txt -o batch-create-response.json
import json, os
from pathlib import Path
from urllib.request import Request, urlopen
def prepare_requests(customer_path):
path = Path(customer_path)
if not path.is_file(): raise ValueError("Customer JSONL file is missing")
items = [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines() if line.strip()]
if not items: raise ValueError("Customer JSONL contains no requests")
ids = set()
for item in items:
if set(item) != {"custom_id", "body"}: raise ValueError("Each item needs custom_id and body")
cid = item["custom_id"]
if not isinstance(cid, str) or not cid.strip() or cid in ids: raise ValueError("custom_id must be nonempty and unique")
ids.add(cid)
if not isinstance(item["body"], dict) or not item["body"].get("messages"): raise ValueError("Supply actual text messages")
supplied_model = item["body"].get("model")
if supplied_model is not None and supplied_model not in ['openai/gpt-4-turbo:batch', 'openai/gpt-4-turbo']: raise ValueError("body.model must be an exact documented caller or wire ID")
return {"endpoint":"/v1/chat/completions", "model":"openai/gpt-4-turbo:batch", "requests":items}
if __name__ == "__main__":
material = os.environ.get("AILOOT_BATCH_REQUESTS_JSONL", "")
if not material: raise SystemExit("Set AILOOT_BATCH_REQUESTS_JSONL to your actual customer file")
body = prepare_requests(material)
key = os.environ.get("AILOOT_API_KEY", "")
if not key: raise SystemExit("Set AILOOT_API_KEY")
request = Request("https://api.ailoot.ai/v1/batches", data=json.dumps(body, ensure_ascii=False).encode("utf-8"), headers={"Authorization":"Bearer " + key, "Content-Type":"application/json"}, method="POST")
with urlopen(request) as response:
raw = response.read()
Path("batch-create-response.json").write_bytes(raw)
print(raw.decode("utf-8"))
import json
from pathlib import Path
raw = Path("batch-status-response.json").read_bytes()
response = json.loads(raw)
if response.get("status") != "completed":
raise SystemExit("Keep the original operation; read its status without resubmitting")
results = response.get("results")
if not isinstance(results, list) or not results:
raise SystemExit("Preserve the original response; completed results are missing")
Path("batch-results.jsonl").write_text("".join(json.dumps(item, ensure_ascii=False) + "\n" for item in results), encoding="utf-8")
# Preserve batch-status-response.json with aggregate usage and every result/error.
결과 수신 및 저장
Ailoot Ultra · 배치
인라인 results[].response.body JSON
GET /v1/batches/{operation_id}
작업 상태 확인
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
BATCH_OPERATION_ID="$(python3 - <<'PY_ID'
import json
from pathlib import Path
from urllib.parse import quote
response = json.loads(Path("batch-create-response.json").read_text(encoding="utf-8"))
operation = response.get("id")
if not isinstance(operation, str) or not operation: raise SystemExit("No actual original operation ID; preserve the response and do not resubmit")
print(quote(operation, safe=""))
PY_ID
)"
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/batches/$BATCH_OPERATION_ID" \
-H "Authorization: Bearer $AILOOT_API_KEY" -o batch-status-response.json
완료된 결과 모두 보관
반환된 완전한 응답, 파일, 콘텐츠 부분을 모두 보관하세요.
최초 상태 JSON 전체, 모든 결과/custom_id와 응답 또는 오류 본문 전체를 보관하세요. 완료된 results[]는 필터링 없이 JSONL로 저장하세요.
원래 응답을 확인해야 할 경우
최초 작업 ID를 보관하세요. 503 result_pending_check에는 X-Should-Retry:false가 포함됩니다. 상태가 불명확한 최초 배치를 다시 제출하지 마세요.
응답 필드
| 필드 | 유형 |
|---|---|
필드results[].custom_id | 유형string |
필드results[].response.body.choices[].message.content | 유형string|null |
필드results[].error | 유형object|null |
필드usage | 유형object|null |
필드id | 유형string |
필드model | 유형string |
필드endpoint | 유형string |
필드status | 유형string |
필드request_counts | 유형object |
필드results[].id | 유형string |
필드results[].response.status_code | 유형integer |
필드results[].response.request_id | 유형string |
오류와 다음 단계
| 응답 | 조건 | 다음 단계 |
|---|---|---|
응답400 · invalid_request_error | 조건문서에 명시된 인라인 요청 구조가 유효하지 않거나, 키가 중복되거나, 항목 식별 정보 또는 설정된 모델 기능에 충돌이 있습니다. | 다음 단계새로 제출하기 전에 표시된 필드를 수정하세요. |
응답401 · authentication_error | 조건유효하지 않은 API 키입니다. | 다음 단계사용 권한이 있는 Ailoot 키를 사용하세요. |
응답403 · permission_error | 조건배치 그룹을 사용할 수 없습니다. | 다음 단계키/그룹의 사용 권한을 확인하세요. |
응답422 · invalid_request_error | 조건배치는 잔액 과금을 사용하며, 구독을 통한 생성 요청은 거부됩니다. | 다음 단계사용 권한이 있는 잔액 과금 그룹을 사용하세요. |
응답422 · price_unavailable | 조건배치 입력의 예상 비용을 산출할 수 없습니다. | 다음 단계응답을 보관하고 문서에 명시된 API 계열 입력을 사용하세요. |
응답402 · billing_error | 조건배치 예약 금액을 확보할 수 없습니다. | 다음 단계새 요청 전에 요청 허용 조건을 충족하세요. |
응답503 · price_unavailable | 조건배치 메서드 가격 또는 네이티브 요율을 사용할 수 없습니다. | 다음 단계응답을 보관하고 가격을 임의로 대체하지 마세요. |
응답503 · api_error | 조건정확히 일치하는 공급업체 라우트를 사용할 수 없습니다. | 다음 단계라우트 수정을 위해 응답을 보관하세요. |
응답503 · result_pending_check | 조건최초 결과를 확인해야 합니다. X-Should-Retry:false. | 다음 단계최초 operation_id/id를 보관하고 해당 상태를 조회하세요. 최초 POST를 반복하지 마세요. |
응답404 · not_found | 조건배치 상태 조회 대상 작업이 없거나 다른 사용 주체의 소유입니다. | 다음 단계최초 id를 정확히 사용하고 동일한 사용자/키/그룹을 유지하세요. |
별칭
모델 별칭
Ailoot Ultra openai/gpt-4-turbo:batch
메서드 경로 별칭
위에 표시된 메서드 경로를 사용하세요.
관련 호출용 ID
FAQ · OpenAI: GPT-4 Turbo (batch)
- 어떤 입력과 결과를 사용할 수 있나요?
POST /v1/batches·openai/gpt-4-turbo:batch:text→text- 요청은 어떤 필드를 사용하나요?
POST /v1/batches·openai/gpt-4-turbo:batch:endpoint,model,requests,completion_window,provider- 어떤 제한이 적용되나요?
POST /v1/batches·openai/gpt-4-turbo:batch:requests.min_items:1