Skip to content

Text Embeddings

POST https://www.kkiai.com/v1beta/models/gemini-embedding-001:embedContent

https://ai.google.dev/gemini-api/docs/embeddings?hl=zh-cn#rest_3 Official Documentation

Request Parameters

Authorization

Add the Authorization parameter to the Header, with its value being the Token concatenated after Bearer

Example: Authorization: Bearer ********************

Request Example

json
{
    "content": {
        "parts": [
            {
                "text": "What is the meaning of life?"
            }
        ]
    },
    "output_dimensionality": 768,
    "taskType": "SEMANTIC_SIMILARITY"
}

cURL Example

bash
curl --location --request POST 'https://www.kkiai.com/v1beta/models/gemini-embedding-001:embedContent' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "content": {
        "parts": [
            {
                "text": "What is the meaning of life?"
            }
        ]
    },
    "output_dimensionality": 768,
    "taskType": "SEMANTIC_SIMILARITY"
}'

Response

🟢 200 Success