Back to Blog

Building a highly scalable API for AI image enhancement

Jamie McInally

Building a highly scalable API for AI image enhancement

When we started our photo editing service - - we considered that our web app was the best way for users to enhance their images and receive an instant AI enhancement. Our users interact with multiple services and websites every day. We didn’t want to add to their list; instead, we tried to integrate into existing services utilised by our users. We had many conversations with potential clients in those early stages, and “Do you have an API?” was the question many people asked. We then had to ask ourselves: “Why don't we have an API?”

We’d built a successful internal API, but it wasn’t a RESTful API by definition. Initially, we gave our users access to this API, but there were many flaws, such as security, and the layout of the API was not intuitive. It required a 30-minute walk-through to understand it.

In March, James Campbell joined as CTO. First, I gave him a walkthrough of our API and straight away, he called me out, saying that the API isn’t simple. He immediately called the team and said, “ We’re going to engineer a new API”.

We started with security. AWS is our cloud provider, which has an excellent platform called API gateway to provision API keys for clients and maps pricing plans. This visibility allows us to lock the whole system down and monitor individual users to ensure we provide the right AI resources.

Secondly, we focussed on scalability. We used Sagemaker (a platform as a service) for our AI endpoints, but running on GPUs didn’t give us the scalability we needed to make our AI reactionary to API usage. We required smaller CPU instances that could be provisioned at peak usage (afternoons) and scaled-down during low use (at night). Additionally, we wanted to move away from ECS (elastic container service) to something even more scalable - serverless. However, some drawbacks include uploading images to serverless, limited to the maximum storage size of 6MB payload. We overcame this by providing users with a signed S3 endpoint for uploading pictures.

With our new architecture in place, we’ve started to make our endpoints more intuitive. Previously our endpoints were POST /upload, POST /status and POST /getimage, which relates to the user’s actions. However, this is not RESTful. Our new API uses the CRUD format e.g. POST /image to upload the image, GET /image/{imageid} to get the image status, GET /image/{image_id}/enhanced, to view the enhanced image.

Since releasing the new architecture, we’ve provided a consistent average turnaround time of 10 seconds per image and scaled efficiently with zero downtime. We’ve received positive customer feedback, and our visibility across the system assists us in improving the API continually.

The new API was a "great success"

Sign up for our API and follow the steps for integration.

Try our photo editing service to receive the instant enhancement.

More from the Blog

Redefining the Future of Real Estate Photo Editing

At, we're embarking on a thrilling journey with one clear goal in mind: to redefine the future of real estate photo editing through the power of artificial intelligence.

Read Story

Why on earth did Adrian Gill take that job with Purplebricks?

We sat down with Chairman, Adrian Gill, to ask him about his exciting role as an independent non-exec director at Purplebricks.

Read Story

5 property technologies for a hot real estate market in 2022

Proptech solutions have a massive potential to innovate the real estate industry.

Read Story

Never miss a minute.

Subscribe now to get our latest blog posts.
We will never share your email address with third parties.