Enterprise
November 6, 2024
5 min read

Transforming AI API Access: Writer’s Kong Konnect Integration

Kong

At API Summit 2024, a common theme covered was how there's no AI without APIs. This couldn’t be more true for Writer, the full-stack generative AI platform for enterprises — and a notable user of the Kong Konnect unified API platform. 

Writer recently launched AI Studio, billed as “the fastest way to build generative AI apps.” AI Studio uses Writer API, Writer Framework, and Writer No Code to give people enterprise-grade generative AIs they can put in their own apps and services. 

We spoke with Jack Viers, a Backend Developer at Writer, about how Writer has transformed its API access through an integration with Kong Konnect. It’s a valuable case study for any team wanting to improve security, customization, and reliability through a comprehensive integration like Writer’s as well as optimize their API access management strategy. 

The Challenge: Create a public Gate API for AI Studio

Before AI Studio, Writer only had enterprise access to its APIs managed via a standard application login and a single token for the organization.

To bring a product like AI Studio to market, however, Writer would need to revamp that approach. Their challenge was to build a public Gate API that could:

  • Rate limit
  • Handle security specifications
  • Restrict access to certain capabilities
  • Manage everything via their own UX
  • Integrate with Writer’s existing internal platform
  • Enable deployment and operation as easily as possible
  • Be flexible enough to handle normal requests as well as chat-based event streams
  • Be able to abstract away the underlying platform giving users a “no code” experience

That was quite a list of demands in order to take AI Studio to market. But Viers, having used Kong at a previous consulting gig, had his ops team evaluate Kong Konnect for their needs. From there, the decision to integrate with Kong Konnect was simple. 

“I evaluated Kong based on the requirements we had for managing AI Studio’s APIs," Viers said. "We decided to go with fully managed Kong Konnect.” 

"Kong Konnect is simply a one-stop shop for API management.”
Jack Viers
Backend Developer, Writer

The Results: Delivering on Writer’s requirements and more

Here are a few of the results Viers reported.

  • Simple deployment. Deployment with Kong Konnect was easy, Viers said. “It’s a fully managed service, so our operational costs are minimal. The instructions were easy to follow, and it comes with an excellent web GUI.” 
  • Public availability. “Kong Konnect is purpose-built to securely provide gateway access for APIs, so our public availability and easy deployment requirements were handled,” Viers said.
  • Security and flexibility. “The plugins, especially the KeyAuth and ACL plugins, combined with consumer groups, cover our security and fine-grained capability requirements," Viers said. "Kong’s pattern-based route matching and gateway services allowed us to abstract away our underlying platform right through the Kong Gateway interface.” 

“Everything in Kong has an API that is spec’d out in open API docs, which made it easy to programmatically generate clients to integrate with our internal UX. Kong Konnect is simply a one-stop shop for API management,” Viers said.

Flexibility was key for bringing Writer’s AI Studio to market successfully. Viers said his team made extensive use of Kong plugins to customize everything from rate limits to error presentation and authenticated headers. “If it doesn’t have functionality built in, Kong has plugins to cover your use case.” 

“You can go from ‘this is fine’ to ‘the fire’s out’ faster with a Kong API gateway, and that makes all the difference.” 
Jack Viers
Backend Developer, Writer

The Writer team’s keys to success for using Kong Konnect

“I need to thank Kong for all their support as we were implementing this project," Viers said. "We would run into a snag or search for the best way to do something, and the team would hop on Slack with us and guide us to the answer so quickly.” 

Viers also revealed insights, keys to success, and lessons learned for getting the most from Kong Konnect’s capabilities.

  • “All of the Kong Konnect functionality is easy to discover and explore just through the GUI. If you were a one-man shop, you could run the whole thing basically from here with very little actual coding or API requests at all.”
  • “The available plugins are easily configurable. I’ve only had to pick up the smallest amount of Lua to configure them, and they are all manageable via the API.”
  • “Not only does everything in Kong have an API, almost all of them are documented and specified as open API specs.”
  • “Kong has fantastic APIs lying around. We had integrated them for our internal admin application, but if you can avoid this complexity, do it. Just manage it in Kong all by itself if your product needs don’t require you to integrate as a third party.”
  • “In a live production environment where new consumers are added all the time, it can be very costly in development time to operate. We’ve solved that problem through the use of the Kong Terraform provider.”
    “Kong is a wonderfully flexible tool, but if Kong doesn’t need metadata to route, manage, identify, or configure API traffic for your application, don’t put it there. If it’s not Kong-necessary data, store it somewhere else. This can make things really simple — it has route matching, and that means you can match many resources with a single route.”
  • “As engineers, we’re always fighting complexity. You should use the features of Kong to have fewer routes that match more back-end resources. That really scratches my simplicity itch. If something breaks, there are fewer things to fix.”
  • “We endeavor to keep our Kong services simple by maintaining a single gateway service with several plugins all tied to it at the gateway level. Kong provides plugins that will let you change your route target per route so that you need not point at the same gateway upstream services for every route in a gateway service.”

Writer’s major payoffs from using Kong Konnect

Writer’s AI Studio launched in 2024 to much fanfare and publication coverage. With a chance to reflect on the before and after of integrating with Kong Konnect. Viers boils the company’s major payoffs for using Kong Konnect into three high-level areas:

  • “First, it makes security easier than it ever was for us before,” said Viers.
  • “Second, its plugins allow us to unify our API surface to that which is served on the back end internally.”
  • “Finally, it unifies troubleshooting. We have many, many services that interact to deliver a user response. When something goes wrong with a request, they all go through Kong. That means I spend a little less time finding the related logs and traces for a request in our system. Just by unifying where the traffic goes, it has already had an impact. You can go from ‘this is fine’ to ‘the fire’s out’ faster with a Kong API gateway, and that makes all the difference.”  

“If you aren’t using Kong Konnect, I encourage you to do so," Viers said. "Kong has solved a ton of problems with delivering APIs and managing users for us so I can write code for our requests rather than hand coding rate limiters and other meta application work.”

For a deeper dive and more thorough explanation of Writer’s integration with Kong Konnect, be sure to watch this session.

Unleash the power of APIs with Kong Konnect