OpenAI: GPT-4.1 Mini (batch)
고유 custom_id와 선택 24h 완료 구간으로 독립 텍스트 요청을 배치 처리합니다.
모델 소개
이 설명은 모델의 기능을 다룹니다. Ailoot에서 사용할 수 있는 입력, 출력 및 옵션은 아래에 선택한 메서드별로 표시됩니다.
openai/gpt-4.1-mini:batch은 독립 텍스트 작업용 배치입니다. 여러 지원 대화에서 같은 필드를 추출해 대화마다 결과 하나를 받을 수 있습니다. 실시간 답변 대신 지연 수집이 맞을 때 선택하세요.
/v1/batches에 인라인 requests를 보내고 endpoint=/v1/chat/completions와 항목별 고유 custom_id를 쓰세요. 각 body는 messages를 포함하며 completion_window는 24h를 받습니다. 잔액으로 과금되며, 구독 결제 방식으로 배치 작업을 생성하는 요청은 거부됩니다. 배치 텍스트 입력이고 Files/input_file_id 업로드는 없습니다. 넓은 Mini 설명으로 배치 지연을 보장하지 마세요.
Ailoot Ultra · 배치 POST /v1/batches openai/gpt-4.1-mini:batch
openai/gpt-4.1-mini:batch시작하기
고유 custom_id와 선택 24h 완료 구간으로 독립 텍스트 요청을 배치 처리합니다.
- 허용 입력
- 텍스트
- 결과
- 텍스트
Ailoot에서 사용 가능 · 입력 및 메서드
Ailoot Ultra · 배치 POST /v1/batches
- 입력
text- 출력
text- 출력 형식
- 인라인 results[].response.body JSON
| 필드 | 유형 | 요건 | 값과 한도 | 기본값 |
|---|---|---|---|---|
필드endpoint | 유형string | 요건필수 | 값과 한도 /v1/chat/completions | 기본값— |
필드model | 유형string | 요건필수 | 값과 한도 openai/gpt-4.1-mini: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.1-mini:batch, openai/gpt-4.1-mini | 기본값— |
필드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.0004 / 1K 토큰 출력 · 출력 토큰 $0.0016 / 1K 토큰 입력 · 캐시 읽기 $0.0001 / 1K 토큰 입력 · 캐시 쓰기 — / 1K 토큰 입력 · 캐시 쓰기, 1시간 — / 1K 토큰 |
| 설정요청 길이 구간 1 | 요금표— | 컨텍스트 토큰 수 초과 기준0 | 컨텍스트 토큰 수 이하 기준상한 없음 | 요금 입력 · 입력 토큰 $0.0004 / 1K 토큰 출력 · 출력 토큰 $0.0016 / 1K 토큰 입력 · 캐시 읽기 $0.0001 / 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.1-mini: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.1-mini:batch', 'openai/gpt-4.1-mini']: raise ValueError("body.model must be an exact documented caller or wire ID")
return {"endpoint":"/v1/chat/completions", "model":"openai/gpt-4.1-mini: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.1-mini:batch
메서드 경로 별칭
위에 표시된 메서드 경로를 사용하세요.
관련 호출용 ID
FAQ · OpenAI: GPT-4.1 Mini (batch)
- 어떤 입력과 결과를 사용할 수 있나요?
POST /v1/batches·openai/gpt-4.1-mini:batch:text→text- 요청은 어떤 필드를 사용하나요?
POST /v1/batches·openai/gpt-4.1-mini:batch:endpoint,model,requests,completion_window,provider- 어떤 제한이 적용되나요?
POST /v1/batches·openai/gpt-4.1-mini:batch:requests.min_items:1