API-Referenz

Wiederherstellbare Textausführung erstellen

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.

Authentifizierung und Berechtigungen

Verwenden Sie Ihren aktuellen GloopAPI-Schlüssel. Verfügbare Modelle, Funktionen und Berechtigungen hängen von seinem Katalog und der Endpunktdokumentation ab.

Authorization: Bearer $GLOOP_API_KEY

Authentifizierungsschemata: BearerAuth

Anfrage

Anfragekörper · application/json

Typ
object
Zusätzliche Eigenschaften
false
Pflichtfelder
request_idmodelmax_output_tokens

Anfragekörper erforderlich

  • request_idstringErforderlich
    Muster
    "^[A-Za-z0-9_-]{1,128}$"
  • modelstringErforderlich
    Maximale Länge
    128
  • messagesarrayOptional
    Mindestanzahl an Elementen
    1
    Maximale Elementanzahl
    256
    Unterfelder von messages (1)
    • []objectOptional
      Zusätzliche Eigenschaften
      false
      Unterfelder von [] (2)
      • rolestringErforderlich
        Aufzählung
        ["system","user","assistant"]
      • contentstringErforderlich
        Mindestlänge
        1
  • max_output_tokensintegerErforderlich
    Minimum
    1
    Maximum
    131072
  • streambooleanOptional

    true liefert SSE. Nur das Antwortformat ändert sich, nicht die Idempotenzidentität request_id. Nach einem Verbindungsabbruch die ursprüngliche Anfrage abfragen, ohne erneut zu generieren.

    Standardwert
    false
  • protocolstringOptional
    Aufzählung
    ["chat_completions","responses"]
  • quote_idstringOptional

    quote_token returned by POST /v1/cost-quotes. Required for native input execution.

    Maximale Länge
    8192
  • inputobjectOptional

    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:0unknownOptional
  • @anyOf:1unknownOptional

Antworten und Fehler

HTTP 200

Nicht gestreamte Endantwort oder Übertragung von Streaming-Ereignissen; run.result bestimmt den Streaming-Status.

application/json

Typ
object
Pflichtfelder
idrequest_idmodelstateversionexpires_atresult_deleted
  • idstringErforderlich
  • request_idstringErforderlich
  • modelstringErforderlich
  • statestringErforderlich
    Aufzählung
    ["pending","unknown","succeeded","failed"]
  • versionintegerErforderlich
    Aufzählung
    [1]
  • expires_atintegerErforderlich

    Unix-Ablaufzeit in Sekunden; der Ergebnisinhalt bleibt höchstens sieben Tage erhalten.

  • result_deletedbooleanErforderlich
  • outputobjectOptional
    Unterfelder von output (4)
  • billingobjectOptional
    Unterfelder von billing (5)
    • statusstringErforderlich
      Aufzählung
      ["settled","refunded"]
    • currencystringErforderlich
      Aufzählung
      ["USD"]
    • final_amountstringOptional

      Authoritative finalized wallet charge. Missing does not mean zero.

    • pricing_versionstringOptional
    • quote_idstringOptional

text/event-stream

Typ
string
Beschreibung
Benannte SSE-Ereignisse: text.delta enthält vorläufigen Text, run.result das TextRun-Ergebnis. Fehlt run.result, muss die ursprüngliche Anfrage abgefragt werden.
{
  "type": "string",
  "description": "命名 SSE:text.delta 为临时文字,run.result 为 TextRun 结果;缺失 run.result 必须查询原请求。"
}

HTTP 202

Ausführung läuft oder muss bestätigt werden.

application/json

Typ
object
Pflichtfelder
idrequest_idmodelstateversionexpires_atresult_deleted
  • idstringErforderlich
  • request_idstringErforderlich
  • modelstringErforderlich
  • statestringErforderlich
    Aufzählung
    ["pending","unknown","succeeded","failed"]
  • versionintegerErforderlich
    Aufzählung
    [1]
  • expires_atintegerErforderlich

    Unix-Ablaufzeit in Sekunden; der Ergebnisinhalt bleibt höchstens sieben Tage erhalten.

  • result_deletedbooleanErforderlich
  • outputobjectOptional
    Unterfelder von output (4)
  • billingobjectOptional
    Unterfelder von billing (5)
    • statusstringErforderlich
      Aufzählung
      ["settled","refunded"]
    • currencystringErforderlich
      Aufzählung
      ["USD"]
    • final_amountstringOptional

      Authoritative finalized wallet charge. Missing does not mean zero.

    • pricing_versionstringOptional
    • quote_idstringOptional

HTTP 400

Ungültige Eingabe.

application/json

Typ
object
Pflichtfelder
error

HTTP 401

Key fehlt, ist ungültig, abgelaufen oder widerrufen.

application/json

Typ
object
Pflichtfelder
error

HTTP 403

Unzureichende IP-, Konto-, Modell- oder Tool-Berechtigungen.

application/json

Typ
object
Pflichtfelder
error

HTTP 404

Ihre Ausführung wurde nicht gefunden; das beweist nicht, dass eine unklare Generierung nicht berechnet wurde.

application/json

Typ
object
Pflichtfelder
error

HTTP 409

Inhaltskonflikt bei dieser Anfrage-ID oder eine laufende Ausführung kann nicht gelöscht werden.

application/json

Typ
object
Pflichtfelder
error

HTTP 429

Anfrage-/Warteschlangenlimit.

application/json

Typ
object
Pflichtfelder
error

HTTP 500

Interner Authentifizierungs- oder Datenspeicherungsfehler.

application/json

Typ
object
Pflichtfelder
error

HTTP 503

Vorübergehend nicht verfügbar; fragen Sie bei unklarem Ergebnis die ursprüngliche Anfrage ab.

application/json

Typ
object
Pflichtfelder
error
Bereit zum Entwickeln? Öffnen Sie Konsole um einen API-Schlüssel zu erstellen, oder durchsuchen Sie Funktionen.