diff options
Diffstat (limited to '')
| -rw-r--r-- | internal/domain/types.go | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/internal/domain/types.go b/internal/domain/types.go index 81da8f2..c700123 100644 --- a/internal/domain/types.go +++ b/internal/domain/types.go @@ -5,9 +5,21 @@ import "time" type Protocol string const ( - ProtocolOpenAI Protocol = "openai" - ProtocolOpenAIResponses Protocol = "openai_responses" - ProtocolAnthropic Protocol = "anthropic" + ProtocolOpenAI Protocol = "openai" + ProtocolOpenAIResponses Protocol = "openai_responses" + ProtocolOpenAIEmbeddings Protocol = "openai_embeddings" + ProtocolAnthropic Protocol = "anthropic" +) + +// MeteringUnit defines the physical quantity a price applies to. Token-priced +// endpoints are implemented today; image and second keep future media pricing +// explicit instead of overloading token counters. +type MeteringUnit string + +const ( + MeteringUnitToken MeteringUnit = "token" + MeteringUnitImage MeteringUnit = "image" + MeteringUnitSecond MeteringUnit = "second" ) type Principal struct { @@ -17,6 +29,9 @@ type Principal struct { Scopes []string AllowedModels map[string]struct{} MonthlySpendMicros int64 + DailySpendMicros int64 + RequestsPerMinute int64 + TokensPerMinute int64 ExpiresAt *time.Time } @@ -126,6 +141,7 @@ type UsageEvent struct { Attempts int `json:"attempts"` StartedAt time.Time `json:"started_at"` DurationMS int64 `json:"duration_ms"` + TTFTMS int64 `json:"ttft_ms,omitempty"` Usage Usage `json:"usage"` UsageReported bool `json:"usage_reported"` } |
