EZLINK AI API
  1. 嵌入(Embeddings)
EZLINK AI API
  • LLMs
    • 介绍
    • 项目说明
    • 导言
    • 身份验证
    • 发出请求
    • 参数详情
    • 音频(Audio)
      • 创建语音
      • 创建转录
      • 创建翻译
    • 聊天(Chat)
      • 聊天完成对象
      • 聊天完成块对象
      • 创建聊天补全
    • 自动补全(Completions)
      • 完成对象
      • 创建完成
    • 嵌入(Embeddings)
      • 嵌入对象
      • 创建嵌入
        POST
    • 图像(Images)
      • README
      • 图像对象
      • 创建图像
      • 创建图片编辑
      • 创建图像变体
    • 模型(Models)
      • 模型对象
      • 列出模型
      • 检索模型
    • 审查(Moderations)
      • 调节对象
      • 创建内容审核
  • Stability
    • Image-to-Video
      • Start generation
      • Fetch generation result
    • Upscale
      • Conservative
      • Start Creative Upscale
      • Fetch Creative Upscale result
    • Edit
      • Erase
      • Inpaint
      • Outpaint
      • Search and Replace
      • Remove Background
    • Generate
      • Stable Image Ultra
      • Stable Image Core
      • Stable Diffusion 3
    • Control
      • Sketch
      • Structure
      • Style
  • Midjourney
    • InsightFace任务提交
      • 提交swap_face任务
    • 任务提交
      • 执行动作
      • 提交Blend任务
      • 提交Describe任务
      • 提交Imagine任务
      • 提交Modal
      • 提交Shorten任务
    • 任务查询
      • 指定ID获取任务
      • 获取任务图片的seed(需设置mj或niji的私信ID)
  • File
  • Flux
    • 创建图像 Copy
      POST
  • video
    • 视频生成
    • 生成查询
  1. 嵌入(Embeddings)

创建嵌入

POST
https://api.ezlinkai.com/v1/embeddings
获取给定输入的矢量表示,机器学习模型和算法可以轻松使用该表示。
相关指南:嵌入
创建表示输入文本的嵌入向量。

Request

Header Params
Authorization
string 
optional
Example:
Bearer {{YOUR_API_KEY}}
Body Params application/json
model
string 
required
要使用的模型的 ID。您可以使用List models API 来查看所有可用模型,或查看我们的模型概述以了解它们的描述。
input
string 
required
输入文本以获取嵌入,编码为字符串或标记数组。要在单个请求中获取多个输入的嵌入,请传递一个字符串数组或令牌数组数组。每个输入的长度不得超过 8192 个标记。
Example
{
  "model": "text-embedding-ada-002",
  "input": "The food was delicious and the waiter..."
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.ezlinkai.com/v1/embeddings' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "text-embedding-ada-002",
  "input": "The food was delicious and the waiter..."
}'

Responses

🟢200Create embeddings
application/json
Body
object
string 
required
data
array [object {3}] 
required
object
string 
optional
embedding
array[number]
optional
index
integer 
optional
model
string 
required
usage
object 
required
prompt_tokens
integer 
required
total_tokens
integer 
required
Example
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        0.0023064255,
        -0.009327292,
        .... (1536 floats total for ada-002)
        -0.0028842222
      ],
      "index": 0
    }
  ],
  "model": "text-embedding-ada-002",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}
Modified at 2024-08-18 02:35:35
Previous
嵌入对象
Next
README
Built with