Using an interface via something like HTTP is unlikely to be considered a derivative work or be bound by that server code's licenses (though there may still be other license agreements for end users of that service, ToS, etc - very, very unlikely if you're self hosting open source code), but if you're linking to an AGPL client library that connects to that API, you may be bound by the terms of the AGPL license.
In all cases, copyright generally only applies to distribution. If you do not distribute any code or software, you are most likely fine.
(Overusing "likely" because 1. not a lawyer and 2. copyright law is really complicated and mostly up to both jurisdiction and the judge)