trading_agent.gateway.routes.system_routes
¶
Routes for the gateway itself: model usage and the configuration.
GET /api/usage today's tokens per desk and backend, and the latest rate-limit reports GET /api/configuration trading_agent.toml as the gateway read it, with every known secret masked
Typical usage example:
application.include_router(SystemRoutes(guard, configuration, usage, redactor, desk_names).router())
SystemRoutes
¶
Bases: RouteGroup
The usage and configuration routes.
Creates the routes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
guard
|
AccessGuard
|
Checks the access token. |
required |
configuration
|
AgentConfiguration
|
The configuration the gateway runs with. |
required |
usage
|
UsageTracker
|
Today's model usage. |
required |
redactor
|
SecretRedactor
|
Masks secrets in the configuration. |
required |
desk_names
|
Sequence[str]
|
The running desks. |
required |
Source code in src/trading_agent/gateway/routes/system_routes.py
usage
¶
Today's model usage.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
For each desk, the calls, tokens and cost per backend, and each backend's latest rate-limit report. |
Source code in src/trading_agent/gateway/routes/system_routes.py
configuration
¶
The configuration, with secrets masked.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Every setting of trading_agent.toml, including defaults, as JSON values. |