  We study the Atiyah-Patodi-Singer (APS) index, and its equality to the
spectral flow, in an abstract, functional analytic setting. More precisely, we
consider a (suitably continuous or differentiable) family of self-adjoint
Fredholm operators $A(t)$ on a Hilbert space, parametrised by $t$ in a finite
interval. We then consider two different operators, namely $D :=
\frac{d}{dt}+A$ (the abstract analogue of a Riemannian Dirac operator) and $D
:= \frac{d}{dt}-iA$ (the abstract analogue of a Lorentzian Dirac operator). The
latter case is inspired by a recent index theorem by B\"ar and Strohmaier
(Amer.\ J.\ Math. 141 (2019), 1421--1455) for a Lorentzian Dirac operator
equipped with APS boundary conditions. In both cases, we prove that Fredholm
index of the operator $D$ equipped with APS boundary conditions is equal to the
spectral flow of the family $A(t)$.
