Skip to content

Commit 2989482

Browse files
Merge pull request #3 from trylitmus/contract-sync/472e2bf1
2 parents a4bf11e + b1e184a commit 2989482

1 file changed

Lines changed: 38 additions & 1 deletion

File tree

contract/openapi.yaml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,13 @@ components:
9797
$view, $partial_copy, $refine, $followup, $rephrase, $undo, $share, $flag,
9898
$rate, $escalate, $switch_model, $retry_context, $post_accept_edit,
9999
$blur, $return, $scroll_regression, $navigate, $interrupt,
100-
$startup, $pageleave.
100+
$startup, $pageleave, $sessionend.
101+
102+
$abandon vs $sessionend: $abandon is a user-initiated negative quality
103+
signal (closed editor without using the output, clicked stop, rejected).
104+
$sessionend is auto-emitted by the JS SDK when the tab closes or the
105+
user idles out with a generation still open — a session boundary, not
106+
a quality signal.
101107
102108
Event:
103109
type: object
@@ -129,6 +135,37 @@ components:
129135
user_id:
130136
type: string
131137
description: Identifier for the end user. Required for cross-session signals (Tier 4+).
138+
model:
139+
type: string
140+
description: Model identifier (e.g. "claude-sonnet-4-20250514", "gpt-4o"). Typically set on $generation events.
141+
provider:
142+
type: string
143+
description: LLM provider (e.g. "anthropic", "openai", "openrouter").
144+
input_tokens:
145+
type: integer
146+
minimum: 0
147+
description: Number of input tokens consumed.
148+
output_tokens:
149+
type: integer
150+
minimum: 0
151+
description: Number of output tokens produced.
152+
total_tokens:
153+
type: integer
154+
minimum: 0
155+
description: Total tokens (input + output).
156+
duration_ms:
157+
type: integer
158+
minimum: 0
159+
description: End-to-end generation latency in milliseconds.
160+
ttft_ms:
161+
type: integer
162+
minimum: 0
163+
description: Time to first token in milliseconds.
164+
cost:
165+
type: number
166+
format: double
167+
minimum: 0
168+
description: Generation cost in USD.
132169
metadata:
133170
type: object
134171
additionalProperties: true

0 commit comments

Comments
 (0)