tencent cloud

Tencent Cloud Agent Development Platform

DokumentasiTencent Cloud Agent Development Platform

CreateAgent

Unduh
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-11-04 21:51:10

1. API Description

Domain name for API request: adp.intl.tencentcloudapi.com.

This API is used to create an Agent. Currently only support claw mode.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateAgent.
Version Yes String Common Params. The value used for this API: 2026-05-20.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
AppId Yes String

Application ID.

Agent No AgentSpec

Agent configuration

Kind No Integer

Agent type, case-sensitive between B-end configuration Agent and client user-mode Agent

Enumeration values:

  • 0: Configuration-end Agent
  • 1: User-mode Agent

3. Output Parameters

Parameter Name Type Description
AgentId String

Agent Id

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Create a sub-Agent on the user end

Input Example

POST / HTTP/1.1
Host: adp.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateAgent
<Common request parameters>

{
    "AppId": "2068***********2288",
    "Agent": {
        "Profile": {
            "Name": "User Agent",
            "IconUrl": "https://cdn.xiaowei.qq.com/static/adp/agent-robot.png",
            "Role": 1,
            "Description": "User Agent",
            "ParentAgentId": "user_e55be224-3cb4-4951-abdd-3454bd70b6a1"
        },
        "Instructions": "User Agent",
        "Model": {
            "ModelId": "Moonshot/moonshot-v1-128k",
            "Alias": "moonshot-v1-128k",
            "ContextWordsLimit": 20000,
            "InstructionsWordsLimit": 20000
        },
        "ToolList": [
            {
                "Config": {
                    "PluginId": "bf8ad2f3-1e5c-410a-ae81-abd7c5c14f1c",
                    "ToolId": "959ea8eb-2772-4981-a92f-c4f43625b0c1",
                    "Description": "Intelligently generate related images based on input text descriptions (ultra-fast version)",
                    "InputList": [
                        {
                            "Name": "Image",
                            "Description": "Reference Image. Either Base64 or Url must be provided. If both are provided, Url prevails. When the Image parameter is imported, the Style and Resolution parameters do not take effect, and the output Image Resolution remains the same as the imported Image. Image restrictions: Resolution greater than 128 and less than 2048 on one side; Image size less than 6 MB; format support: jpg, jpeg, png, bmp, tiff, webp.",
                            "Type": 4,
                            "IsRequired": false,
                            "IsHidden": false,
                            "Input": {
                                "InputType": 0
                            },
                            "SubParameterList": [],
                            "OneOfList": [],
                            "AnyOfList": []
                        }
                    ],
                    "OutputList": [],
                    "HeaderParameterList": [],
                    "QueryParameterList": [],
                    "ToolSource": 0,
                    "IsDisabled": false
                }
            }
        ],
        "PluginList": [
            {
                "PluginId": "bf8ad2f3-1e5c-410a-ae81-abd7c5c14f1c",
                "HeaderParameterList": [],
                "QueryParameterList": [],
                "EnableCamRoleAuth": false,
                "AuthType": 0
            }
        ],
        "SkillList": [
            {
                "SkillId": "f5fc841f-82fc-46ca-8152-d3bab786d52c"
            }
        ],
        "AdvancedConfig": {
            "MaxReasoningRound": 100
        }
    },
    "Kind": 1
}

Output Example

{
    "Response": {
        "AgentId": "user_cc760218-4bb4-4c4e-b6d2-4996e212597e",
        "RequestId": "5b14e728-55b3-44cb-9d49-9dac2c96423b"
    }
}

Example2 Create a primary Agent on the configuration end

Input Example

POST / HTTP/1.1
Host: adp.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateAgent
<Common request parameters>

{
    "AppId": "2068***********2288",
    "Agent": {
        "Profile": {
            "Name": "My Main Agent",
            "IconUrl": "https://cdn.xiaowei.qq.com/static/adp/agent-robot.png",
            "Role": 0,
            "Description": "Agent"
        },
        "Instructions": "User Agent",
        "Model": {
            "ModelId": "Moonshot/moonshot-v1-128k",
            "Alias": "moonshot-v1-128k",
            "ContextWordsLimit": 20000,
            "InstructionsWordsLimit": 20000
        },
        "ToolList": [
            {
                "Config": {
                    "PluginId": "bf8ad2f3-1e5c-410a-ae81-abd7c5c14f1c",
                    "ToolId": "959ea8eb-2772-4981-a92f-c4f43625b0c1",
                    "Description": "Intelligently generate related images based on input text descriptions (ultra-fast version)",
                    "InputList": [
                        {
                            "Name": "Image",
                            "Description": "Reference Image. Either Base64 or Url must be provided. If both are provided, Url prevails. When the Image parameter is input, the Style and Resolution parameters do not take effect, and the output Image Resolution will remain the same as the input Image Resolution. Image restrictions: Resolution greater than 128 and less than 2048 on one side; Image less than 6 MB; format support: jpg, jpeg, png, bmp, tiff, webp.",
                            "Type": 4,
                            "IsRequired": false,
                            "IsHidden": false,
                            "Input": {
                                "InputType": 0
                            },
                            "SubParameterList": [],
                            "OneOfList": [],
                            "AnyOfList": []
                        }
                    ],
                    "OutputList": [],
                    "HeaderParameterList": [],
                    "QueryParameterList": [],
                    "ToolSource": 0,
                    "IsDisabled": false
                }
            }
        ],
        "PluginList": [
            {
                "PluginId": "bf8ad2f3-1e5c-410a-ae81-abd7c5c14f1c",
                "HeaderParameterList": [],
                "QueryParameterList": [],
                "EnableCamRoleAuth": false,
                "AuthType": 0
            }
        ],
        "SkillList": [
            {
                "SkillId": "f5fc841f-82fc-46ca-8152-d3bab786d52c"
            }
        ],
        "AdvancedConfig": {
            "MaxReasoningRound": 100
        }
    }
}

Output Example

{
    "Response": {
        "AgentId": "0f050c95-31b6-4d31-8c31-1fd6a6bafb4c",
        "RequestId": "c3e001ca-0abc-40cf-a16a-6e5e38f39df7"
    }
}

Example3 Creating a Sub-Agent on the Configuration End

Input Example

POST / HTTP/1.1
Host: adp.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateAgent
<Common request parameters>

{
    "AppId": "2068***********2288",
    "Agent": {
        "Profile": {
            "Name": "My Agent",
            "IconUrl": "https://cdn.xiaowei.qq.com/static/adp/agent-robot.png",
            "Role": 1,
            "Description": "Agent"
        },
        "Instructions": "User Agent",
        "Model": {
            "ModelId": "Moonshot/moonshot-v1-128k",
            "Alias": "moonshot-v1-128k",
            "ContextWordsLimit": 20000,
            "InstructionsWordsLimit": 20000
        },
        "ToolList": [
            {
                "Config": {
                    "PluginId": "bf8ad2f3-1e5c-410a-ae81-abd7c5c14f1c",
                    "ToolId": "959ea8eb-2772-4981-a92f-c4f43625b0c1",
                    "Description": "Intelligently generate related images based on input text descriptions (ultra-fast version)",
                    "InputList": [
                        {
                            "Name": "Image",
                            "Description": "Reference Image. Either Base64 or Url must be provided. If both are provided, Url prevails. When the Image parameter is imported, the Style and Resolution parameters do not take effect, and the output Image Resolution remains the same as the imported Image Resolution. Image restrictions: Resolution greater than 128 and less than 2048 on one side; Image size less than 6 MB; format support: jpg, jpeg, png, bmp, tiff, webp.",
                            "Type": 4,
                            "IsRequired": false,
                            "IsHidden": false,
                            "Input": {
                                "InputType": 0
                            },
                            "SubParameterList": [],
                            "OneOfList": [],
                            "AnyOfList": []
                        }
                    ],
                    "OutputList": [],
                    "HeaderParameterList": [],
                    "QueryParameterList": [],
                    "ToolSource": 0,
                    "IsDisabled": false
                }
            }
        ],
        "PluginList": [
            {
                "PluginId": "bf8ad2f3-1e5c-410a-ae81-abd7c5c14f1c",
                "HeaderParameterList": [],
                "QueryParameterList": [],
                "EnableCamRoleAuth": false,
                "AuthType": 0
            }
        ],
        "SkillList": [
            {
                "SkillId": "f5fc841f-82fc-46ca-8152-d3bab786d52c"
            }
        ],
        "AdvancedConfig": {
            "MaxReasoningRound": 100
        }
    }
}

Output Example

{
    "Response": {
        "AgentId": "e86a4137-2a19-469f-9b47-6fd4a8c6c115",
        "RequestId": "31d23269-e98c-47df-a90d-963a00bbc4f4"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan