1. Models
梧柏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. Models

获取令牌支持模型

GET
/v1/models
列出当前 API 令牌可访问的模型列表。

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

列出模型#

给定一个提示,该模型将返回一个或多个预测的完成,并且还可以返回每个位置的替代标记的概率。
为提供的提示和参数创建完成

请求参数#

{
  "contentType": "none",
  "properties": {
    "frequency_penalty": {
      "description": "默认为 0 -2.0 到 2.0 之间的数字。正值根据文本目前的存在频率惩罚新标记,降低模型重复相同行的可能性。  有关频率和存在惩罚的更多信息。",
      "type": "number",
      "x-i18n": {
        "en-US": {
          "description": "Defaults to 0. Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line."
        }
      }
    },
    "logit_bias": {
      "description": "修改指定标记出现在补全中的可能性。\n\n接受一个 JSON 对象,该对象将标记(由标记器指定的标记 ID)映射到相关的偏差值(-100 到 100)。从数学上讲,偏差在对模型进行采样之前添加到模型生成的 logit 中。确切效果因模型而异,但-1 和 1 之间的值应减少或增加相关标记的选择可能性;如-100 或 100 这样的值应导致相关标记的禁用或独占选择。",
      "type": "null",
      "x-i18n": {
        "en-US": {
          "description": "Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect varies by model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."
        }
      }
    },
    "max_tokens": {
      "description": "默认为 inf\n在聊天补全中生成的最大标记数。\n\n输入标记和生成标记的总长度受模型的上下文长度限制。计算标记的 Python 代码示例。",
      "type": "integer",
      "x-i18n": {
        "en-US": {
          "description": "Defaults to inf. The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length."
        }
      }
    },
    "messages": {
      "description": "至今为止对话所包含的消息列表。Python 代码示例。",
      "items": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array",
      "x-i18n": {
        "en-US": {
          "description": "list of messages in the conversation so far. Python code example."
        }
      }
    },
    "model": {
      "description": "要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。\n\n",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The ID of the model to use. For more information about which models can be used with the Chat API, see the model endpoint compatibility table."
        }
      }
    },
    "n": {
      "description": "默认为 1\n为每个输入消息生成多少个聊天补全选择。",
      "type": "integer",
      "x-i18n": {
        "en-US": {
          "description": "Defaults to 1. How many chat completion choices to generate for each input message."
        }
      }
    },
    "presence_penalty": {
      "description": "-2.0 和 2.0 之间的数字。正值会根据到目前为止是否出现在文本中来惩罚新标记,从而增加模型谈论新主题的可能性。  [查看有关频率和存在惩罚的更多信息。](https://platform.openai.com/docs/api-reference/parameter-details)",
      "type": "number",
      "x-i18n": {
        "en-US": {
          "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. [See more information about frequency and presence penalties.](https://platform.openai.com/docs/api-reference/parameter-details)"
        }
      }
    },
    "response_format": {
      "description": "指定模型必须输出的格式的对象。  将 { \"type\": \"json_object\" } 启用 JSON 模式,这可以确保模型生成的消息是有效的 JSON。  重要提示:使用 JSON 模式时,还必须通过系统或用户消息指示模型生成 JSON。如果不这样做,模型可能会生成无休止的空白流,直到生成达到令牌限制,从而导致延迟增加和请求“卡住”的外观。另请注意,如果 finish_reason=\"length\",则消息内容可能会被部分切断,这表示生成超过了 max_tokens 或对话超过了最大上下文长度。  显示属性",
      "properties": {},
      "type": "object",
      "x-i18n": {
        "en-US": {
          "description": "An object specifying the format that the model must output. Setting { \"type\": \"json_object\" } enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON via a system or user message. Also note that if finish_reason=\"length\", the message content may be partially cut off."
        }
      }
    },
    "seen": {
      "description": "此功能处于测试阶段。如果指定,我们的系统将尽最大努力确定性地进行采样,以便使用相同的种子和参数进行重复请求应返回相同的结果。不能保证确定性,您应该参考 system_fingerprint 响应参数来监控后端的更改。",
      "type": "integer",
      "x-i18n": {
        "en-US": {
          "description": "This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend."
        }
      }
    },
    "stop": {
      "description": "默认为 null 最多 4 个序列,API 将停止进一步生成标记。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Defaults to null. Up to 4 sequences where the API will stop generating further tokens."
        }
      }
    },
    "stream": {
      "description": "默认为 false 如果设置,则像在 ChatGPT 中一样会发送部分消息增量。标记将以仅数据的服务器发送事件的形式发送,这些事件在可用时,并在 data: [DONE] 消息终止流。Python 代码示例。",
      "type": "boolean",
      "x-i18n": {
        "en-US": {
          "description": "defaults to false if set, sends partial message deltas like ChatGPT. tokens are sent as data-only server-sent events,as they become available; stream ends with data: [DONE]. Python code example."
        }
      }
    },
    "temperature": {
      "description": "使用什么采样温度,介于 0 和 2 之间。较高的值(如 0.8)将使输出更加随机,而较低的值(如 0.2)将使输出更加集中和确定。  我们通常建议改变这个或`top_p`但不是两者。",
      "type": "integer",
      "x-i18n": {
        "en-US": {
          "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 make output more random, while lower values like 0.2 make it more focused and deterministic. We generally recommend altering this or `top_p` but not both."
        }
      }
    },
    "tool_choice": {
      "description": "控制模型调用哪个函数(如果有的话)。none 表示模型不会调用函数,而是生成消息。auto 表示模型可以在生成消息和调用函数之间进行选择。通过 {\"type\": \"function\", \"function\": {\"name\": \"my_function\"}} 强制模型调用该函数。  如果没有函数存在,默认为 none。如果有函数存在,默认为 auto。  显示可能的类型",
      "properties": {},
      "type": "object",
      "x-i18n": {
        "en-US": {
          "description": "Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. Specifying a particular function via {\"type\": \"function\", \"function\": {\"name\": \"my_function\"}} forces the model to call that function. none is the default when no functions are present. auto is the default if functions are present."
        }
      }
    },
    "tools": {
      "description": "模型可以调用的一组工具列表。目前,只支持作为工具的函数。使用此功能来提供模型可以为之生成 JSON 输入的函数列表。",
      "items": {
        "type": "string"
      },
      "type": "array",
      "x-i18n": {
        "en-US": {
          "description": "A list of tools the model may call. Currently only functions are supported. Use this to provide functions for which the model can generate JSON input."
        }
      }
    },
    "top_p": {
      "description": "一种替代温度采样的方法,称为核采样,其中模型考虑具有 top_p 概率质量的标记的结果。所以 0.1 意味着只考虑构成前 10% 概率质量的标记。  我们通常建议改变这个或`temperature`但不是两者。",
      "type": "integer",
      "x-i18n": {
        "en-US": {
          "description": "An alternative to temperature sampling called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both."
        }
      }
    },
    "user": {
      "description": "代表您的最终用户的唯一标识符,可以帮助 OpenAI 监控和检测滥用行为。[了解更多](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids)。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids)."
        }
      }
    }
  },
  "required": [
    "model",
    "messages",
    "tools",
    "tool_choice"
  ]
}

响应示例 · OK#

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "\n\nHello there, how may I assist you today?",
        "role": "assistant"
      }
    }
  ],
  "created": 1677652288,
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 12,
    "prompt_tokens": 9,
    "total_tokens": 21
  }
}

获取令牌支持模型#

请求参数#

{
  "contentType": "none",
  "properties": {
    "allow_ips": {
      "type": "string"
    },
    "expired_time": {
      "type": "integer"
    },
    "group": {
      "type": "string"
    },
    "model_limits": {
      "type": "string"
    },
    "model_limits_enabled": {
      "type": "boolean"
    },
    "name": {
      "type": "string"
    },
    "remain_quota": {
      "type": "integer"
    },
    "unlimited_quota": {
      "type": "boolean"
    }
  },
  "required": [
    "name",
    "remain_quota",
    "expired_time",
    "unlimited_quota",
    "model_limits_enabled",
    "model_limits",
    "allow_ips",
    "group"
  ]
}

请求参数

Header 参数

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location '/v1/models' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'content-type: application/json'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
    "id": "resp_example",
    "object": "response",
    "status": "completed"
}
修改于 2026-10-24 18:33:00
上一页
编辑image【"grok-imagine-image-quality" | "grok-imagine-image-2.0"】
下一页
创建完成
Built with