'decimal:4', 'output_price_per_million' => 'decimal:4', 'context_window' => 'integer', 'max_output_tokens' => 'integer', 'is_active' => 'boolean', 'effective_from' => 'date', 'effective_until' => 'date', ]; public function getInputPriceFormattedAttribute(): string { return '$' . number_format($this->input_price_per_million, 2) . '/M'; } public function getOutputPriceFormattedAttribute(): string { return '$' . number_format($this->output_price_per_million, 2) . '/M'; } public function calculateCost(int $inputTokens, int $outputTokens): float { $inputCost = ($inputTokens / 1_000_000) * $this->input_price_per_million; $outputCost = ($outputTokens / 1_000_000) * $this->output_price_per_million; return round($inputCost + $outputCost, 6); } public function isCurrentlyActive(): bool { $now = now()->toDateString(); return $this->is_active && $this->effective_from <= $now && ($this->effective_until === null || $this->effective_until >= $now); } }