HTTP API Endpoints
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.
Endpoints
Results lifetime
The listener outlives the benchmark itself. At the end of a run the controller stops every other service, exports the results, and commits .aiperf_results_ready.json. It then hands the API the run’s terminal state and waits for the API to confirm it. Only after that does it retire the API. From then on the listener stays open for AIPERF_API_SERVER_POST_COMPLETE_GRACE seconds (default 5.0), so a client polling /api/results sees complete (or cancelled) and can list and download the artifacts before the connection is refused.
/api/resultsreportsrunninguntil the controller’s completion command arrives, even if the final metrics arrived earlier, socompletealways means the files are on disk./api/results/listand/api/results/files/{filename}withhold top-level artifacts until the ready marker commits. Checkpoint artifacts undercheckpoints/are exempt.- The controller waits up to
AIPERF_API_SERVER_COMPLETE_ACK_TIMEOUTseconds (default5.0) for the API’s confirmation. On a timeout or error it logs a warning and retires the API anyway. It also warns when the API has the terminal state but not the final metrics (for example, RecordsManager died), in which case/api/resultsreportsincomplete(orcancelled). On a local run that status is reported at once, because the controller has already stopped RecordsManager and no late results can arrive. Under Kubernetes the API first waits up to 10 seconds for RecordsManager’s final results, which may still be in flight from its own container. AIPERF_API_SERVER_POST_COMPLETE_GRACE=0closes the listener right after the API confirms the terminal state. The state is always set before the listener starts closing, but a polling client may never get a request in.- Under Kubernetes the API ignores the controller’s shutdown and keeps serving until
POST /api/shutdown.
Breaking change: /api/progress phases keys
ProgressResponse.phases is keyed by each phase’s concrete name (CombinedPhaseStats.phase_name), falling back to the plain CreditPhase value (e.g. "profiling") only when the phase has no explicit name. Prior releases keyed this dict by the closed CreditPhase enum, so progress["phases"]["profiling"] was always a valid lookup. DAG/multi-instance phases now carry user-assigned names, so that fixed lookup can silently miss. Consumers should iterate phases.values() and match on each entry’s phase field instead of indexing by a hardcoded CreditPhase string.
Secret redaction
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.