Skip to main content

Basics

This article explains how to obtain an API key and generate a user token.

Generate API key​

Account-level key (for MCP / Claude Code / Cursor): in the portal open Settings → API Keys (/user-settings/api-key) and click generate. The key is shown only once; copy and store it. See External agent access. The steps below generate a key bound to a single agent.

1. Visit AgentWeave and log in​

2. Select an agent you created on the My Agent page​

choice agent

3. Enter the Agent management page​

choice agent

4. Click the API Key menu on the Agent management page and record the agent ID​

choice_api_key

5. Click Generate New API Key to obtain the API Key​

点击生成API Key页面 确认

6. Copy the generated API Key and save it locally. If lost, you must regenerate it.​

获取新的API Key


Get User Token​

On the Customer system backend:

Request the following API​

API location:
https://rest.agentweave.ai/api/v1/agents/api_key/gen_token

Include in the request header​

api_key: {api_key}

Request Body​

{
"user": "user_id", // Customer system user ID
"expiration_time": 3600 // Token validity period, in seconds
}

The API will return the user access Token​

获取token 获取token