Appearance
Embeddings
通过 OpenAI 兼容 /v1/embeddings 生成文本向量
POST /v1/embeddings 用于把文本转换为向量,适合语义检索、聚类、召回和重排前的候选生成。
请求示例
bash
curl -X POST "https://aiapi.fhddos.com/v1/embeddings" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-small",
"input": "Fhddos 支持统一调用多种模型能力"
}'常见用法
- 将知识库文档切片后写入向量数据库。
- 对用户查询生成向量,用于相似内容召回。
- 与模型列表接口结合,按 Token 可用模型动态选择 embedding 模型。
TIP
如果你需要排查调用问题,请记录响应头中的请求 ID,并参考 请求追踪。
OpenAPI
yaml
openapi: 3.0.3
info:
title: Fhddos Core API
version: '1.0'
description: >-
Core OpenAI-compatible and model-family endpoints used by the Fhddos user
docs.
servers:
- url: https://aiapi.fhddos.com
security:
- BearerAuth: []
paths:
/v1/embeddings:
post:
tags:
- OpenAI
summary: Embeddings
requestBody:
$ref: '#/components/requestBodies/JsonObject'
responses:
'200':
$ref: '#/components/responses/JsonObject'
components:
requestBodies:
JsonObject:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GenericObject'
responses:
JsonObject:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GenericObject'
schemas:
GenericObject:
type: object
additionalProperties: true
securitySchemes:
BearerAuth:
type: http
scheme: bearer
description: 'Authorization: Bearer <token>'