- Fix model_pricing table references (model_id -> model, display_name -> model)
- Fix price columns (output_price_per_1k -> output_price_per_million)
- Add price conversion (per_million / 1000 = per_1k) in all API responses
- Add whereNotNull('model') filters to exclude invalid entries
- Add getModelDisplayName() helper method to all controllers
- Fix AccountController to use gateway_users budget fields directly
- Remove Budget model dependencies from AccountController
- Add custom Scramble server URL configuration for API docs
- Create ScrambleServiceProvider to set correct /api prefix
- Add migration to rename user_id to gateway_user_id in llm_requests
- Add custom ApiGuard for gateway_users authentication
- Update all API controllers: AccountController, ModelController, PricingController, ProviderController
All API endpoints now working correctly:
- GET /api/account
- GET /api/models
- GET /api/pricing
- GET /api/providers/{provider}
24 lines
459 B
PHP
24 lines
459 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Dedoc\Scramble\Scramble;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class ScrambleServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
Scramble::extendOpenApi(function ($openApi) {
|
|
$openApi->servers = [
|
|
\Dedoc\Scramble\Support\Generator\Server::make(url('/api')),
|
|
];
|
|
});
|
|
}
|
|
}
|