メインコンテンツへスキップ
POST
/
openai
/
v1
/
rerank
リランキングを作成
curl --request POST \
  --url https://api.highwayapi.ai/openai/v1/rerank \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "model": "<string>",
  "query": "<string>",
  "documents": [
    "<string>"
  ],
  "top_n": 123
}
'
{
  "id": "<string>",
  "results": [
    {
      "document": {
        "text": "<string>"
      },
      "index": 123,
      "relevance_score": 123
    }
  ],
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}
リランキングを作成

リクエストヘッダー

Content-Type
string
必須
列挙値: application/json
Authorization
string
必須
Bearer 認証形式: Bearer {{API Key}}。

リクエストボディ

model
string
必須
使用するモデル名。
query
string
必須
検索クエリ。
documents
string[]
必須
ドキュメント一覧。
top_n
integer
返される最も関連性の高いドキュメントまたはインデックスの数。

レスポンス情報

id
string
必須
ID
results
object[]
必須
usage
object
Tokens の使用統計。