- 发出请求
- 模型接口
- 聊天(Chat)
- 自动补全(Completions)
- 文生图片(Images)
- 向量生成(Embeddings)
- 音频(Audio)
- Suno 文生歌曲
- Flux 文生图
- Luma 文生视频
- 帮助中心
创建嵌入
POST
https://aigc.x-see.cn/v1/embeddings
请求参数
Header 参数
Authorization
string
必需
默认值:
API KEY 令牌
Content-Type
string
必需
默认值:
application/json
Body 参数application/json
model
string
必需
input
string
必需
示例
{
"model": "text-embedding-ada-002",
"input": "The food was delicious and the waiter..."
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://aigc.x-see.cn/v1/embeddings' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "text-embedding-ada-002",
"input": "The food was delicious and the waiter..."
}'
返回响应
🟢200Create embeddings
application/json
Body
object
string
必需
data
array [object {3}]
必需
object
string
可选
embedding
array[number]
可选
index
integer
可选
model
string
必需
usage
object
必需
prompt_tokens
integer
必需
total_tokens
integer
必需
示例
{
"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
}
}
修改于 2024-04-13 08:28:13