API 참조
복구 가능한 텍스트 실행 생성
/v1/text-runsDurable text execution using an ordinary GloopAPI Key. The messages form runs Chat Completions with optional SSE. The explicit protocol/input/quote_id form consumes a versioned public cost quote and dispatches directly to native Chat Completions or Responses; this form is text-only, excludes unbounded tools, and supports SSE through the outer stream flag for both protocols. Keep the quoted input unchanged; the service sets upstream streaming parameters. Provisional text.delta events are not settlement evidence; run.result contains the authoritative state and billing receipt. A repeated Key/request_id returns the original execution; changed content conflicts. Full wallet maximum is reserved before dispatch. Only authoritative reported usage and finalized settlement expose output and billing.final_amount in USD. Unknown or over-maximum accounting retains its hold and must be recovered by querying the original request; never regenerate to recover. Stored content expires after seven days while accounting and request identity remain.
인증과 권한
현재 GloopAPI 키를 사용하세요. 사용 가능한 모델, 기능과 권한은 해당 카탈로그와 엔드포인트 문서에 따라 달라집니다.
Authorization: Bearer $GLOOP_API_KEY인증 방식: BearerAuth
요청
요청 본문 · application/json
- 유형
- object
- 추가 속성
- false
- 필수 필드
request_idmodelmax_output_tokens
요청 본문 필수
request_idstring필수- 패턴
"^[A-Za-z0-9_-]{1,128}$"
modelstring필수- 최대 길이
128
messagesarray선택 사항- 최소 항목 수
1- 최대 항목 수
256
max_output_tokensinteger필수- 최솟값
1- 최댓값
131072
streamboolean선택 사항true이면 SSE를 반환합니다. 응답 형식만 변경하며 request_id의 멱등성 식별자는 변경하지 않습니다. 연결이 끊기면 재생성하지 말고 원래 요청을 조회하세요.
- 기본값
false
protocolstring선택 사항- 열거형
["chat_completions","responses"]
quote_idstring선택 사항quote_token returned by POST /v1/cost-quotes. Required for native input execution.
- 최대 길이
8192
inputobject선택 사항Exact quoted native text request. Its stream field must be omitted or false; use the outer stream flag to select SSE. The model/output limit must match the outer envelope.
@anyOf:0unknown선택 사항@anyOf:1unknown선택 사항
응답과 오류
HTTP 200
비스트리밍 최종 응답 또는 스트리밍 이벤트 전송이며, 스트리밍 상태는 run.result를 기준으로 판단합니다.
application/json
- 유형
- object
- 필수 필드
idrequest_idmodelstateversionexpires_atresult_deleted
idstring필수request_idstring필수modelstring필수statestring필수- 열거형
["pending","unknown","succeeded","failed"]
versioninteger필수- 열거형
[1]
expires_atinteger필수결과 본문의 Unix 만료 시간(초)입니다. 본문은 최대 7일간 보관됩니다.
result_deletedboolean필수outputobject선택 사항output 하위 필드(4)
textstring필수input_tokensinteger필수output_tokensinteger필수usage_sourcestring필수- 열거형
["reported"]
billingobject선택 사항billing 하위 필드(5)
statusstring필수- 열거형
["settled","refunded"]
currencystring필수- 열거형
["USD"]
final_amountstring선택 사항Authoritative finalized wallet charge. Missing does not mean zero.
pricing_versionstring선택 사항quote_idstring선택 사항
text/event-stream
- 유형
- string
- 설명
- 이름이 지정된 SSE 이벤트: text.delta는 임시 텍스트, run.result는 TextRun 결과입니다. run.result가 없으면 원래 요청을 조회해야 합니다.
{
"type": "string",
"description": "命名 SSE:text.delta 为临时文字,run.result 为 TextRun 结果;缺失 run.result 必须查询原请求。"
}HTTP 202
실행 중이거나 확인이 필요합니다.
application/json
- 유형
- object
- 필수 필드
idrequest_idmodelstateversionexpires_atresult_deleted
idstring필수request_idstring필수modelstring필수statestring필수- 열거형
["pending","unknown","succeeded","failed"]
versioninteger필수- 열거형
[1]
expires_atinteger필수결과 본문의 Unix 만료 시간(초)입니다. 본문은 최대 7일간 보관됩니다.
result_deletedboolean필수outputobject선택 사항output 하위 필드(4)
textstring필수input_tokensinteger필수output_tokensinteger필수usage_sourcestring필수- 열거형
["reported"]
billingobject선택 사항billing 하위 필드(5)
statusstring필수- 열거형
["settled","refunded"]
currencystring필수- 열거형
["USD"]
final_amountstring선택 사항Authoritative finalized wallet charge. Missing does not mean zero.
pricing_versionstring선택 사항quote_idstring선택 사항
HTTP 400
잘못된 입력입니다.
application/json
- 유형
- object
- 필수 필드
error
errorobject필수error 하위 필드(4)
codestring선택 사항messagestring선택 사항typestring선택 사항request_idstring선택 사항
HTTP 401
키가 없거나 유효하지 않거나 만료 또는 폐기되었습니다.
application/json
- 유형
- object
- 필수 필드
error
errorobject필수error 하위 필드(4)
codestring선택 사항messagestring선택 사항typestring선택 사항request_idstring선택 사항
HTTP 403
IP, 계정, 모델 또는 도구 권한이 부족합니다.
application/json
- 유형
- object
- 필수 필드
error
errorobject필수error 하위 필드(4)
codestring선택 사항messagestring선택 사항typestring선택 사항request_idstring선택 사항
HTTP 404
본인의 실행을 찾을 수 없습니다. 결과가 불확실한 생성에 요금이 부과되지 않았다는 뜻은 아닙니다.
application/json
- 유형
- object
- 필수 필드
error
errorobject필수error 하위 필드(4)
codestring선택 사항messagestring선택 사항typestring선택 사항request_idstring선택 사항
HTTP 409
요청 ID의 내용이 충돌하거나 진행 중인 실행은 삭제할 수 없습니다.
application/json
- 유형
- object
- 필수 필드
error
errorobject필수error 하위 필드(4)
codestring선택 사항messagestring선택 사항typestring선택 사항request_idstring선택 사항
HTTP 429
요청/대기열 속도 제한입니다.
application/json
- 유형
- object
- 필수 필드
error
errorobject필수error 하위 필드(4)
codestring선택 사항messagestring선택 사항typestring선택 사항request_idstring선택 사항
HTTP 500
내부 인증 또는 데이터 저장 오류입니다.
application/json
- 유형
- object
- 필수 필드
error
errorobject필수error 하위 필드(4)
codestring선택 사항messagestring선택 사항typestring선택 사항request_idstring선택 사항
HTTP 503
일시적으로 사용할 수 없습니다. 제출 결과가 불확실하면 원래 요청을 조회하세요.
application/json
- 유형
- object
- 필수 필드
error
errorobject필수error 하위 필드(4)
codestring선택 사항messagestring선택 사항typestring선택 사항request_idstring선택 사항