API リファレンス

回復可能なテキスト実行を作成する

POST/v1/text-runs

Durable 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
    messages 子フィールド (1)
    • []objectオプション
      追加のプロパティ
      false
      [] 子フィールド (2)
      • rolestring必須
        列挙型
        ["system","user","assistant"]
      • contentstring必須
        最小長さ
        1
  • 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

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

HTTP 400

入力が無効です。

application/json

タイプ
object
必須フィールド 説明
error
  • errorobject必須
    error 子フィールド (4)

HTTP 401

キーが見つからないか、無効であるか、期限切れであるか、取り消されています。

application/json

タイプ
object
必須フィールド 説明
error
  • errorobject必須
    error 子フィールド (4)

HTTP 403

IP、アカウント、モデル、またはツールの権限が不十分です。

application/json

タイプ
object
必須フィールド 説明
error
  • errorobject必須
    error 子フィールド (4)

HTTP 404

実行は見つかりませんでした。これは、不確実な世代に請求が行われていないことを証明するものではありません。

application/json

タイプ
object
必須フィールド 説明
error
  • errorobject必須
    error 子フィールド (4)

HTTP 409

リクエスト ID の内容が競合しているか、in-flight の実行を削除できません。

application/json

タイプ
object
必須フィールド 説明
error
  • errorobject必須
    error 子フィールド (4)

HTTP 429

リクエスト/キューのレート制限。

application/json

タイプ
object
必須フィールド 説明
error
  • errorobject必須
    error 子フィールド (4)

HTTP 500

内部認証またはデータ ストレージのエラー。

application/json

タイプ
object
必須フィールド 説明
error
  • errorobject必須
    error 子フィールド (4)

HTTP 503

一時的に利用できません。送信された結果が不確かな場合は、元のリクエストをクエリします。

application/json

タイプ
object
必須フィールド 説明
error
  • errorobject必須
    error 子フィールド (4)
構築する準備はできましたか?を開きます コンソール で API キーを作成するか、参照します の機能.