DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • ChatGPT Applications: Unleashing the Potential Across Industries
  • ReactJS With ChatGPT: Building Conversational AI Into Your Web Apps
  • AI Code Intentions
  • When Technology Broke and How We Fixed It (The Evolution of APIs)

Trending

  • How Clojure Shapes Teams and Products
  • SQL Server Index Optimization Strategies: Best Practices with Ola Hallengren’s Scripts
  • Rust and WebAssembly: Unlocking High-Performance Web Apps
  • Power BI Embedded Analytics — Part 2: Power BI Embedded Overview
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Adapting API Strategies to Dynamic AI Trend

Adapting API Strategies to Dynamic AI Trend

AI is getting a lot of attention these days. This article explores what the AI trend means for those of us developing products using APIs.

By 
Bobur Umurzokov user avatar
Bobur Umurzokov
·
Oct. 05, 23 · Analysis
Likes (4)
Comment
Save
Tweet
Share
3.3K Views

Join the DZone community and get the full member experience.

Join For Free

In today's rapidly evolving technological landscape, Artificial Intelligence (AI) is getting a lot of attention. Everywhere you look on social media, there are new AI startups, prompt engineering tools, and Large Language Model (LLM) solutions. And it's not surprising because AI feels almost like magic! For instance, ChatGPT really got everyone excited. It got 100 million users in just two months after it became publicly available, making it super popular, super fast.

Now, everyone's wondering: what does this AI wave mean for me, my work, and my products? More specifically, how does it impact those who are at the forefront of building digital products and applications using APIs? This article explores what the AI trend means for those of us making digital tools using APIs.

APIs Make AI Accessible to All

Major companies have been quick to establish dedicated AI research labs, recruiting data scientists to craft AI models. But what about smaller entities without the massive computing resources and GPUs for an AI research lab? Are they to just observe as larger firms capitalize on the AI revolution? The answer is no. For many AI applications, particularly those centered around natural language, there's no need for a special AI research lab. Instead, existing public AI models, LLMs, can be utilized. This means that developers don't need to be AI experts; they just need to be proficient with APIs. Through prompt engineering, fine-tuning, and embeddings, these models can be customized to serve specific requirements.

The magic word here is "APIs." APIs encapsulate the complexities of their contents, making AI models accessible to all developers, regardless of their expertise in AI. This separation of concerns ensures that while a select few data scientists create AI models and package them as APIs, a larger pool of developers can integrate these models into their applications, crafting "smart" solutions proficient in natural language processing. The outcome is that APIs level the playing field, granting access to powerful AI models for developers of all company sizes.

Call AI Services via API

AI and API Patterns for Modern Applications

APIs are key in linking your product to everything else. They're great at connecting different software components. When we talk about AI, this connection is even more crucial because AI needs to work with different data sources and tools to be useful. Modern applications consistently leverage both AI and APIs. While AI imparts "smartness" to applications, enabling them to comprehend human language and intent, APIs facilitate data access and system connections. These technologies aren't just parallel entities, and their combined use can be synergistic. There are three primary patterns for their integration:

Pattern 1: Call AI Services via API

AI models, like OpenAI ChatGPT, are often packaged as APIs. Through these APIs, developers can trigger the AI, sending prompts as input allowing developers to integrate AI into their applications seamlessly. A commonly used architecture for building a new AI app also utilizes two OpenAI API endpoints, like Vector Embeddings and Chat Completion, as you see in the diagram below:

This method first creates vector embeddings through OpenAI API for each input document (text, image, CSV, PDF, or other types of structured/unstructured data), then indexes generated embeddings for fast retrieval and saves them into storage like vector databases for fast retrieval, and these documents are presented to ChatGPT along with a user’s question as a prompt. With this added custom knowledge, ChatGPT can respond intelligently to user queries.

Pattern 2: AI Services Call APIs

The output from an AI model in response to a prompt is typically textual. To translate these "ideas" into actionable outcomes, AI services need to call APIs. These APIs can initiate actions in the real or digital world, such as making payments, booking an appointment, sending messages, or adjusting room temperatures. In essence, APIs act as the hands of an AI service, enabling it to interact with its environment. A good example of it can be ChatGPT custom plugins. This article explains how to build a custom plugin for API Gateway using APISIX. Because APISIX can be in the front of APIs to route AI requests to the intended backend API services. We can implement security measures like authentication, authorization, and rate limiting or cache similar responses from APIs, and it allows us to gather valuable insights about API usage, performance, and potential issues.

Pattern 3: AI Connects APIs

Years ago, to make two software systems or APIs communicate, the only option was manual coding. software engineers would craft complex and fragile code sequences. This task was solely for developers, and every modification meant more coding, leading to a tangled web of interconnecting codes.

With the advent of generative AI, interacting with an Integration Platform as a Service (iPaaS) could be as straightforward as making a request in a chat. If you want data from one platform to synchronize with another, you don't need to understand the technicalities. You just need to specify your requirements. For instance, you might say, "Sync customer lead scores from Marketo to Salesforce." or ask AI to move data from one API to another. The AI will then handle the process, test its compatibility, and fix any issues autonomously. The APIs used in your integrations are always changing, and this sometimes can cause problems. AI can monitor the health of your data integrations and keep fixing the errors or simply send alert notifications in natural language if an entry in an API request or response requires attention.

Safeguarding API Usage

With AI's capability to call APIs that initiate actions in the real or digital world, it's critical to implement safeguards. This safeguarding, ideally implemented at the API management system level, is required to ensure the responsible and secure use of AI. This post explores how API Gateway can be beneficial for ChatGPT plugin developers to expose, secure, manage, and monitor their API endpoints.

In Conclusion

APIs provide the perfect building blocks for AI-driven software development. The combination of APIs and AI technologies is vital for developing powerful applications. The three identified patterns—applications integrating AI functionality through APIs and AI services invoking APIs for actions—offer a roadmap for leveraging AI in application development. As the AI landscape continues to evolve, the focus on APIs and the strategies for its integration will become even more important.

AI API Language model applications Data (computing) ChatGPT

Published at DZone with permission of Bobur Umurzokov. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • ChatGPT Applications: Unleashing the Potential Across Industries
  • ReactJS With ChatGPT: Building Conversational AI Into Your Web Apps
  • AI Code Intentions
  • When Technology Broke and How We Fixed It (The Evolution of APIs)

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!