Commit Graph

17 Commits

Author SHA1 Message Date
zenfun
f52c7acbe6 docs(swagger): document admin master child key endpoints 2026-01-10 01:19:53 +08:00
zenfun
5349c9c833 feat(api): add admin master key listing/revoke
Add admin endpoints to list and revoke child keys under a master.
Standardize OpenAPI responses to use ResponseEnvelope with MapData
for error payloads, and regenerate swagger specs accordingly.
2026-01-10 01:10:36 +08:00
zenfun
f400ffde95 refactor(api): update traffic chart response structure
Change the traffic chart API response from bucket-based to series-based
to better support frontend visualization libraries. The new format
provides a shared X-axis and aligned data arrays for each model series.

- Replace `buckets` with `x` and `series` in response
- Implement data alignment and zero-filling for time slots
- Update Swagger documentation including pending definitions

BREAKING CHANGE: The `GET /admin/logs/stats/traffic-chart` response
schema has changed. `buckets` and `models` fields are removed.
2026-01-08 18:40:44 +08:00
zenfun
47991bd5f3 docs(api): update swagger documentation for traffic charts and trends
Regenerate API documentation to reflect recent statistics features:
- Add definition for new `/admin/logs/stats/traffic-chart` endpoint
- Update dashboard summary with `include_trends` parameter and new time periods
- Add `DashboardTrends` and `TrafficChartResponse` data structures
- Update alert types to include `traffic_spike
2026-01-02 23:22:36 +08:00
zenfun
0b9556ee7e docs(api): add alert thresholds endpoints to swagger documentation
Add OpenAPI documentation for the new alert threshold management
endpoints used in traffic spike detection:

- GET /admin/alerts/thresholds - retrieve current threshold config
- PUT /admin/alerts/thresholds - update threshold configuration

Include AlertThresholdView and UpdateAlertThresholdsRequest schema
definitions with properties for QPS, RPM, TPM, RPD, TPD limits.
2025-12-31 15:57:27 +08:00
zenfun
57797f38cb docs(api): add alerts report endpoint and apikey-stats query params
- Add internal /internal/alerts/report POST endpoint documentation
- Add reportAlertEntry, reportAlertsRequest, reportAlertsResponse schemas
- Add since/until query parameters to /admin/apikey-stats/summary endpoint
2025-12-31 14:18:42 +08:00
zenfun
170d16894f docs: update swagger docs for alerts API and minute-level stats
Add OpenAPI documentation for the new alerts management system:
- CRUD endpoints for system alerts (/admin/alerts)
- Alert acknowledgment and resolution endpoints
- Alert statistics endpoint
- Alert filtering by status, severity, and type

Also document minute-level aggregation support for log stats
with 6-hour time range limitation.
2025-12-31 13:45:18 +08:00
zenfun
53c18c3867 feat(api): add dashboard summary and system realtime endpoints
Add new admin API endpoints for dashboard metrics and system-wide
realtime statistics:

- Add /admin/dashboard/summary endpoint with aggregated metrics
  including requests, tokens, latency, masters, keys, and provider
  keys statistics with time period filtering
- Add /admin/realtime endpoint for system-level realtime stats
  aggregated across all masters
- Add status filter parameter to ListAPIKeys endpoint
- Add hour grouping option to log stats aggregation
- Update OpenAPI documentation with new endpoints and schemas
2025-12-31 13:17:23 +08:00
zenfun
637bfa8210 feat(api): add public status endpoints with version injection
Replace health_handler with status_handler providing public /status and
/about endpoints. Add build-time version injection via ldflags in
Makefile, and support --version/-v CLI flag.

- Add /status endpoint returning runtime status, uptime, and version
- Add /about endpoint with system metadata (name, description, repo)
- Configure VERSION variable with git describe fallback
- Update swagger docs and api.md for new public endpoints
- Remove deprecated /api/status/test endpoint
2025-12-27 13:24:13 +08:00
zenfun
c83fe03892 docs(swagger): update API documentation for log endpoints
Add new response types and parameters for logs API:
- Add GroupedStatsItem and GroupedStatsResponse definitions
- Add ListLogsResponse and LogView definitions for detailed log records
- Add group_by enum parameter (model/day/month) to stats endpoint
- Update endpoint descriptions to clarify response types and request_body inclusion
- Update response schema references to use correct types
2025-12-26 11:12:47 +08:00
30f15a84b5 feat(api): add /auth/whoami endpoint and build automation 2025-12-25 14:54:52 +08:00
b566eb8058 fix(swagger): restore apikey security definition with Bearer usage description 2025-12-25 11:32:55 +08:00
c8fced4cf1 fix(swagger): fix swagger authorization header 2025-12-25 11:26:56 +08:00
zenfun
d731e42ae5 docs: update swagger specs for provider-groups and api-keys refactor
Regenerate OpenAPI documentation to reflect the architectural split
of Provider into ProviderGroup and APIKey models:

- Replace /admin/providers endpoints with /admin/provider-groups
- Add new /admin/api-keys CRUD and batch endpoints
- Update BindingDTO to use group_id instead of route_group
- Remove provider-specific DTOs (ProviderCustomCreateDTO, ProviderPresetCreateDTO, ProviderGoogleCreateDTO)
- Add APIKeyDTO and ProviderGroupDTO definitions
- Update model definitions for APIKey, Binding, and ProviderGroup
2025-12-24 02:20:32 +08:00
zenfun
de1d23cce5 docs: regenerate swagger docs with new API endpoints
Add comprehensive API documentation for new endpoints including:
- Bindings CRUD and batch operations
- Namespaces management
- Master tenant CRUD, access settings, and realtime stats
- Provider CRUD with preset/custom/google variants
- Model registry status, refresh, check, and rollback
- Log management with stats and webhook config
- Key access settings endpoints
- Internal stats flush endpoint
- Health check endpoint

Also adds swagger annotations for FlushStats internal handler.
2025-12-22 13:03:52 +08:00
zenfun
ca03ac1b79 docs(api): update swagger documentation for admin endpoints
Reflect recent API changes in Swagger documentation:
- Add endpoints for feature flag management (/admin/features)
- Add endpoint for issuing child keys to masters (/admin/masters/{id}/keys)
- Add endpoint for updating providers (/admin/providers/{id})
- Update provider model definitions with new fields (auto_ban, google_* attributes, status)
2025-12-15 16:12:56 +08:00
770a9fef2b feat: Add Swagger documentation for admin and master API endpoints
- Added Swagger documentation for the following admin endpoints:
  - Create a new master tenant
  - Create a new provider
  - Register a new model
  - List all models
  - Update a model
  - Force sync snapshot
  - Ingest logs

- Added Swagger documentation for the master endpoint:
  - Issue a child key

- Updated go.mod and go.sum to include necessary dependencies for Swagger.
2025-12-05 15:01:35 +08:00