跳到主要内容

批量创建嵌入

OpenAPI Specification

openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/v1/embeddings:
post:
summary: 批量创建嵌入
deprecated: false
description: |-
获取给定输入的矢量表示,机器学习模型和算法可以轻松使用该表示。
相关指南:嵌入
创建表示输入文本的嵌入向量。
tags:
- 模型接口/Openai
parameters:
- name: Authorization
in: header
description: ''
required: true
example: sk-
schema:
type: string
default: sk-
requestBody:
content:
application/json:
schema:
type: object
properties:
model:
type: string
description: >-
要使用的模型的 ID。您可以使用List models API
来查看所有可用模型,或查看我们的模型概述以了解它们的描述。
input:
type: string
description: >-
输入文本以获取嵌入,编码为字符串或标记数组。要在单个请求中获取多个输入的嵌入,请传递一个字符串数组或令牌数组数组。每个输入的长度不得超过
8192 个标记。
x-apifox-orders:
- model
- input
required:
- model
- input
example:
input:
- The food was delicious
- The waiter was friendly
model: text-embedding-3-large
encoding_format: float
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
object:
type: string
data:
type: array
items:
type: object
properties:
object:
type: string
embedding:
type: string
index:
type: string
x-apifox-orders:
- object
- embedding
- index
required:
- object
- embedding
- index
model:
type: string
usage:
type: object
properties:
prompt_tokens:
type: string
total_tokens:
type: string
x-apifox-orders:
- prompt_tokens
- total_tokens
required:
- prompt_tokens
- total_tokens
x-apifox-orders:
- object
- data
- model
- usage
required:
- object
- data
- model
- usage
example: "{\r\n \"object\": \"list\",\r\n \"data\": [\r\n {\r\n \"object\": \"embedding\",\r\n \"embedding\": [\r\n 0.0023064255,\r\n -0.009327292,\r\n .... (1536 floats total for ada-002)\r\n -0.0028842222\r\n ],\r\n \"index\": 0\r\n }\r\n ],\r\n \"model\": \"text-embedding-ada-002\",\r\n \"usage\": {\r\n \"prompt_tokens\": 8,\r\n \"total_tokens\": 8\r\n }\r\n}"
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 模型接口/Openai
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/5503894/apis/api-324062018-run
components:
schemas: {}
securitySchemes: {}
servers:
- url: '{{base_url}}'
description: 测试环境
- url: https://newapi.eronmind.com
description: 正式环境
security: []