Skip to main content
POST
/
embeddings
Create embeddings
curl --request POST \
  --url https://api.aiearth.dev/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": "<string>"
}
'
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        123
      ],
      "index": 123
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}
将文本转换为向量,适合语义搜索、RAG、聚类和相似度匹配。

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required
input
required

Response

Embedding response

object
string
Example:

"list"

data
object[]
usage
object