When aiperf profile is launched with --api-port <PORT> (or AIPERF_API_SERVER_PORT is set), AIPerf starts an in-process FastAPI server alongside the benchmark and exposes HTTP and Prometheus endpoints for the lifetime of the run. The server is opt-in — if --api-port is not set, no listener is created.
--api-host (default 127.0.0.1) controls the bind address; pass --api-host 0.0.0.0 to expose externally (e.g. in Kubernetes).
The router classes that back these routes live under src/aiperf/api/routers/ and are loaded via the api_router plugin category in plugins.yaml.
cli_command is captured from sys.argv at BenchmarkRun construction and redacted by build_cli_command() before it is stored — so the string returned from /api/run and written to profile_export_aiperf.json is the same redacted form. --api-key-shaped flags, credential-bearing --header values (e.g. Authorization: Bearer …), and userinfo embedded in URL-typed flags (--url, -u, --otel-url, --mlflow-tracking-uri) are all scrubbed to <redacted>.
/api/config independently excludes endpoint.api_key from its response.