tencent cloud

LLM Knowledge Engine Basic API

Product Introduction
Product Overview
Use Cases
Purchase Guide
Billing Overview
Purchasing Channel
Overdue Payment Instructions
Renewal Instructions
Refund Instructions
Getting Started
Operation Guide
LLM Knowledge Engine Basic API Calls
API Documentation
History
Introduction
API Category
Making API Requests
Atomic Capability APIs
Data Types
Error Codes
FAQs
Related Agreements
Service Level Agreement
Terms of Use
Privacy Policy
Data Processing and Security Agreement
Open Source License Statement
Contact Us

GetEmbedding

PDF
Focus Mode
Font Size
Last updated: 2025-11-17 22:32:32

1. API Description

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

This API is used to call the text representation model to convert text into a vector represented by numbers, which can be used in scenarios such as text retrieval, information recommendation, and knowledge mining. There is a single-account call limit control for this API. If you need to increase the concurrency limit, please contact us (https://cloud.tencent.com/act/event/Online_service).

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: GetEmbedding.
Version Yes String Common Params. The value used for this API: 2024-05-22.
Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-jakarta.
Model Yes String Select the model for generating vectors
Note: Optional [adp-text-embedding-0.5b]

Inputs.N Yes Array of String Text that requires embedding. The maximum length of a single text is 500 characters. The maximum total number of entries is 7.
TextType No String The type of text vectorization. To achieve better retrieval performance, it is recommended to distinguish between query text and document text types. For symmetric tasks such as clustering and classification, there is no need for special specification simply use the system default value "document".
Instruction No String This field is not currently supported.

3. Output Parameters

Parameter Name Type Description
Data Array of EmbeddingObject Feature.
Usage Usage Consumption. Returns TotalToken.
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 Obtain The Embeddings

Input Example

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

{
    "Model": "adp-text-embedding-0.5b",
    "Inputs": [
        "Hello."
    ]
}

Output Example

{
    "Response": {
        "Data": [
            {
                "Embedding": [
                    0
                ]
            }
        ],
        "RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
        "Usage": {
            "TotalTokens": 3
        }
    }
}

Example2 Obtain The Embeddings1

Input Example

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

{
    "Model": "adp-text-embedding-0.5b",
    "Inputs": [
        "Hello",
        "Word"
    ]
}

Output Example

{
    "Response": {
        "Data": [
            {
                "Embedding": [
                    0
                ]
            },
            {
                "Embedding": [
                    0
                ]
            }
        ],
        "RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
        "Usage": {
            "TotalTokens": 3
        }
    }
}

Example3 Obtain The Embeddings2

Input Example

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

{
    "Model": "adp-text-embedding-0.5b",
    "Inputs": [
        "Hello",
        "Word"
    ]
}

Output Example

{
    "Response": {
        "Data": [
            {
                "Embedding": [
                    0
                ]
            },
            {
                "Embedding": [
                    0
                ]
            }
        ],
        "RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
        "Usage": {
            "TotalTokens": 3
        }
    }
}

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

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation Operation failed.
ResourceUnavailable.ResourcePackageRunOut The account resource package is exhausted.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback