1. Embeddings
梧柏API使用文档
WHBAI · OpenAI 兼容
  • WHBAI · Google Gemini 原生 (v1alpha)
  • WHBAI · Google Gemini 原生
  • WHBAI · Ideogram
  • WHBAI · Ideogram V3
  • WHBAI · Midjourney
  • WHBAI · Jimeng
  • WHBAI · Kling
  • WHBAI · Luma
  • WHBAI · Luma V1
  • WHBAI · Omni 视频
  • WHBAI · Pixverse
  • WHBAI · Runway
  • WHBAI · Sora2
  • WHBAI · 统一视频 VEO
  • WHBAI · Vidu
  • WHBAI · 豆包 Volc
  • WHBAI · Suno
  • WHBAI · Playground
  • WHBAI · 账号与令牌
  • WHBAI · 阿里 Pix
  • WHBAI · 阿里百炼
  • WHBAI · 私域人像
  • WHBAI · Fal.ai
  • WHBAI · Replicate
  • WHBAI · 腾讯云 VOD
  • WHBAI · MiniMax
  • WHBAI · 支持模型列表
  • WHBAI · Grok Imagine
  • WHBAI · Seedance 2.0
  • WHBAI · TypeSafe
  • WHBAI · OpenAI 兼容
  • Chat
    • 对话补全(OpenAI 兼容)
      POST
  • Embeddings
    • 文本嵌入(OpenAI 兼容)
      POST
  • Audio
    • 音频转文字 gpt-4o-transcribe
      POST
    • 创建语音 gpt-4o-mini-tts
      POST
    • 创建翻译(部分模型不支持)
      POST
  • 文生图接口
    • GPT Image-1
      • 创建 gpt-image-2.5
    • Grok
      • 编辑image【"grok-imagine-image-quality" | "grok-imagine-image-2.0"】
  • Models
    • 获取令牌支持模型
      GET
  • Completions
    • 创建完成
      POST
  • Responses
    • 创建函数调用
      POST
    • gpt 上下文压缩
      POST
  • Rerank
    • 重排序
      POST
  • 智能交互
    • TypeSafe
      • TypeSafe System One
  • 谷歌Gemini
    • 原生格式
      • 图片生成 gemini-nano-banana-2.1
  • 品牌平台
    • MINIMAX-V2
      • 创建视频
      • 查询单个任务
  • 数据模型
    • 对话接口 POST /v1/chat/completions
    • V1ChatCompletionsResponse
    • V1EmbeddingsRequest
    • V1EmbeddingsResponse
    • V1AudioSpeechRequest
    • PostV1ImagesGenerationsRequest
    • POST /v1/images/generations · wan2.7-image-pro 成功响应
    • POSTV1ImagesGenerations_DallE2
    • POSTV1ImagesGenerations_GptImage1
    • POSTV1ImagesGenerations_GptImage2
    • POSTV1ImagesGenerations_GptImage25
    • POSTV1ImagesGenerations_GptImage2C
    • POSTV1ImagesGenerations_QwenImageMax
    • POSTV1ImagesGenerations_ZImageTurbo
    • POSTV1ImagesGenerations_QwenImage20260303
    • POSTV1ImagesGenerations_QwenImage3
    • POSTV1ImagesGenerations_QwenImage3Pro
    • POSTV1ImagesEdits_Grok3Image
    • POSTV1ImagesEdits_GptImage1
    • POSTV1ImagesEdits_GptImage2
    • POSTV1ImagesEdits_GptImage25
    • POSTV1ImagesEdits_QwenImageEdit2509
    • POSTV1ImagesGenerations_DallE3
    • POSTV1ImagesGenerations_Grok2Image
    • POSTV1ImagesGenerations_Grok3Image
    • Message
    • ContentPart
    • Tool
    • StreamOptions
    • ResponseFormat
    • WebSearchOptions
    • wan2.7-image-pro 文生图请求
    • imageData
    • PostV1ImagesEditsResponse
    • PostV1CompletionsRequest
    • PostV1CompletionsResponse
    • PostV1ResponsesRequest
    • PostV1ResponsesResponse
    • PostV1ResponsesCompactRequest
    • PostV1RerankRequest
    • PostV1RerankResponse
    • NewApiError
  1. Embeddings

文本嵌入(OpenAI 兼容)

POST
/v1/embeddings
生成文本向量嵌入。通过 model 选择上游(如 OpenAI text-embedding-3-small 或 Gemini 嵌入模型)。
OpenAI 官方文档:https://platform.openai.com/docs/api-reference/embeddings

网站中的模型与调用示例#

创建嵌入#

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

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "input": {
      "description": "输入文本以获取嵌入,编码为字符串或标记数组。要在单个请求中获取多个输入的嵌入,请传递一个字符串数组或令牌数组数组。每个输入的长度不得超过 8192 个标记。",
      "type": "string"
    },
    "model": {
      "description": "要使用的模型的 ID。您可以使用[List models](https://platform.openai.com/docs/api-reference/models/list) API 来查看所有可用模型,或查看我们的[模型概述](https://platform.openai.com/docs/models/overview)以了解它们的描述。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The ID of the model to use. You can use the List models API to view all available models, or view our Model Overview for their descriptions."
        }
      }
    }
  },
  "required": [
    "model",
    "input"
  ]
}

请求示例 · 示例 1#

{
  "input": "喵喵喵喵喵喵喵喵喵喵喵喵喵喵喵",
  "model": "text-embedding-3-large"
}

响应示例 · Create embeddings#

"{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"object\": \"embedding\",\n      \"embedding\": [\n        0.0023064255,\n        -0.009327292,\n        .... (1536 floats total for ada-002)\n        -0.0028842222\n      ],\n      \"index\": 0\n    }\n  ],\n  \"model\": \"text-embedding-ada-002\",\n  \"usage\": {\n    \"prompt_tokens\": 8,\n    \"total_tokens\": 8\n  }\n}"

文本嵌入 [chat兼容格式]#

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "dimensions": {
      "type": "integer"
    },
    "input": {
      "type": "string"
    },
    "model": {
      "type": "string"
    }
  },
  "required": [
    "model",
    "input"
  ]
}

请求参数

Authorization
Bearer Token
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
or
Body 参数application/json必填

示例
{
    "model": "text-embedding-3-small",
    "input": "The food was delicious and the waiter was friendly."
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location '/v1/embeddings' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "text-embedding-3-small",
    "input": "The food was delicious and the waiter was friendly."
}'

返回响应

🟢200成功
application/json
OK
Bodyapplication/json

示例
{
    "object": "string",
    "data": [
        {}
    ],
    "model": "string",
    "usage": {}
}
🟠400请求有误
🟠401没有权限
修改于 2026-10-24 18:33:00
上一页
对话补全(OpenAI 兼容)
下一页
音频转文字 gpt-4o-transcribe
Built with