[api] Allow specifying headers when creating the client