跳转到主要内容
POST
/
v1
/
engines
/
{model}
/
embeddings
curl --request POST \
  --url 'https://api.elkapi.com/v1/engines/gemini-3.1-pro-preview/embeddings' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gemini-3.1-pro-preview",
  "input": "今天天气真好,适合出去散步。"
}'
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 1,
      "embedding": [
        1
      ]
    }
  ],
  "model": "gemini-3.1-pro-preview",
  "usage": {
    "prompt_tokens": 1,
    "total_tokens": 1
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.elkapi.com/llms.txt

Use this file to discover all available pages before exploring further.

curl --request POST \
  --url 'https://api.elkapi.com/v1/engines/gemini-3.1-pro-preview/embeddings' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gemini-3.1-pro-preview",
  "input": "今天天气真好,适合出去散步。"
}'
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 1,
      "embedding": [
        1
      ]
    }
  ],
  "model": "gemini-3.1-pro-preview",
  "usage": {
    "prompt_tokens": 1,
    "total_tokens": 1
  }
}

Authorizations

Authorization
string
必填
所有接口均需要使用 Bearer Token 进行认证。在请求头中添加:
Authorization: Bearer YOUR_API_KEY

Path Parameters

model
string
默认值:"gemini-3.1-pro-preview"
必填
模型/引擎 ID示例:gemini-3.1-pro-preview

Body

model
string
默认值:"gemini-3.1-pro-preview"
必填
示例:gemini-3.1-pro-preview
input
string or array<string>
必填
要嵌入的文本
encoding_format
string
默认值:"float"
可选值:floatbase64
dimensions
integer
输出向量维度

Response

object
string
示例:list
data
array<object>
data.object
string
示例:embedding
data.index
integer
data.embedding
array<number>
model
string
默认值:"gemini-3.1-pro-preview"
示例:gemini-3.1-pro-preview
usage
object
usage.prompt_tokens
integer
usage.total_tokens
integer