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 冪等性 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
Non-streaming 端末応答またはストリーミング イベント トランスポート。 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 の内容が競合しているか、in-flight の実行を削除できません。
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オプション