From dd3bb2cfcb09735d089b271e195723f95f333d76 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 17 Apr 2026 01:16:04 +0000 Subject: [PATCH] chore: sync OpenAPI contract from monorepo Source commit: trylitmus/litmus@25274156c014dca5bee2a4dd236a2b947dbe6fa2 --- contract/openapi.yaml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/contract/openapi.yaml b/contract/openapi.yaml index 00e23d1..91a2249 100644 --- a/contract/openapi.yaml +++ b/contract/openapi.yaml @@ -97,7 +97,13 @@ components: $view, $partial_copy, $refine, $followup, $rephrase, $undo, $share, $flag, $rate, $escalate, $switch_model, $retry_context, $post_accept_edit, $blur, $return, $scroll_regression, $navigate, $interrupt, - $startup, $pageleave. + $startup, $pageleave, $sessionend. + + $abandon vs $sessionend: $abandon is a user-initiated negative quality + signal (closed editor without using the output, clicked stop, rejected). + $sessionend is auto-emitted by the JS SDK when the tab closes or the + user idles out with a generation still open — a session boundary, not + a quality signal. Event: type: object @@ -129,6 +135,31 @@ components: user_id: type: string description: Identifier for the end user. Required for cross-session signals (Tier 4+). + model: + type: string + description: Model identifier (e.g. "claude-sonnet-4-20250514", "gpt-4o"). Typically set on $generation events. + provider: + type: string + description: LLM provider (e.g. "anthropic", "openai", "openrouter"). + input_tokens: + type: integer + description: Number of input tokens consumed. + output_tokens: + type: integer + description: Number of output tokens produced. + total_tokens: + type: integer + description: Total tokens (input + output). + duration_ms: + type: integer + description: End-to-end generation latency in milliseconds. + ttft_ms: + type: integer + description: Time to first token in milliseconds. + cost: + type: number + format: double + description: Generation cost in USD. metadata: type: object additionalProperties: true