AI Agent Service APIs
This service is part of the Crypto.com AI Agent SDK, designed to facilitate querying blockchain services via Natural Language Processing (NLP) integrated with OpenAI. The core logic of the service interprets user queries, matches them with blockchain functions, and interacts with blockchain nodes and explorers.
Background
The Crypto.com AI Agent Service API integrates multiple technologies to provide a seamless interaction with blockchain services via natural language queries. The core logic is divided into several components:
Agent Logic: This stores the core mapping logic between user input and blockchain functions. It uses OpenAI's NLP capabilities to map the user’s query to the corresponding blockchain function.
Blockchain Service: A collection of blockchain commands such as
getLatestBlock
,createWallet
, etc. These commands interact with blockchain nodes to retrieve or perform actions.Explorer Integration: This component interacts with blockchain explorers to retrieve additional blockchain data using the Cronos explorer APIs.
API url: https://ai-agent-api.crypto.com/api/v1/cdc-ai-agent-service (Rate limited to 50 requests per minute)
Features
NLP Query Mapping: Maps user queries to blockchain functions using OpenAI.
Blockchain Commands: Perform blockchain-specific commands such as retrieving blocks, creating wallets, and more.
Explorer API Integration: Fetch blockchain data from the Cronos explorer APIs.
Health Monitoring: A health check route to monitor the API’s status and uptime.
How It works
The service exposes two main API routes:
Health Check Route: Provides basic uptime and response time of the service, allowing users or automated systems to monitor the API.
Query Route: Allows the user to input a query in natural language, which is processed by the core Agent logic. This logic, powered by OpenAI, maps the input to a specific blockchain function and executes the corresponding action on the blockchain.
The architecture:
The query server accepts a query and processes it through the agent logic.
OpenAI processes the query using NLP and matches it with a relevant function.
The matched function is then executed by interacting with the blockchain service or explorer APIs to retrieve or perform the desired action.
API Endpoints
Health Check
Endpoint:
/healthcheck
Method:
GET
Description: Returns the uptime and health status of the service.
Example:
Response Example:
Query Route
Endpoint:
/api/v1/cdc-ai-agent-service/query
Method:
POST
Description: Takes a natural language query, maps it to a blockchain command via OpenAI, and executes the command.
Example: Getting the latest block - With get latest block
Here are the key details for:
Cronos zkEVM
Cronos EVM
Response Example:
Last updated