Skip to main content

Get Agent

Get full Agent details, with support for specifying a version.

Prerequisites

Obtain an Alibaba Cloud Model Studio API Key and workspace ID first. For authentication, see API Authentication. This is a read operation and requires only an API Key.

Endpoint

POST /api/v1/indices/rag/app/get Query the detailed information of a specified Agent, including name, description, scene, status, and configuration details for each version. You can specify a version number via agent_version to query a specific version; if not provided, all versions are returned.
Passing "release" as agent_version is not supported.

Request body

FieldRequiredTypeDescription
agent_idYesstringAgent ID.
agent_versionNostringSpecify a version number (beta or a number such as 1). If not provided, all version information is returned.

Request example

curl -X POST "$BASE_URL/api/v1/indices/rag/app/get" \
  -H "Authorization: Bearer $BAILIAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "aid-8f3a1b2c4d5e6f70",
    "agent_version": "beta"
}'
BASE_URL is https://{workspace_id}.cn-beijing.maas.aliyuncs.com ({workspace_id} is the workspace ID), and BAILIAN_API_KEY is your Alibaba Cloud Model Studio API Key.

Response example

Returns 200 on success.
{
  "request_id": "f6a7b8c9-d0e1-2345-fabc-456789012345",
  "status_code": 200,
  "code": "Success",
  "message": "",
  "status": "SUCCESS",
  "success": true,
  "data": {
    "agent_id": "aid-8f3a1b2c4d5e6f70",
    "agent_name": "Customer Service Q&A Assistant",
    "agent_desc": "Intelligent customer service Q&A agent based on product documentation",
    "agent_scene": "chat",
    "agent_status": "deployed",
    "create_time": "2026-07-10T14:30:00",
    "modify_time": "2026-07-15T09:15:00",
    "agent_details": [
      {
        "agent_version": "beta",
        "agent_version_desc": "Draft version",
        "publish_time": null,
        "agent_config": {
          "agent_policy": "agentic",
          "agent_model": "qwen3.7-plus",
          "enable_session_file": "false",
          "enable_refusal": "true",
          "enable_anti_leak": "false",
          "enable_rich_text": "false",
          "enable_citation": "true",
          "temperature": 0.5,
          "kb_search_configs": [
            {
              "id": "pipeline-xxxxxx",
              "weight": 1,
              "credibility_level": "high",
              "dense_similarity_top_k": 10,
              "rerank_top_n": 5,
              "rerank_min_score": 0.3,
              "rerank": {
                "model_name": "gte-rerank-hybrid",
                "rerank_mode": "qa"
              }
            }
          ]
        }
      }
    ]
  }
}

Response fields

FieldTypeDescription
request_idstringUnique request identifier. Provide this ID when troubleshooting issues.
status_codeintegerHTTP status code.
codestringResponse code. Success on success.
messagestringInformational message.
statusstringRequest status: SUCCESS or FAILED.
successbooleanWhether the request succeeded.
data.agent_idstringAgent ID.
data.agent_namestringAgent name.
data.agent_descstringAgent description.
data.agent_scenestringAgent scene: chat or search.
data.agent_statusstringAgent status.
data.create_timestringCreation time (ISO 8601).
data.modify_timestringModification time (ISO 8601).
data.agent_detailsarray<object>List of Agent version details. Returns all versions when agent_version is not specified. See the element table below.
data.agent_details[] elements
FieldTypeDescription
agent_versionstringVersion number, beta or a number (e.g. 1, 2).
agent_version_descstringVersion description.
publish_timestringPublish time (ISO 8601). Not present for the beta version.
agent_configobjectAgent configuration. See the sub-field table below.
publish_userstringUser who published the version.
agent_config sub-fields
FieldTypeDescription
agent_modelstringModel name used by the agent, e.g. qwen3.7-plus, qwen3.6-plus.
agent_policystringAgent policy, e.g. agentic.
enable_anti_leakbooleanWhether to enable the anti-leak feature, true or false.
enable_citationbooleanWhether to enable citation annotations, true or false.
enable_refusalbooleanWhether to enable the refusal feature, true or false.
enable_rich_textbooleanWhether to enable rich text output, true or false.
enable_session_filebooleanWhether to enable the session file feature, true or false.
hybrid_rerankobjectGlobal fusion rerank config (search scene). See the sub-field table below.
kb_search_configsarray<object>List of knowledge base retrieval configurations. See the element table below.
max_completion_tokensintegerMaximum generation tokens. Must be >= 1.
max_num_llm_callsintegerMaximum number of LLM calls for the agent.
rerank_top_nintegerFusion rerank Top N (search scene). Range [1, 20].
session_file_max_parse_lengthintegerMaximum parsing length for session files. Must be less than the model's max_context_length.
temperaturenumberModel sampling temperature, range [0, 2].
anti_leak_promptstringAnti-leak prompt.
refusal_promptstringRefusal prompt.
credibility_promptstringCredibility prompt.
enable_thinkingbooleanWhether thinking mode is enabled.
enable_temperaturebooleanWhether a custom temperature is applied.
enable_credibilitybooleanWhether credibility checking is enabled.
enable_max_completion_tokensbooleanWhether the max completion tokens limit is applied.
session_file_parse_modestringParsing mode for session files.
user_system_promptstringCustom system prompt for the chat scene. Place it at the top level of agent_config; it is passed through without validation, and its length and effect are determined by the downstream runtime. Note the field name is user_system_prompt, not system_prompt.
agent_config.kb_search_configs[] elements
FieldTypeDescription
credibility_levelstringKnowledge base credibility level, e.g. high, medium, low.
dense_similarity_top_kintegerTop-K quantity returned by dense retrieval.
idstringAssociated knowledge base Pipeline ID.
rerankobjectReranking configuration. See the sub-field table below.
rerank_min_scorenumberMinimum rerank score threshold. Chunks with a score below this value are filtered out.
rerank_top_nintegerTop-N quantity retained after reranking.
search_filtersarrayRetrieval filter conditions, validated against the knowledge base schema.
sparse_similarity_top_kintegerSparse retrieval Top K. Range [1, 100].
weightnumberKnowledge base weight.
namestringKnowledge Base name.
descstringKnowledge Base description.
enable_rewritebooleanWhether query rewriting is enabled for this Knowledge Base.
kb_search_configs[].rerank sub-fields
FieldTypeDescription
model_namestringReranking model name, e.g. gte-rerank-hybrid.
rerank_instructstringCustom rerank instruction, only effective when rerank_mode is custom. Max 500 characters.
rerank_modestringRerank mode: qa (question answering), similar (similarity), or custom (custom instruction). rerank_instruct is automatically cleared when not in custom mode.
agent_config.hybrid_rerank sub-fields
FieldTypeDescription
model_namestringFusion rerank model code. For VL knowledge bases, only multimodal models are supported; otherwise all rerank models are supported.
rerank_modestringFusion rerank mode: qa, similar, or custom. rerank_instruct is automatically cleared when not in custom mode.
rerank_instructstringCustom fusion rerank instruction, only effective when rerank_mode is custom. Max 500 characters.

Error codes

HTTP status codeError codeDescription
400Index.InvalidParameterInvalid request parameters. Please check that all parameters are complete and correctly typed.
Error response example:
{
  "request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status_code": 400,
  "code": "Index.InvalidParameter",
  "message": "Invalid request parameters. Please check that all parameters are complete and correctly typed.",
  "status": "FAILED",
  "success": false
}
Managed Agent API
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration