AI First API Strategy

What does BYO-AI mean for your company’s API strategy?

This article goes into the obvious, and subtle, changes that need to happen to support customers bringing their own AI.

All Features Need To Be Fully API Accessible

AI can only interact with publicly facing endpoints.  Any feature that isn’t publicly facing, or is only accessible through the UI, isn’t accessible to your customer’s AI.

Embracing your customer’s use of AI means making all of your features publicly available.  Now is time to reevaluate past decisions about excluding features for performance, scalability, security, pricing, and other reasons.

Customers come to you with problems and AI opens up entirely new avenues for solutions; but only if you let AI into your API.

All Features Need To Be Documented

AI is going to learn about your API by reading the docs, reading the example code, and then reading StackOverflow.

If you want AI to do a good job writing code against your API, you need to do a good job telling it how.  Undocumented endpoints, missing parameters, and bad code examples make that harder.

Outdated docs and libraries need to be scrubbed from the internet.  It is very much like hiring a reputation company to ensure that what AI sees and knows about your API is what you want it to see and know.

Technical writers and other DevRel positions are notoriously understaffed.  This is a great time to hire talented writers and get them writing for AI instead of human readers.

Features and Docs are the Easy Part

Fleshing out your API and producing up to date, readable docs are things you should have been doing all along anyway.  AI doesn’t change that, it merely raises the cost of poor software hygiene.

Once you get the table stakes out of the way, things get harder.  Or at least take more effort.

Assume That AI Has No Idea What It Is Doing

AI is the ultimate expression of the developer attitude, “I don’t want to understand the business, I just want to code.”  AI can’t understand the context and the customer can’t understand code.  This model works out because this is sort of how most software is written anyway.

These are the conceptual shifts you need to make with your API to support AI development.

Make Your API Simple and Verifiable

Users are going to manually confirm API actions through the UI so your API needs to be simple and easy to verify.  Endpoints that take multiple, open ended collections are great for performance and pushing a lot of data.  

If they can partially succeed, customers will find them a nightmare as they try to understand the results of the AI’s code.

Lean on strong validation, all or nothing changes, and understandable error responses.

Things Are Going To Be Rerun.  A Lot.

Everything will end up being rerun.  Customers won’t understand data models and won’t understand the risks with rerunning things.  

Embrace it by making everything as idempotent as possible.  

Make non-idempotent actions all-or-nothing.  AI is going to get close, a lot.  The last thing your customers expect is for all that flailing to wreck their data.  Bias the endpoints to either fully succeed or to take no action.  Don’t do partial updates and then bail on the request.  Change your processing to do full validation, and make changes only when you know you can make the full change.

Idempotent and all-or-nothing can be shockingly hard changes to implement.  Fortunately, you can iteratively improve your API!

Error Messages Need To Be Non-Developer Readable

Put effort into making your errors human readable and reasonable.  AI is better at grokking text than dense error responses.

Even better, when something fails validation include a link to the documentation where you’ve explained the correct structure.

Shifting to An AI First API Takes Time

Shifting to an AI first API isn’t complicated, but it will take time and effort.

Start with the fundamentals - make all of your features available through your API, and get your documentation up to date.  Then, if need be, work to make you API AI friendly.

Customers are going to bring their own AI to your API and do amazing new things that you would never have imagined.  Embrace the change.

BYO-AI API Support

Long before AI becomes good enough to take over today’s developer jobs, it is going to unleash an explosion of programming, opening up the unprofitable low end. The transformational use case for AI development will be letting non-developers use APIs.  For SaaS companies, expect to see AI tools become your most common 3rd party integrator.  Not the highest volume and certainly not the best integrator, but when it comes to customer enablement, nothing else will be able to compete.

If you’re a SaaS, your customers are going to demand BYO-AI support!

Major Implications for SaaS Companies

According to best practices, every SaaS company has been API First for a decade now.  That means that the APIs and UIs are separate.  Everything the UI does is through the API and in theory a customer could write their own UI.  SaaS with white labeling and reseller revenue streams may even have bespoke UIs.

In the real world however, public facing APIs are rarely complete.  Tech debt, security, business models, and other concerns result in some features not being accessible through the API.

What’s a SaaS to do?  

Anything not available through the API is not available to customer’s AI developers.  Building AI features into the UI offers a partial solution with three large drawbacks:

  1. The implementation is limited to how the SaaS’s product designers think about using the service, not how customers want to use the service.
  2. The SaaS has to pay for the AI access instead of the customer.
  3. The AI is locked in the UI and can't interact with the rest of the customer’s workflow.

The first point is the most important - any SaaS that sets up internal AIs will always be playing catchup with the ideas of their customers and competitors.

Alternatively, being truly, completely, API First frees a SaaS to celebrate customer creativity.  AI development and crazy implementations can become community building activities.  Watching what customers build is free market research about what features the UI is missing.  Build those features for the less savvy customers.

First, Go API First

The first step for every SaaS is to get every feature fully into the API.  Make everything available to your customer’s AI of choice.

Embrace BYO-AI and let your customer’s visions soar!

First, AI will do unprofitable programming work

In a recent episode of NeverRewrite, Isaac and I discussed the implications of AI doing rewrites for developers.  

So what if things change?

AI will probably replace most of the coding that developers do day-to-day today.  Today’s developers don’t punch punch cards, don’t design circuits, or write assembly code.  The nature of development has changed in the past, and will change in the future.

The first killer app for the PC was Lotus 1-2-3, which made spreadsheets widely accessible.  People used Lotus to perform a lot of accounting functions, but we still have accounting software.  Spreadsheets didn’t replace special function software, they created a new category of general purpose tools.

Rather than eating software development jobs, AI is a general purpose tool that will enable an explosion of software at the unprofitable low end.

What is The Unprofitable Low End of Software Development?

Simply, software developers are expensive.  There is a lot of potential software that could be written, but wouldn’t be profitable enough to hire someone to write.  There are tons of single use, single purpose tasks that could be replaced with a small bit of code, but only if you happened to have a developer nearby.

No Code / Low Code solutions help narrow the gap, but there are tons of tasks that are still too small to be generalized.

For example, I recently took a 3,500 product catalog in CSV form and wrote some python to upload the products to Shopify.  It also performed a second step to pull in the images from the factory’s website and associated them with the new products.  Shopify has great tools, uploading the file would be easy, but adding the images would have been a daunting and dull manual task.

Easy for a developer though; I ran it once, and will probably never touch the code again.

Trust, When You Can Verify

AI can write mostly correct code today.  When you can verify the results, you can accept them.

In the Shopify example you can verify by checking to see how many products were created.  You can check to see if they have images.  If it showed up on Shopify, then the software is correct.  It is running locally so performance and security pretty much don’t matter.  Optimized string functions and defensive string escaping aren’t concerns when you are only dealing with one file, once.

Prediction: AI Will Increase API Usage

As a development tool, AI will turn the average user into a mediocre API developer.  There will be an explosion of non-technical people using company’s APIs to solve bespoke problems in ways that couldn’t be done profitably before AI.  This won’t reduce the need for developers, it will increase the demand for people who can write APIs that are resilient, performant and secure.

Expect a flood of customers using your API in ways you couldn’t imagine.  The question isn’t how to have AI write code for your company, the question is how to make it easy for AI to use your API.

I can’t wait to see what people come up with!

Site Footer