CreateAgent

更新时间:
复制 MD 格式

Creates an Agent with the specified name, model, visibility, and optional tools or skills.

Operation description

Request Description

  • Agent Name: Must be unique under the current account.

  • Model Configuration: Optional. Specifies the model and related settings for the Agent.

  • Visibility Level: Defines who can access the Agent: the entire account, specified projects, or specific users.

  • Visibility Scope: Required when PROJECT or USER is selected as the visibility level. Specifies the target project IDs or user IDs.

  • Other Parameters: Display name, description, and other fields are optional.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

Name

string

Yes

The Agent name. Must be unique within the current account.

my-agent

DisplayName

string

No

The Agent display name.

我的助手

Description

string

No

The Agent description.

数据分析助手

Model

object

No

The model configuration.

{ "modelName": "dataworks-public-bailian/qwen-max" }

SystemPrompt

string

No

The system prompt.

你是一个数据分析助手。

Tools

array

No

The list of tools.

-

string

No

Tool information.

-

Skills

array

No

The list of skills.

-

string

No

Skill configuration.

["my-skill"]

CallableAgents

array

No

Sub-Agents that this Agent can call.

-

string

No

Agent name.

["agent-name"]

Metadata

object

No

Extended metadata (key-value pairs).

{}

Visibility

string

No

The visibility level.
TENANT: Visible within the account.
PROJECT: Visible to specified projects.
USER: Visible to specified users.








TENANT

VisibilityScope

object

No

The visibility scope. Set the corresponding field based on the Visibility value.

ProjectIds

array

No

The list of visible project IDs. Takes effect when Visibility is PROJECT.

string

No

List of workspace IDs.

[21791]

UserIds

array

No

The list of visible user IDs. Takes effect when Visibility is USER.

string

No

The list of visible user IDs. Takes effect when Visibility is USER.

[]

Response elements

Element

Type

Description

Example

object

The response body.

RequestId

string

The request ID.

824F80BA-1778-5D8A-BAFF-668A4D9C4CC7

Agent

object

The created Agent details.

Name

string

The Agent name.

my-agent

GmtCreateTime

string

The creation time (millisecond timestamp).

1780555634000

GmtModifiedTime

string

The last modification time (millisecond timestamp).

1780555634000

Examples

Success response

JSON format

{
  "RequestId": "824F80BA-1778-5D8A-BAFF-668A4D9C4CC7",
  "Agent": {
    "Name": "my-agent",
    "GmtCreateTime": "1780555634000",
    "GmtModifiedTime": "1780555634000"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.