API overview

Updated at:
Copy as MD

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

AddCategory Add Category Creates a category in a specified workspace to classify and manage files. Each workspace supports a maximum of 500 categories.
ListCategory Category List Retrieves the details of one or more categories in a specified workspace.
DeleteCategory Delete a category Permanently deletes a specified category.
ApplyFileUploadLease Apply for a file upload lease Request an upload lease for uploading knowledge base files or files for agent application conversational interactions.
AddFile Add File Imports a file from the temporary storage space of Alibaba Cloud Model Studio into a data connection (formerly known as application data).
AddFilesFromAuthorizedOss Import Files from an Authorized OSS Bucket Imports files from an authorized OSS Bucket into Alibaba Cloud Model Studio (Bailian) application data.
ListFile File list Retrieves the details of one or more documents in a specified category.
DescribeFile Query file status Queries the basic information of a file in application data, including the file name, type, and status.
UpdateFileTag Update File Tag Updates the tags for a specified file.
BatchUpdateFileTag BatchUpdateFileTag This operation updates document tags in a data connection in batches.
DeleteFile Delete file Permanently delete a specified file from application data. Deleting data tables via API is not supported. For details, see the API Guide below.
DeleteFiles Delete files in batch Delete files in batch
GetParseSettings GetParseSettings Queries the data parsing settings in a specified category.
GetAvailableParserTypes GetAvailableParserTypes Lists all supported parser types based on the input file type (file extension).
ChangeParseSetting ChangeParseSetting Configures 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.
AddTable AddTable Add a table for the table data connector.
UpdateTableFromAuthorizedOss UpdateTableFromAuthorizedOss Update a table in an Alibaba Cloud Model Studio data connector using a file from an authorized OSS bucket.
AddConnector AddConnector Creates a connector. This API currently supports only file connectors.
GetConnector GetConnector Retrieves details about a connector. This operation currently supports only file connectors.
UpdateConnector UpdateConnector Updates a connector.

Knowledge base

API

Title

Description

CreateIndex Create Knowledge Base Use 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.
GetIndexJobStatus Query knowledge base job status Queries the current status of a specified knowledge base creation job or knowledge base document append job.
SubmitIndexJob Submit a knowledge base creation task Submits a specified CreateIndex task to complete knowledge base creation.
SubmitIndexAddDocumentsJob Submit a knowledge base append job Adds parsed files to the specified knowledge base.
Retrieve Retrieve Retrieves information from a specified knowledge base.
ListIndexDocuments Query files in a knowledge base Retrieves the files in a specified knowledge base along with their summary information.
ListIndexFileDetails ListIndexFileDetails Retrieves the details of one or more documents in a specified knowledge base.
DeleteIndexDocument Delete files from a knowledge base Permanently deletes files from a specified knowledge base.
ListIndices List knowledge bases Retrieves the list of knowledge bases in a specified workspace.
DeleteIndex Delete a knowledge base Permanently deletes a specified knowledge base.
ListChunks Query chunk list under an index Queries the list and information of text chunks.
UpdateChunk Update a chunk Modifies the content and title of a specified text chunk in a knowledge base, and specifies whether the chunk participates in knowledge base retrieval.
DeleteChunk Delete chunks Deletes specified text chunks from a knowledge base. Deleted text chunks cannot be retrieved or recalled.

Prompt engineering

API

Title

Description

CreatePromptTemplate Create a Prompt Template Create a prompt template.
DeletePromptTemplate DeletePromptTemplate Deletes a prompt template based on the template ID.

Others

API

Title

Description

ApplyTempStorageLease ApplyTempStorageLease This 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.
GetPromptTemplate GetPromptTemplate Obtains a prompt template based on the template ID.
ListPromptTemplates ListPromptTemplates Obtains a list of prompt templates.
UpdatePromptTemplate UpdatePromptTemplate Updates a prompt template based on the template ID.