Carrier-grade telecommunication infrastructure must support an ever-increasing traffic volume and dynamicity in operationally-complex networks characterized by multiple domains, multiple technologies and equipment from multiple vendors. At the same time, the advent of Software-Defined Networking (SDN) and Network Function Virtualization (NFV) technologies create transport ecosystems with unprecedented network control and resource dynamicity capabilities. In this context, network optimization is essential to efficiently employ network resources, relying whenever possible on automated procedures and exploiting open application programming interfaces (APIs) inherent of SDN/NFV ecosystems. Automated network optimization procedures on top of network controllers promote a client layer of third-party applications that enable optimization-as-a-service (OaaS) business opportunities. In this paper, we present a network OaaS framework built as an extension of the Net2Plan open-source network planning tool. The proposed framework is based on a classical client-server architecture, and through a REST-based API, holders of network infrastructures (i.e. client role) may request the resolution of a network resource allocation problem through the execution of an algorithmic technique. Thus, third-party players can focus on the development of optimization algorithms (i.e. server role) while potentially providing high-performance computing (HPC) capabilities for their execution. Through the paper, we detail the workflow of the proposed OaaS, illustrate its usage with several use-cases and discuss its applicability in different scenarios.