Endpoints
The FrausAI Framework exposes several APIs for interacting with its core functionalities, enabling developers to manage agents, query memory, use tools, and store/retrieve data efficiently.
Base URL
All API requests are made to the following base URL:
https://api.fraus.ai
Endpoints
1. /check-agent/:agentName
Description: Checks if an agent with the specified name exists in the system.
Method: GET
Path Parameters:
agentName
: The name of the agent to check.
Response:
200 OK
: Agent exists.404 Not Found
: Agent does not exist.500 Internal Server Error
: If the system encounters an error.
Example Request:
curl -X GET "https://api.fraus.ai/check-agent/MyAgent"
Example Response:
{
"exists": true
}
2. /store-agent
Description: Stores a new agent's details in the system.
Method: POST
Request Body:
agentName
: (String) The name of the agent to store.agentDetails
: (Object) The details of the agent (e.g., role, skills).
Response:
200 OK
: Agent stored successfully.400 Bad Request
: Missing or invalid parameters.500 Internal Server Error
: If the system encounters an error.
Example Request:
curl -X POST "https://api.fraus.ai/store-agent" \
-H "Content-Type: application/json" \
-d '{
"agentName": "TestAgent",
"agentDetails": {
"role": "assistant",
"skills": ["AI", "NLP"]
}
}'
Example Response:
{
"message": "Agent TestAgent saved successfully."
}
3. /execute-trade
Description: Executes a trade action (buy or sell) for a specific token.
Method: POST
Request Body:
token
: (String) The token symbol.amount
: (Number) The amount to trade.action
: (String) Either "buy" or "sell".
Response:
200 OK
: Trade executed successfully.400 Bad Request
: Invalid parameters.500 Internal Server Error
: If the system encounters an error.
Example Request:
curl -X POST "https://api.fraus.ai/execute-trade" \
-H "Content-Type: application/json" \
-d '{
"token": "BTC",
"amount": 100,
"action": "buy"
}'
Example Response:
{
"status": "success",
"message": "Trade executed for 100 BTC."
}
4. /query-llm
Description: Queries the Large Language Model (LLM) for natural language processing tasks.
Method: POST
Request Body:
prompt
: (String) The query string for the LLM.context
: (Object) Optional context for the query.
Response:
200 OK
: Query response from the LLM.400 Bad Request
: Invalid parameters.500 Internal Server Error
: If the system encounters an error.
Example Request:
curl -X POST "https://api.fraus.ai/query-llm" \
-H "Content-Type: application/json" \
-d '{
"prompt": "What is the market trend for AI technologies?",
"context": { "industry": "AI" }
}'
Example Response:
{
"response": "The market for AI technologies is growing rapidly, driven by advancements in machine learning and automation."
}
5. /fetch-memory
Description: Retrieves memory details for a specific agent.
Method: POST
Request Body:
agentName
: (String) The name of the agent.key
: (String) The memory key to fetch.
Response:
200 OK
: Memory retrieved successfully.404 Not Found
: Memory key not found.500 Internal Server Error
: If the system encounters an error.
Example Request:
curl -X POST "https://api.fraus.ai/fetch-memory" \
-H "Content-Type: application/json" \
-d '{
"agentName": "TestAgent",
"key": "session_data"
}'
Example Response:
{
"key": "session_data",
"value": "This is some saved session data."
}
6. /store-memory
Description: Stores memory for a specific agent.
Method: POST
Request Body:
agentName
: (String) The name of the agent.key
: (String) The memory key.value
: (String) The value to store.
Response:
200 OK
: Memory stored successfully.500 Internal Server Error
: If the system encounters an error.
Example Request:
curl -X POST "https://api.fraus.ai/store-memory" \
-H "Content-Type: application/json" \
-d '{
"agentName": "TestAgent",
"key": "session_data",
"value": "Some new session data."
}'
Example Response:
{
"message": "Memory stored successfully."
}
Last updated