What is an API?
An API (Application Programming Interface) works like a waiter in a restaurant. When you make a request:
You (the customer) send a request to the API (the waiter)
The API transmits that request to the server (the kitchen)
The server processes the request and prepares a response
The API delivers that response back to you
This analogy perfectly illustrates the intermediary role of the API, which acts as a bridge between the user and the company's server.
Why are APIs necessary?
There are four main reasons why we use APIs instead of directly accessing servers:
Security: APIs provide a layer of protection, preventing direct access to servers and their sensitive data
Standardization: Even different companies use similar standards in their APIs, making integration development easier
Scalability and Performance: APIs can limit requests, ensuring the system isn’t overloaded and maintains good performance for all users
Compatibility: The standardization of APIs allows developers to access multiple services using similar methodologies
Understanding HTTP Requests
HTTP requests (Hypertext Transfer Protocol) are like letters sent to a recipient. Each HTTP request contains:
URL - The "address" of the server (e.g. tess.pareto.io/api/agents/{ID}/execute)
Method - The desired action (GET to retrieve information, POST to send data)
Headers - Additional information like authentication (e.g. Authorization: Bearer + Token)
Body - The request body, usually in JSON format
Anatomy of an HTTP Request for TESS AI
A typical request to execute an agent in TESS includes:
URL: Specific address that identifies the agent to be executed
Method: Usually POST to execute actions
Headers:
Authorization with your access token
Content-Type indicating the format (usually application/json)
Body: JSON data containing parameters like:
temperature (level of creativity)
model to be used
message to be processed
available tools
execution waiting options
attachments (if needed)
Example of an HTTP request
Suppose you want to access the TESS AI API and run an agent. You can make an HTTP request with the following structure:
Method: POST
Headers: Authorization: Bearer [your_token]
Body: JSON with agent information, such as temperature and model.
This introduction sets the stage for the next trainings, where practical applications like running agents via API and processing the received responses will be covered!