API overview

Updated at:

API standards and multilingual preset SDKs

The OpenAPI of this product (bailian/2023-12-29) uses the ROA signature style. We have encapsulated SDKs for common programming languages for developers. Developers can download the SDK to directly call this product's OpenAPI without worrying about technical details. If the existing SDK does not meet your needs, you can use the signature mechanism for self-signing integration. Since the details of self-signing are very complex, it may take around 5 business days. Therefore, we recommend joining our DingTalk service group (147535001692) and conducting signature integration under expert guidance.

Before using the API, you need to prepare your identity account and access key (AccessKey) to effectively access the API through client tools (such as SDK and CLI). For details, see Obtain an AccessKey.

Custom signature scenarios

If your business scenario has special requirements and you need to integrate the API through self-signing, we recommend consulting our technical support team first (DingTalk service group: 147535001692) to obtain professional guidance and ensure efficient integration.

Account and security preparation

Alibaba Cloud accounts have full administrative permissions over all resources. Once an AccessKey is compromised, all associated resources will be at risk of unauthorized access. To ensure security, it is recommended to create a RAM user with only API access permissions and configure its AccessKey, while configuring RAM policies based on the principle of least privilege (PoLP). Use the Alibaba Cloud account only in specific scenarios where Alibaba Cloud account permissions are explicitly required.

Data connection (formerly application data)

API

Title

Description

AddCategoryAdd CategoryCreates a category in a specified workspace to classify and manage files. Each workspace supports a maximum of 500 categories.
ListCategoryCategory ListRetrieves the details of one or more categories in a specified workspace.
DeleteCategoryDelete a categoryPermanently deletes a specified category.
ApplyFileUploadLeaseApply for a file upload leaseRequest an upload lease for uploading knowledge base files or files for agent application conversational interactions.
AddFileAdd FileImports a file from the temporary storage space of Alibaba Cloud Model Studio into a data connection (formerly known as application data).
AddFilesFromAuthorizedOssImport Files from an Authorized OSS BucketImports files from an authorized OSS Bucket into Alibaba Cloud Model Studio (Bailian) application data.
ListFileFile listRetrieves the details of one or more documents in a specified category.
DescribeFileQuery file statusQueries the basic information of a file in application data, including the file name, type, and status.
UpdateFileTagUpdate File TagUpdates the tags for a specified file.
BatchUpdateFileTagBatchUpdateFileTagThis operation updates document tags in a data connection in batches.
DeleteFileDelete filePermanently delete a specified file from application data. Deleting data tables via API is not supported. For details, see the API Guide below.
GetParseSettingsGetParseSettingsQueries the data parsing settings in a specified category.
GetAvailableParserTypesGetAvailableParserTypesLists all supported parser types based on the input file type (file extension).
ChangeParseSettingChangeParseSettingConfigures the parsing method for a specific file type. For example, you can specify LLM-based document parsing for .pdf files and the Qwen VL Parser for .jpg files.
AddTableAddTableAdd a table for the table data connector.
UpdateTableFromAuthorizedOssUpdateTableFromAuthorizedOssUpdate a table in an Alibaba Cloud Model Studio data connector using a file from an authorized OSS bucket.
AddConnectorAddConnectorCreates a connector. This API currently supports only file connectors.
GetConnectorGetConnectorRetrieves details about a connector. This operation currently supports only file connectors.
UpdateConnectorUpdateConnectorUpdates a connector.

Knowledge base

API

Title

Description

CreateIndexCreate Knowledge BaseUse this API to create two types of knowledge bases: unstructured knowledge bases for documents, audio, or video, and structured knowledge bases for data queries or image Q&A.
GetIndexJobStatusQuery knowledge base job statusQueries the current status of a specified knowledge base creation job or knowledge base document append job.
SubmitIndexJobSubmit a knowledge base creation taskSubmits a specified CreateIndex task to complete knowledge base creation.
SubmitIndexAddDocumentsJobSubmit a knowledge base append jobAdds parsed files to the specified knowledge base.
RetrieveRetrieveRetrieves information from a specified knowledge base.
ListIndexDocumentsQuery files in a knowledge baseRetrieves the files in a specified knowledge base along with their summary information.
ListIndexFileDetailsListIndexFileDetailsRetrieves the details of one or more documents in a specified knowledge base.
UpdateIndexUpdate Knowledge BaseUpdates the configuration of a specified knowledge base.
DeleteIndexDocumentDelete files from a knowledge basePermanently deletes files from a specified knowledge base.
ListIndicesList knowledge basesRetrieves the list of knowledge bases in a specified workspace.
DeleteIndexDelete a knowledge basePermanently deletes a specified knowledge base.
ListChunksQuery chunk list under an indexQueries the list and information of text chunks.
UpdateChunkUpdate a chunkModifies the content and title of a specified text chunk in a knowledge base, and specifies whether the chunk participates in knowledge base retrieval.
DeleteChunkDelete chunksDeletes specified text chunks from a knowledge base. Deleted text chunks cannot be retrieved or recalled.
GetIndexMonitorRetrieve knowledge base monitoring dataYou can call the GetIndexMonitor operation to query monitoring data for a specified knowledge base within a specific time range. This data is crucial for App Performance Analytics, capacity planning, and cost management. The monitoring data includes two main dimensions: storage and retrieval. Storage monitoring retrieves the index storage limit and current usage of the knowledge base. Retrieval monitoring retrieves performance metrics for the query period, such as peak queries per second (QPS), total requests, and average QPS. The metrics are provided as totals and are also broken down by time window. The requests are categorized as successful, failed, and rate-limited.

Prompt engineering

API

Title

Description

CreatePromptTemplateCreate a Prompt TemplateCreate a prompt template.
DeletePromptTemplateDeletePromptTemplateDeletes a prompt template based on the template ID.

Others

API

Title

Description

Long-term memory (legacy)Long-term memory (legacy)
CreateMemoryCreate a long-term memoryCreates a long-term memory.
GetMemoryRetrieve long-term memoryRetrieves the description of a specified long-term memory.
UpdateMemoryUpdate long-term memoryUpdates the description of a specified long-term memory.
DeleteMemoryDelete long-term memoryPermanently deletes a specified long-term memory.
ListMemoriesList long-term memoriesRetrieves the details of one or more long-term memory entities in a specified workspace.
CreateMemoryNodeCreate a memory nodeCreates a memory node.
GetMemoryNodeRetrieve a memory fragmentRetrieves a memory fragment.
UpdateMemoryNodeUpdate a memory fragmentUpdates a memory fragment.
DeleteMemoryNodeDelete a memory fragmentDeletes a memory fragment.
ListMemoryNodesRetrieve memory node listRetrieves a list of memory nodes.
GetAlipayTransferStatusQuery alipay tipping statusQueries the tipping status of the Alipay wallet bound to an application.
GetAlipayUrlGet alipay tipping URLRetrieves the Alipay tipping URL for an application.
ApplyTempStorageLeaseApplyTempStorageLeaseThis interface is intended for pro-code deployment only; other scenarios are currently not supported. It is used to apply for a temporary file upload lease. After obtaining the lease, you must upload the file manually.
DeleteFilesDelete files in batchDelete files in batch
GetPromptTemplateGetPromptTemplateObtains a prompt template based on the template ID.
ListPromptTemplatesListPromptTemplatesObtains a list of prompt templates.
UpdatePromptTemplateUpdatePromptTemplateUpdates a prompt template based on the template ID.