Trade Mind API
📚 Trade Mind API Documentation
Overview
Trade Mind API is a powerful set of RESTful interfaces that allow developers to interact with the Trade Mind platform programmatically. You can create and manage agents, models, files, tools, prompts, categories, and more.
Base URL
All API requests use the following base URL:
https://api.trademind.network
Authentication
Trade Mind API uses API Token Authentication.
Obtaining an API Token
You can get your API Token via:
Official Website: Log in to trademind.network → Profile Settings → API Token.
API Request:
POST /api/open/token
Using the API Token
Include your token in the HTTP headers for all API calls:
pythonCopyEditimport requests
headers = {"X-API-Token": "tk_your_api_token"}
response = requests.get(
"https://api.trademind.network/api/agents",
headers=headers
)
print(response.json())
API Token Format
API Tokens are in the format:
TRD-MND-XX_xxxxxxx_xxxxx_xxxxx
Resetting an API Token
To reset a compromised token:
POST /api/open/token/reset
Note: Resetting will invalidate your old token.
✨ Open Dialogue API
Trade Mind offers a simple dialogue API for real-time agent interaction.
Endpoint
POST /api/open/agents/{agent_id}/dialogue
Authentication
Send your API Token in the X-API-Token
header.
Request Parameters
message
string
Yes
User message content
conversation_id
string
No
Optional ID to continue a conversation
Example Usage
Curl Example
curl -X POST https://api.trademind.network/api/open/agents/{agent_id}/dialogue \
-H "Content-Type: application/json" \
-H "X-API-Token: tk_your_api_token" \
-d '{
"message": "Hello, please introduce yourself",
"conversation_id": "your-convo-id"
}'
Python Example
import requests
token = "tk_your_api_token"
agent_id = "your_agent_id"
response = requests.post(
f"https://api.trademind.network/api/open/agents/{agent_id}/dialogue",
headers={"X-API-Token": token},
json={
"message": "Hello, introduce yourself",
"conversation_id": "your-custom-convo-id"
},
stream=True
)
for chunk in response.iter_lines():
if chunk:
print(chunk.decode('utf-8'))
Response Format
The response is Server-Sent Events (SSE):
event: status – Status updates
event: message – Actual chat message content
Example:
event: status
data: {"message": "task understanding"}
event: message
data: {"type": "markdown", "text": "Hello!"}
🔥 API Routes
Authentication
/api/open/token
POST
Obtain API Token
/api/open/token/reset
POST
Reset API Token
Agents
/api/agents
GET
List all agents
/api/agents
POST
Create new agent
/api/agents/{agent_id}
GET
Get agent details
/api/agents/{agent_id}
PUT
Update agent
/api/agents/{agent_id}
DELETE
Delete agent
/api/agents/{agent_id}/chat
POST
Chat with agent
Open Dialogue
/api/open/agents/{agent_id}/dialogue
POST
Open dialogue with agent
Models
/api/models
GET
List all models
/api/models
POST
Add new model
/api/models/{model_id}
GET
Get model details
/api/models/{model_id}
PUT
Update model
/api/models/{model_id}
DELETE
Delete model
Files
/api/files
GET
List all files
/api/files
POST
Upload file
/api/files/{file_id}
GET
Get file details
/api/files/{file_id}/download
GET
Download file
/api/files/{file_id}
DELETE
Delete file
Tools
/api/tools
GET
List all tools
/api/tools
POST
Create new tool
/api/tools/{tool_id}
GET
Get tool details
/api/tools/{tool_id}
PUT
Update tool
/api/tools/{tool_id}
DELETE
Delete tool
Prompts
/api/prompts
GET
List prompts
/api/prompts
POST
Create prompt
/api/prompts/{prompt_id}
GET
Get prompt
/api/prompts/{prompt_id}
PUT
Update prompt
/api/prompts/{prompt_id}
DELETE
Delete prompt
Categories
/api/categories
GET
List categories
/api/categories
POST
Create category
/api/categories/{category_id}
GET
Get category details
/api/categories/{category_id}
PUT
Update category
/api/categories/{category_id}
DELETE
Delete category
MCP Server Management
/api/mcp/create
POST
Create MCP server
/api/mcp/list
GET
List MCP servers
/api/mcp/{mcp_name}
DELETE
Delete MCP server
/api/mcp/{mcp_name}/prompts
POST
Add prompt to MCP server
/api/mcp/{mcp_name}/resources
POST
Add resource to MCP server
/api/mcp/tools/{tool_id}
GET
Get MCP tool information
/mcp/{mcp_name}
GET/POST
MCP server endpoint
🛡️ Error Handling
All API responses follow a unified format:
{
"code": 0,
"msg": "Success",
"data": {}
}
Common Error Codes
0
Success
10001
Invalid token
10002
Token expired
10003
Invalid credentials
10004
User not found
20001
Resource doesn't exist
20002
Resource already exists
30001
Parameter error
40001
API call error
50001
Internal server error
📈 Rate Limits
Requests per IP
60 requests/minute
Requests per user
120 requests/minute
Chat API
10 chat requests/minute
Exceeding limits returns HTTP 429 status.
🚀 Integration Examples
Python
import requests
token = "tk_your_api_token"
headers = {"X-API-Token": token}
response = requests.get("https://api.trademind.network/api/agents", headers=headers)
print(response.json()["data"])
JavaScript
const token = "tk_your_api_token";
fetch("https://api.trademind.network/api/agents", {
headers: {
"X-API-Token": token
}
})
.then(response => response.json())
.then(data => console.log(data.data));
Trade Mind API empowers developers to build, manage, and scale intelligent Web3 agents with secure, verifiable infrastructure on Solana and beyond.
Last updated