Chuyển đến nội dung chính
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\"}"
}
'
{
  "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"
}
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

agent_name
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.
agent_description
string
Mô tả tùy chọn về mục đích của tác nhân.
chain
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)
metadata
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

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\"}"
  }'
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

X-API-Key
string
header
bắt buộc

API key authentication. Keys are prefixed with awx_.

Nội dung

application/json
agent_name
string
bắt buộc

Display name for the agent. Must be unique within your account.

chain
string
bắt buộc

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).

agent_description
string

Optional description of the agent's purpose.

metadata
string

JSON-encoded metadata string for custom key-value pairs.

Phản hồi

Agent created successfully.

An AI agent with an MPC-secured wallet.

id
string

Unique agent identifier (e.g., agent_abc123).

agent_name
string

Agent display name.

agent_description
string

Agent description.

wallet
object

An on-chain wallet associated with an agent.

status
enum<string>

Agent status.

Tùy chọn có sẵn:
active,
inactive
metadata
string

JSON-encoded metadata string.

created_at
string<date-time>

ISO 8601 creation timestamp.