Create Agent
curl --request POST \
--url https://api.agentwallex.com/api/v1/agents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agent_name": "research-bot",
"agent_description": "Market research automation agent",
"chain": "eip155:84532",
"metadata": "{\"team\":\"growth\"}"
}
'import requests
url = "https://api.agentwallex.com/api/v1/agents"
payload = {
"agent_name": "research-bot",
"agent_description": "Market research automation agent",
"chain": "eip155:84532",
"metadata": "{\"team\":\"growth\"}"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_name: 'research-bot',
agent_description: 'Market research automation agent',
chain: 'eip155:84532',
metadata: '{"team":"growth"}'
})
};
fetch('https://api.agentwallex.com/api/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.agentwallex.com/api/v1/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_name' => 'research-bot',
'agent_description' => 'Market research automation agent',
'chain' => 'eip155:84532',
'metadata' => '{"team":"growth"}'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agentwallex.com/api/v1/agents"
payload := strings.NewReader("{\n \"agent_name\": \"research-bot\",\n \"agent_description\": \"Market research automation agent\",\n \"chain\": \"eip155:84532\",\n \"metadata\": \"{\\\"team\\\":\\\"growth\\\"}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.agentwallex.com/api/v1/agents")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_name\": \"research-bot\",\n \"agent_description\": \"Market research automation agent\",\n \"chain\": \"eip155:84532\",\n \"metadata\": \"{\\\"team\\\":\\\"growth\\\"}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentwallex.com/api/v1/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_name\": \"research-bot\",\n \"agent_description\": \"Market research automation agent\",\n \"chain\": \"eip155:84532\",\n \"metadata\": \"{\\\"team\\\":\\\"growth\\\"}\"\n}"
response = http.request(request)
puts response.read_body{
"id": "agent_abc123",
"agent_name": "research-bot",
"agent_description": "Market research automation agent",
"wallet": {
"address": "0x1234567890abcdef1234567890abcdef12345678",
"chain": "eip155:84532"
},
"status": "active",
"created_at": "2025-06-01T10:00:00Z"
}{
"code": "invalid_request",
"type": "invalid_request_error",
"message": "The request body is missing required fields."
}{
"code": "authentication_failed",
"type": "authentication_error",
"message": "The provided API key is invalid or expired."
}{
"code": "insufficient_permissions",
"type": "authorization_error",
"message": "You do not have permission to perform this action."
}{
"code": "rate_limit_exceeded",
"type": "rate_limit_error",
"message": "Too many requests. Please retry after a short delay."
}{
"code": "server_error",
"type": "internal_error",
"message": "An unexpected error occurred. Please try again later."
}Agent
Tạo Tác nhân
Tạo tác nhân AI mới với ví được bảo mật bằng MPC.
POST
/
api
/
v1
/
agents
Create Agent
curl --request POST \
--url https://api.agentwallex.com/api/v1/agents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agent_name": "research-bot",
"agent_description": "Market research automation agent",
"chain": "eip155:84532",
"metadata": "{\"team\":\"growth\"}"
}
'import requests
url = "https://api.agentwallex.com/api/v1/agents"
payload = {
"agent_name": "research-bot",
"agent_description": "Market research automation agent",
"chain": "eip155:84532",
"metadata": "{\"team\":\"growth\"}"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_name: 'research-bot',
agent_description: 'Market research automation agent',
chain: 'eip155:84532',
metadata: '{"team":"growth"}'
})
};
fetch('https://api.agentwallex.com/api/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.agentwallex.com/api/v1/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_name' => 'research-bot',
'agent_description' => 'Market research automation agent',
'chain' => 'eip155:84532',
'metadata' => '{"team":"growth"}'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agentwallex.com/api/v1/agents"
payload := strings.NewReader("{\n \"agent_name\": \"research-bot\",\n \"agent_description\": \"Market research automation agent\",\n \"chain\": \"eip155:84532\",\n \"metadata\": \"{\\\"team\\\":\\\"growth\\\"}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.agentwallex.com/api/v1/agents")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_name\": \"research-bot\",\n \"agent_description\": \"Market research automation agent\",\n \"chain\": \"eip155:84532\",\n \"metadata\": \"{\\\"team\\\":\\\"growth\\\"}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentwallex.com/api/v1/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_name\": \"research-bot\",\n \"agent_description\": \"Market research automation agent\",\n \"chain\": \"eip155:84532\",\n \"metadata\": \"{\\\"team\\\":\\\"growth\\\"}\"\n}"
response = http.request(request)
puts response.read_body{
"id": "agent_abc123",
"agent_name": "research-bot",
"agent_description": "Market research automation agent",
"wallet": {
"address": "0x1234567890abcdef1234567890abcdef12345678",
"chain": "eip155:84532"
},
"status": "active",
"created_at": "2025-06-01T10:00:00Z"
}{
"code": "invalid_request",
"type": "invalid_request_error",
"message": "The request body is missing required fields."
}{
"code": "authentication_failed",
"type": "authentication_error",
"message": "The provided API key is invalid or expired."
}{
"code": "insufficient_permissions",
"type": "authorization_error",
"message": "You do not have permission to perform this action."
}{
"code": "rate_limit_exceeded",
"type": "rate_limit_error",
"message": "Too many requests. Please retry after a short delay."
}{
"code": "server_error",
"type": "internal_error",
"message": "An unexpected error occurred. Please try again later."
}Tạo tác nhân mới với ví được bảo mật bằng MPC được cung cấp tự động. Địa chỉ ví được tạo bằng Tạo Khóa Phân tán (DKG) và sẵn sàng nhận quỹ ngay lập tức.
Nội dung Yêu cầu
string
bắt buộc
Tên hiển thị cho tác nhân. Phải là duy nhất trong tài khoản của bạn.
string
Mô tả tùy chọn về mục đích của tác nhân.
string
bắt buộc
Định danh chuỗi CAIP-2 cho ví tác nhân. Xem Các Chuỗi được Hỗ trợ để biết các tùy chọn có sẵn.Ví dụ:
eip155:1 (Ethereum), eip155:8453 (Base), eip155:84532 (Base Sepolia testnet)string
Chuỗi metadata mã hóa JSON cho các cặp khóa-giá trị tùy chỉnh.
Phản hồi
Hiện Các trường phản hồi
Hiện Các trường phản hồi
Ví dụ
curl -X POST https://api.agentwallex.com/api/v1/agents \
-H "X-API-Key: awx_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "research-bot",
"agent_description": "Market research automation agent",
"chain": "eip155:84532",
"metadata": "{\"team\":\"growth\"}"
}'
const agent = await aw.agents.create({
name: "research-bot",
chain: "eip155:84532",
metadata: { team: "growth" },
});
agent = await aw.agents.create(
name="research-bot",
chain="eip155:84532",
metadata={"team": "growth"},
)
Response
{
"id": "agent_abc123",
"agent_name": "research-bot",
"agent_description": "Market research automation agent",
"wallet": {
"address": "0x1234567890abcdef1234567890abcdef12345678",
"chain": "eip155:84532"
},
"status": "active",
"created_at": "2025-06-01T10:00:00Z"
}
Ủy quyền
ApiKeyAuthBearerAuth
API key authentication. Keys are prefixed with awx_.
Nội dung
application/json
Display name for the agent. Must be unique within your account.
CAIP-2 chain identifier for the agent's wallet (e.g., eip155:1 for Ethereum, eip155:8453 for Base, eip155:84532 for Base Sepolia testnet).
Optional description of the agent's purpose.
JSON-encoded metadata string for custom key-value pairs.
Phản hồi
Agent created successfully.
An AI agent with an MPC-secured wallet.
Unique agent identifier (e.g., agent_abc123).
Agent display name.
Agent description.
An on-chain wallet associated with an agent.
Show child attributes
Show child attributes
Agent status.
Tùy chọn có sẵn:
active, inactive JSON-encoded metadata string.
ISO 8601 creation timestamp.
⌘I