The Concept of API

The Principle of API
In 302.AI's API Markt, almost all APIs are implemented through HTTP network requests.
Each API request represents a specific action with a clear purpose. For example, an API request to generate an image represents the action of creating one image. This is determined by the API path, which is the URL of the HTTP request.
Each action has corresponding requirements. For instance, if you want to generate an image of a dog, this is determined by the input API parameters.
After sending a request, you receive a response, which is the final output result. At 302.AI, we can debug online through the Web to get results without any code.
Path (purpose) + Parameters (input) + Response (output) = Complete API request
Advantages of API
The essence of API is to hide complexity, concealing all the complex operations behind it, with only a simple input and output.
Using APIs, you only need to focus on the start and result, without worrying about any intermediate processes. This greatly simplifies the usage and development process, making application building more efficient and quick. This approach not only saves time but also allows developers to focus more on implementing core functionalities.
What is an API Key
At 302.AI, the vast majority of APIs are paid services. Therefore, to identify yourself, you must include a personal identifier when making a request, which is the API Key. This is similar to entering a venue that requires a ticket; the API Key is like your ticket, proving that you have the right to enter and use the corresponding facilities.
This ticket (API Key), if lost and found by someone else, could be used to impersonate you and spend money from your account. So it's crucial not to disclose it. If leaked, promptly delete it in the backend and generate a new API Key.
