 Hi everybody, welcome. I am super happy to see you all and speaking here. Today's topic is about how you can power your AI solutions built on, let's say, chat GPT using API management or one-heart mechanism of API management like API gateway. But we start first with understanding chat GPT. So let me introduce myself for Zeus who wasn't in the presentation. My name is Bobur, you can call me Tiger, I also repeated this. But my colleagues, they call me sometimes short BI. That stands for Bobur International. Like the idea is Bobur International, I can easily find out the common language with any nationalities around the world, wherever I was. So this is why you can call me like Bobur International. If you have any questions, you can reach out to me on the social channels or Instagram, Twitter, LinkedIn and so on. Today, we will talk about, by shortly introducing your, what is chat GPT, like who is using chat GPT? Ah, so many people, if I ask as vice versa, like differently, who is not using chat GPT? Yeah, that's a problem. You are not using chat GPT. Come on, like you should use from today. You should use from today after my presentation, you understand why. Chat GPT you should use, okay? And I will also explain like what is an open AI API plus chat GPT, what's the API and API management, right? And also you understand the benefits of integrating this chat GPT or open AI API with API management and how we can use, let's say, plugins, existing plugins to enhance these AI solutions in our applications. In the end, I have also demo to show you how these features can be helpful for the AI solution. So APIs, right? By now we are all familiar with this term because we are living in increasingly API-centric world, right? Every service we use today either uses API or they are APIs, right? Even chat GPT uses API, I asked myself in the chat, like if chat GPT uses API, yes, or if we can use the chat GPT. You can use, for example, chat GPT through the API using platform call it or open AI API, also open AI solution by writing some code in the client or by directly calling your REST APIs, right? Where chat GPT or open AI has recently announced that there's another cool feature where you can create your own custom plugins for provide some AI solutions in your application, right? Or you can use some existing plugins. There are some plugins already available if you are using plus, chat GPT plus paid account, right? I have free account but I migrated to paid to show you this presentation. Yeah, welcome. This is actually plugins, why API is important because these plugins are using API under the hood because what it does when you chat and ask in chat GPT, book me this flight and hotel for tomorrow, it uses that's a booking.com API to fetch the data, what kind of booking available automatically and books this flight or hotel for you. That's why it uses both your API data and its own data to have a complex solution. Clear, right? The custom plugins, chat GPT, the APIs. So let's talk about now, open AI API. It's the same as chat GPT. How you are using interface, right? I am asking a question and answering this question. API means you're programmatically ask AI to do something. Like I can ask anything, right? I can ask any sort of API. I can use the rest. I think they are providing now only rest solution. You can do some code completion or text generation, you will see soon. For example, I can ask one text. For example, what is a Dev conference in Bruno? It can answer AI if it has an out-to-date information. I think it has like a 2021 until this data. Or it can help me to write some code, find out some bugs, right? Or it can generate some images or variations of images and so on. This is how API does without interface. And how chat GPT can help developers? This is, I think, the most important question everybody asks themselves. Is there any idea? How chat GPT can help developers? Yeah, go ahead. Yeah, this is actually use case. What kind of, for which programming language? TypeScript. TypeScript, okay, right. But it's helping, right? At least like 50% making up more performance, right? For me, also, it helps with generating codes. For example, I am a contributor to API6 project. It's, you can write some plugins, right? In Lua programming language, I don't know Lua, honestly. I don't want to learn because I know advanced languages. I don't have to learn. I can use chat GPT, ask, like, can you write me some Lua code? It does actually 95% correctly like this Lua code is written for me. I was able to create new plugin called File Proxy. You can check a link I will provide. Like, it is not a topic of today, but what I am trying to explain to you, it can exactly help you to generate some code. And also, writing some test cases. I had a chance to talk to some companies. They are now using chat GPT to write some integration tests because usually for integration tests, you need input data, right? If some user clicks this button, this something should happen or like this. In this case, chat GPT can create some input for your programs. For testing, it's really good for generating documents. Like, if you are writing as a developer some documentation, you don't have to write your own, your own one. You can just ask chat GPT, please explain this API, what it does. And write the swagger definition or sorry, open API definition. It can create open API definition. Is it reduce the time, right? As a use case, I'm gonna skip. Just to give you idea, you can observe yourself. If you're using chat GPT, you know what the capability is. I'm not promoting chat GPT. I don't work for Microsoft. And this is the differences. Like, as I say, chat GPT interface. You can use as a user friendly. You can ask some questions. API just makes this AI models solve the rest. And you can interact with AI inside your application. This is one advantages of API using API. I will, you will see how it can take a benefit in my demo. And my statement here, okay, we understood, chat GPT uses APIs to write some custom plugins. And custom plugins able to call API, right? Again, API usage. And also, we do have a lot of service using chat GPT through the API. In this case, my API should be secure, first of all. And second of all, it should be scalable. I should be able to scale my APIs, right? By running different instances of the same API. So one, if one instance fails, it should always fall back to another instance. And should be available 100% of the time. How to achieve this? How to make our API secure, performant and scalable? Yeah, yeah. That's actually great, but I asked this question also. But there was a lot of solutions, right? They available, it was in the chat. But then I end up with, this is about API indicators, right? Successful indicators like performance, availability and security. And then one answer wise, I don't know why I'm using API gateway. If you want to have a secure performance and scalable APIs, you can use API gateway. Why? From the bruiser talk also, I was explaining API gateway because in the center, right? In the heart, like it can know all these APIs exposed by your backend services. It means like it can control the security, right? There's a door, I cannot go inside, but in the inside, my friends, but to see my friends, I need to stay caught or how to say access this information, right? API gateway also like a front door to accept the request and to secure your applications. Also, it can scale. Your backend service can also scale, but also API gateway can also scale in such a way that like for three service, one API gateway, like there is a concept of backend for front end, right? You can use separate API gateway for wild applications, separate API gateway for, let's say web application, so on, to show different information on different applications. My colleague, Nikola, also here, he has a very famous talk. It's called the backend for front end, right? You can also talk to him like it's, he can explain a lot of usability about this backend for front end solutions. And of course, the plugins, another important fact in API gateways, you can use plugins to achieve this stuff, like observability. I had a presentation just before this, how you can observe API using API gateway or how you can make authentication like a single sign-on or how you can use identity providers like Google or maybe some other identity providers in API gateway. So API six, I can introduce one more time. This is on my T-shirt, open source project, also API gateway. We can use it for free. There is a lot of features, good features like plugin hot reloading. For example, what it doesn't mean, let's say we say it like our API should be performance, right? You don't have to add, you don't have to stop your current running server if you want to enable new plugin. Without any downtime, you can delete or add additional plugin. This is one of the capabilities of API six without stopping, right? And other capabilities like a plugin development, you can create your own plugin in your favorite programming language. Like as I said, I don't know Lua, I hate Lua, I can use Java plugin runner to create my Java or chat GPT, ask GPT to write some Lua code. And of course, dashboard, you can use dashboard to achieve the same things without writing any code in the local environment. This is some of the cool features why I like API six. And next topic is how, okay, use this API gateway and AI together because my problem statement was for chat GPT, we need secure APIs. In this case, I can use API gateway to secure like my API calls, right? I can enable JWT token based authentication or I can enable even a basic authentication of this just user password and login. If you imagine like you want to have this authentication enable it within your code. If you're using Java screen framework, you need to write, you need to use spring, right? You need to do some configuration, do a lot of stuff, even chat GPT helps you, it takes time. But the API gateway, you can just use one plugin and to enable your security feature. It's a little bit faster, not time consuming because you already tested by the community members. Another thing is performance in chat GPT. For example, if you're using APIs to ask something on AI, it takes first of all some time and also it's not for free, you need to pay each time you ask a chat GPT. In this case, you can use API gateway caching mechanism to cache some responses so that you can use this response in the future. It improves also performance. This is some indicators. And you can use other plugins just to rate limiting. For example, you can limit the API accesses per maybe some amount of time. I can say only three users can request my API for free. 100 request per maybe minute. If they are using more, I will ask, please pay for the other usage or change your layer, paying layer. Like maybe pay as you go and so on. There are some other features you can use with AI. I'm gonna demo soon in this picture. As you can see, this picture illustrates let's assume that I have one client application. I am building one startup project. Mobile application maybe. You will see mobile application. And this mobile application talks to API gateway. And API gateway has a one single endpoint slash ask me anything. We can ask anything, right? And then it actually enables some plugins to control the authentication, rate limiting, security and so on. And under the hood also it does call to AI.ai chat. It's endpoint. It's exposed by my Spring Boot application. I built the Spring Boot applications that it interacts with AI. You will see. And basically I have one of my website.com slash ask me anything endpoint. It's my own domain. I am calling to another domain Spring Boot backend service to get some data. Clear, right? This is an architecture diagram. Right. Simple, yes. And next one, if you assume that one Spring Boot application receives request slash an AI chat, it can call slash V1 slash compilations endpoint of open AI. It's actually existing API exposed by chat GPT. You can use endpoint to ask anything. This part also clear, right? How the request flow going to AI and coming to the from the AI. If it's clear, we can jump to demo session. Here in the presentation, you can also scan the square code. It brings you to GitHub repository with my demo. If you want to try yourself at the end of the session, if you're interested enough on AI solutions, who is a Java developer here? Oh, I'm also a Java developer. Because actually this demo, I use the Java and Spring Framework to achieve. Let me show you. If you open this square code, it brings you to this API six Java chat GPT opening API report. And I have some brains, like depending on what you want to achieve. Like one branch, a main branch, for example, shows in the old way how you can use some code commands to enable some plugins. For example, you can also check the API six documentation. Let me switch to the next one. Documentation to use API gateway, you need to, for example, create upstream, route, or plugins and so on, right? This is one way of configuring API gateway. There is another way of setting up API gateway by using standalone version. Let me switch back. I am gonna demo it with standalone, because standalone, what it does, you can just write one YAML file, single YAML file with your older routes, plugins configuration, and it, you don't have to change next. If you want to change, it automatically updates, because API six is a hot reloading, right? And if you open this branch, there are some folders, one folder is OpenAI API, it's a Java application, simple Java application, it has a POM.xml file, right? If you open POM.xml file, there is one library, it's actually just Spring Bootstarter web application, and I am using one community API that wraps some API calls to charge your PT in Java. You can also build your own, like this SDK, it's not difficult to interact with OpenAI API, because if you open API API documentation, there are enough documentation, actually, like you can see API references, like it can teach you how you can authenticate to AI, right? For example, if you authenticate to AI, you need to use API key, or if you want to use some other endpoints, like let's say chat completion, you need to request this endpoint, if you remember from the architecture diagram, I had this slash V1, I'm gonna call this chat completion endpoint now, without Java now, without API gateway, let's do that. I assume that I have API key here, I have API key, I have paid account, I paid $10 USD to make this demo, but it's not the case, please don't use my API key, it can overuse. Let's do one request just to show you, like how this AI works. For example, I have here prepared some common examples, I'm gonna request AI.com, openAI.com, chat completion endpoint, with my authorization key, and I am just saying you are helpful assistant, let's say. If I send this request, let me open my terminal here, and separate chat, there you go, and we can open one more time here, so I hope it's visible, if I see, please enter, you see, it's charge pt responding me now, thank you, how I can assist you today, right? This is very simple, right? I can show the model, which model AI model I want to use, I can use chat gpt4 also, now I'm using 3.5 turbo version, you can have a look in the documentation, it explains which model, with what kind of power they can offer, but what if, now I don't want to use coral command, because I want to add some functionality, because I'm building application, right? To ask anything, in this case, I built my Java application, as we started from the beginning, let's say under open app documentation, as you can see, I have a simple Java application with single controller class, with single endpoint, also called slash AI chat, that uses a community library to send the same request we did with coral, just now, right? For example, I can ask anything from this chat. So, and I have a Docker compose, that builds API six, my Java application, and Upsmit, you will see soon, because I'm using building full stack startup project. Upsmit is UI solution, it's also open source, you can check, you will see the screen, what I did. First of all, let me show you end solution, what end solution was, and I will explain it a little bit down. End solution is, I have, let's say, let's run this Docker compose file, with two containers, API six, open API, API. So, once my containers are up and running, I'm using Docker desktop, and we have 10 minutes, sorry, yeah, I'm going fast, don't worry. If I open this Upsmit UI, you will see my UI application here, local host, here we go. Oh, let's now, it's not opening. Let's do one more time, yes. Upsmit is starting, it's UI builder framework, you don't have to learn front end to build this UI, like JavaScript or HTML, CSS, you can just use the dashboard with widgets, ready components for these components to build the applications. You will see now, once it's starting, I have already one build application, a little bit of loading, here we go. My first AI application is called, using Upsmit, if I launch it, it has two pages, let me bring one more time, here we go, seeing from here that I can also launch, preview version, here we go. It has two pages, one login page and main page, because we need a security, right, for the application, first of all, so that my users can log in and also use some AI solution. For the login page, I use a simple UI, right, but it's under the hood using API6. API6 enable JWT token authentication, like when I, for example, register my user on API6, they can use their emails to log in in, and then API6 sends back the token, JWT token, so that Upsmit application saves this token to the store. The other request will be just direct, using authentication header. Let's go, if you do login, login successful, I am on the main page. I'm not gonna ask about Microsoft Azure, you can ask any questions here. What do you want to me ask here? How old are you? Let's ask it. It's actually automatically reloaded the page, right? You see the response coming from AI, this one, because on your first load, up the web page, it's responding. How old are you? Now, so again, LGBT cannot respond to specific questions. Let's see. I am AI, blah, blah, blah, blah, probably the answer. It's innovative, age-gazing design. Yeah. Okay. Yeah. Do you have a question? Sorry? Yes. Beyond what? Beyond. Do you want me to ask a question here also? How it's pronounced? This one, beyond? Correct? D. D. Like this? B is Y. Like this? Exactly. What is this? English. Yeah. Let's ask. Maybe it doesn't know. Because no, the only is compressive online tool. Because no, you are not right. Actually, this, the old data, right? 21, 2021. That's why AI solution is old. What I'm trying to explain here, actually not the UI or not how we are responding, also here is how the security feature is working. I didn't spend much time for this demo. 15 minutes, I built this JWT-based application with API gateway, right? For example, I can log in, I can log out, I can do registration just without spending time. For example, if I do log out, now the API 6 just gets invalidates JWT token and I need to request again. And the same pass repeats, right? And you need to ask some question and AI solution just questions. So that was kind of demo, the simple application here. But under the hood, under the hood, what's happening? Actually, what's happening? First of all, I had one API 6 setup here. As you can see, it's a simple YAML file as you configure your Kubernetes. I am configuring my backend application, my backend application Java, right? Which is running on Docker, yes, five minutes. Docker open API and I have route, call it, ask me anything. If you remember from diagram, ask me anything. And while ask me anything is called from external app submit application, we are using proxy rewrite because this ask me anything endpoint should be rewrited to this URI, right? Java URA, actually AI chat, not ask me anything. As you can see here in this one, this is AI chat and API 6 actually rewriting the URI. And also I am using for the login slash login endpoint, single plug in, call it JWT. And I have one API consumer. API consumer, if you remember, I use it, it's email address here, app submit, gmail.com. How it's easy, right? I have created consumer with single like a YAML file and with that, that's all API 6 is ready and I have one Java applications ready and with single two pages, the app submit UI is ready. And now my question to you, who would like to invest in this startup project? Is it, I mean, at least it can do something, right? Of course, sorry, it's a new future requirement. I will add, Diane. What do you want? Yeah, sometimes that's the point, like why a JGPT is a standard custom plug-in development. In this case, I know that Diane's city exists. I can add them to my open database, to my Java application, for example. And then I can combine these two responses together. In this case, I can empower my AI solution, right? Yeah. So, how much do you want to put into investment? Do you want to have a question? Yeah, yeah, yeah. But yeah, if you're interested, just look, please. Yeah, go ahead. Yeah, only if you can see in my demo, only AI of an API is paid, but the rest is, of course, for free. I think I don't remember it was 18 USD dollars provided also at JGPT, for free usage. I used it five months, it's actually long, you can use. Until you build something real, like my application. Yeah, the question I will repeat, what we want to implement additional features, right? Yeah, yeah, okay. I want to implement some features, but I couldn't because the restrictions by the open API, yes, there are a lot of restrictions. It's the right question. Restriction is one, we found it's all data. We cannot use all data. And the restriction is we cannot believe the JGPT, some private information related to the company, right? In this case, I should use my open storage. If one of my friends, he's actually not in IT, he asked a question, like he really, good question. Okay, JGPT we're using. What I want to use is also my open data inside the JGPT and I should also save this response in my storage for the future. Also some, it's impossible now. Maybe there is a plugin, it can be achievable, but it's not as a production ready. Storage like this, yes, yes. There is a plugin, I don't forget the name, but I think there is a plugin also to achieve this. You know, I remember also Azure had announced that one JGPT flow called a separate service on Azure where you can specify flow. Like I said, one output should be input to another JGPT so that you can have complex flows in this, be the storage, I mean. Yeah. Yeah, is there any features that I want to implement, but there is still some time to implement it. I want to put, for example, my own custom plugin. That shows all the discounts around the city, but the limitation, I haven't get my access to use this custom plugin development. We can discuss with you later, like other limitations. So we can stop because we are running out of time. Thank you all for your attention. I'm happy. You can check this demo, it's great. AI is great, let's see future, what it brings. Thank you.