チャット会話リクエストの作成
curl --request POST \
--url https://api.highwayapi.ai/openai/v1/chat/completions \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": "<string>",
"messages": [
{
"content": {
"type": "<string>",
"text": "<string>",
"image_url": "<string>",
"video_url": "<string>"
},
"role": "<string>",
"name": "<string>"
}
],
"max_tokens": 123,
"stream": {},
"stream_options": {
"include_usage": true
},
"n": {},
"seed": {},
"frequency_penalty": {},
"presence_penalty": {},
"repetition_penalty": {},
"stop": {},
"temperature": {},
"top_p": {},
"top_k": {},
"min_p": {},
"logit_bias": {},
"logprobs": {},
"top_logprobs": {},
"tools": {
"type": "<string>",
"function": {
"name": "<string>",
"description": {},
"parameters": {},
"strict": true
}
},
"response_format": {
"type": "<string>",
"json_schema": {
"name": "<string>",
"description": {},
"schema": {},
"strict": true
}
},
"separate_reasoning": {},
"enable_thinking": {}
}
'import requests
url = "https://api.highwayapi.ai/openai/v1/chat/completions"
payload = {
"model": "<string>",
"messages": [
{
"content": {
"type": "<string>",
"text": "<string>",
"image_url": "<string>",
"video_url": "<string>"
},
"role": "<string>",
"name": "<string>"
}
],
"max_tokens": 123,
"stream": {},
"stream_options": { "include_usage": True },
"n": {},
"seed": {},
"frequency_penalty": {},
"presence_penalty": {},
"repetition_penalty": {},
"stop": {},
"temperature": {},
"top_p": {},
"top_k": {},
"min_p": {},
"logit_bias": {},
"logprobs": {},
"top_logprobs": {},
"tools": {
"type": "<string>",
"function": {
"name": "<string>",
"description": {},
"parameters": {},
"strict": True
}
},
"response_format": {
"type": "<string>",
"json_schema": {
"name": "<string>",
"description": {},
"schema": {},
"strict": True
}
},
"separate_reasoning": {},
"enable_thinking": {}
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
model: '<string>',
messages: [
{
content: {
type: '<string>',
text: '<string>',
image_url: '<string>',
video_url: '<string>'
},
role: '<string>',
name: '<string>'
}
],
max_tokens: 123,
stream: {},
stream_options: {include_usage: true},
n: {},
seed: {},
frequency_penalty: {},
presence_penalty: {},
repetition_penalty: {},
stop: {},
temperature: {},
top_p: {},
top_k: {},
min_p: {},
logit_bias: {},
logprobs: {},
top_logprobs: {},
tools: {
type: '<string>',
function: {name: '<string>', description: {}, parameters: {}, strict: true}
},
response_format: {
type: '<string>',
json_schema: {name: '<string>', description: {}, schema: {}, strict: true}
},
separate_reasoning: {},
enable_thinking: {}
})
};
fetch('https://api.highwayapi.ai/openai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/openai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'messages' => [
[
'content' => [
'type' => '<string>',
'text' => '<string>',
'image_url' => '<string>',
'video_url' => '<string>'
],
'role' => '<string>',
'name' => '<string>'
]
],
'max_tokens' => 123,
'stream' => [
],
'stream_options' => [
'include_usage' => true
],
'n' => [
],
'seed' => [
],
'frequency_penalty' => [
],
'presence_penalty' => [
],
'repetition_penalty' => [
],
'stop' => [
],
'temperature' => [
],
'top_p' => [
],
'top_k' => [
],
'min_p' => [
],
'logit_bias' => [
],
'logprobs' => [
],
'top_logprobs' => [
],
'tools' => [
'type' => '<string>',
'function' => [
'name' => '<string>',
'description' => [
],
'parameters' => [
],
'strict' => true
]
],
'response_format' => [
'type' => '<string>',
'json_schema' => [
'name' => '<string>',
'description' => [
],
'schema' => [
],
'strict' => true
]
],
'separate_reasoning' => [
],
'enable_thinking' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/openai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"image_url\": \"<string>\",\n \"video_url\": \"<string>\"\n },\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": {},\n \"stream_options\": {\n \"include_usage\": true\n },\n \"n\": {},\n \"seed\": {},\n \"frequency_penalty\": {},\n \"presence_penalty\": {},\n \"repetition_penalty\": {},\n \"stop\": {},\n \"temperature\": {},\n \"top_p\": {},\n \"top_k\": {},\n \"min_p\": {},\n \"logit_bias\": {},\n \"logprobs\": {},\n \"top_logprobs\": {},\n \"tools\": {\n \"type\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"response_format\": {\n \"type\": \"<string>\",\n \"json_schema\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"schema\": {},\n \"strict\": true\n }\n },\n \"separate_reasoning\": {},\n \"enable_thinking\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/openai/v1/chat/completions")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"image_url\": \"<string>\",\n \"video_url\": \"<string>\"\n },\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": {},\n \"stream_options\": {\n \"include_usage\": true\n },\n \"n\": {},\n \"seed\": {},\n \"frequency_penalty\": {},\n \"presence_penalty\": {},\n \"repetition_penalty\": {},\n \"stop\": {},\n \"temperature\": {},\n \"top_p\": {},\n \"top_k\": {},\n \"min_p\": {},\n \"logit_bias\": {},\n \"logprobs\": {},\n \"top_logprobs\": {},\n \"tools\": {\n \"type\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"response_format\": {\n \"type\": \"<string>\",\n \"json_schema\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"schema\": {},\n \"strict\": true\n }\n },\n \"separate_reasoning\": {},\n \"enable_thinking\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/openai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"image_url\": \"<string>\",\n \"video_url\": \"<string>\"\n },\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": {},\n \"stream_options\": {\n \"include_usage\": true\n },\n \"n\": {},\n \"seed\": {},\n \"frequency_penalty\": {},\n \"presence_penalty\": {},\n \"repetition_penalty\": {},\n \"stop\": {},\n \"temperature\": {},\n \"top_p\": {},\n \"top_k\": {},\n \"min_p\": {},\n \"logit_bias\": {},\n \"logprobs\": {},\n \"top_logprobs\": {},\n \"tools\": {\n \"type\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"response_format\": {\n \"type\": \"<string>\",\n \"json_schema\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"schema\": {},\n \"strict\": true\n }\n },\n \"separate_reasoning\": {},\n \"enable_thinking\": {}\n}"
response = http.request(request)
puts response.read_body{
"choices": [
{
"finish_reason": "<string>",
"index": 123,
"message": {
"role": "<string>",
"content": {},
"reasoning_content": {}
}
}
],
"created": 123,
"id": "<string>",
"model": "<string>",
"object": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123
}
}大規模言語モデル
チャット会話リクエストの作成
POST
/
openai
/
v1
/
chat
/
completions
チャット会話リクエストの作成
curl --request POST \
--url https://api.highwayapi.ai/openai/v1/chat/completions \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": "<string>",
"messages": [
{
"content": {
"type": "<string>",
"text": "<string>",
"image_url": "<string>",
"video_url": "<string>"
},
"role": "<string>",
"name": "<string>"
}
],
"max_tokens": 123,
"stream": {},
"stream_options": {
"include_usage": true
},
"n": {},
"seed": {},
"frequency_penalty": {},
"presence_penalty": {},
"repetition_penalty": {},
"stop": {},
"temperature": {},
"top_p": {},
"top_k": {},
"min_p": {},
"logit_bias": {},
"logprobs": {},
"top_logprobs": {},
"tools": {
"type": "<string>",
"function": {
"name": "<string>",
"description": {},
"parameters": {},
"strict": true
}
},
"response_format": {
"type": "<string>",
"json_schema": {
"name": "<string>",
"description": {},
"schema": {},
"strict": true
}
},
"separate_reasoning": {},
"enable_thinking": {}
}
'import requests
url = "https://api.highwayapi.ai/openai/v1/chat/completions"
payload = {
"model": "<string>",
"messages": [
{
"content": {
"type": "<string>",
"text": "<string>",
"image_url": "<string>",
"video_url": "<string>"
},
"role": "<string>",
"name": "<string>"
}
],
"max_tokens": 123,
"stream": {},
"stream_options": { "include_usage": True },
"n": {},
"seed": {},
"frequency_penalty": {},
"presence_penalty": {},
"repetition_penalty": {},
"stop": {},
"temperature": {},
"top_p": {},
"top_k": {},
"min_p": {},
"logit_bias": {},
"logprobs": {},
"top_logprobs": {},
"tools": {
"type": "<string>",
"function": {
"name": "<string>",
"description": {},
"parameters": {},
"strict": True
}
},
"response_format": {
"type": "<string>",
"json_schema": {
"name": "<string>",
"description": {},
"schema": {},
"strict": True
}
},
"separate_reasoning": {},
"enable_thinking": {}
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
model: '<string>',
messages: [
{
content: {
type: '<string>',
text: '<string>',
image_url: '<string>',
video_url: '<string>'
},
role: '<string>',
name: '<string>'
}
],
max_tokens: 123,
stream: {},
stream_options: {include_usage: true},
n: {},
seed: {},
frequency_penalty: {},
presence_penalty: {},
repetition_penalty: {},
stop: {},
temperature: {},
top_p: {},
top_k: {},
min_p: {},
logit_bias: {},
logprobs: {},
top_logprobs: {},
tools: {
type: '<string>',
function: {name: '<string>', description: {}, parameters: {}, strict: true}
},
response_format: {
type: '<string>',
json_schema: {name: '<string>', description: {}, schema: {}, strict: true}
},
separate_reasoning: {},
enable_thinking: {}
})
};
fetch('https://api.highwayapi.ai/openai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/openai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'messages' => [
[
'content' => [
'type' => '<string>',
'text' => '<string>',
'image_url' => '<string>',
'video_url' => '<string>'
],
'role' => '<string>',
'name' => '<string>'
]
],
'max_tokens' => 123,
'stream' => [
],
'stream_options' => [
'include_usage' => true
],
'n' => [
],
'seed' => [
],
'frequency_penalty' => [
],
'presence_penalty' => [
],
'repetition_penalty' => [
],
'stop' => [
],
'temperature' => [
],
'top_p' => [
],
'top_k' => [
],
'min_p' => [
],
'logit_bias' => [
],
'logprobs' => [
],
'top_logprobs' => [
],
'tools' => [
'type' => '<string>',
'function' => [
'name' => '<string>',
'description' => [
],
'parameters' => [
],
'strict' => true
]
],
'response_format' => [
'type' => '<string>',
'json_schema' => [
'name' => '<string>',
'description' => [
],
'schema' => [
],
'strict' => true
]
],
'separate_reasoning' => [
],
'enable_thinking' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/openai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"image_url\": \"<string>\",\n \"video_url\": \"<string>\"\n },\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": {},\n \"stream_options\": {\n \"include_usage\": true\n },\n \"n\": {},\n \"seed\": {},\n \"frequency_penalty\": {},\n \"presence_penalty\": {},\n \"repetition_penalty\": {},\n \"stop\": {},\n \"temperature\": {},\n \"top_p\": {},\n \"top_k\": {},\n \"min_p\": {},\n \"logit_bias\": {},\n \"logprobs\": {},\n \"top_logprobs\": {},\n \"tools\": {\n \"type\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"response_format\": {\n \"type\": \"<string>\",\n \"json_schema\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"schema\": {},\n \"strict\": true\n }\n },\n \"separate_reasoning\": {},\n \"enable_thinking\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/openai/v1/chat/completions")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"image_url\": \"<string>\",\n \"video_url\": \"<string>\"\n },\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": {},\n \"stream_options\": {\n \"include_usage\": true\n },\n \"n\": {},\n \"seed\": {},\n \"frequency_penalty\": {},\n \"presence_penalty\": {},\n \"repetition_penalty\": {},\n \"stop\": {},\n \"temperature\": {},\n \"top_p\": {},\n \"top_k\": {},\n \"min_p\": {},\n \"logit_bias\": {},\n \"logprobs\": {},\n \"top_logprobs\": {},\n \"tools\": {\n \"type\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"response_format\": {\n \"type\": \"<string>\",\n \"json_schema\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"schema\": {},\n \"strict\": true\n }\n },\n \"separate_reasoning\": {},\n \"enable_thinking\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/openai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"image_url\": \"<string>\",\n \"video_url\": \"<string>\"\n },\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": {},\n \"stream_options\": {\n \"include_usage\": true\n },\n \"n\": {},\n \"seed\": {},\n \"frequency_penalty\": {},\n \"presence_penalty\": {},\n \"repetition_penalty\": {},\n \"stop\": {},\n \"temperature\": {},\n \"top_p\": {},\n \"top_k\": {},\n \"min_p\": {},\n \"logit_bias\": {},\n \"logprobs\": {},\n \"top_logprobs\": {},\n \"tools\": {\n \"type\": \"<string>\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"parameters\": {},\n \"strict\": true\n }\n },\n \"response_format\": {\n \"type\": \"<string>\",\n \"json_schema\": {\n \"name\": \"<string>\",\n \"description\": {},\n \"schema\": {},\n \"strict\": true\n }\n },\n \"separate_reasoning\": {},\n \"enable_thinking\": {}\n}"
response = http.request(request)
puts response.read_body{
"choices": [
{
"finish_reason": "<string>",
"index": 123,
"message": {
"role": "<string>",
"content": {},
"reasoning_content": {}
}
}
],
"created": 123,
"id": "<string>",
"model": "<string>",
"object": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123
}
}指定されたチャット会話に基づいてモデルの応答を生成します
リクエストヘッダー
リクエストボディ
現在の会話を構成するメッセージのリスト。
表示 プロパティ
表示 プロパティ
メッセージの内容。すべてのメッセージには content が必要です。関数呼び出しを含む assistant メッセージの場合、content は null にできます。モダリティに応じて、以下のパラメータを使用できます。
- テキスト内容
- 画像内容
- 動画内容
オプション 1:
文字列型を使用してメッセージのテキスト内容を表すことができます。
オプション 2:
コンテンツ部分の配列、object[] を使用します。詳細フィールドは以下のとおりです:
ビジョン言語モデルでのみ使用できます。
コンテンツ部分の配列、object[]。詳細フィールドは以下のとおりです:
補完で生成される最大トークン数。プロンプト(以前のメッセージ)に max_tokens のトークン数を加えた値がモデルのコンテキスト長を超える場合、動作は context_length_exceeded_behavior によって異なります。デフォルトでは、エラーを返すのではなく、max_tokens がコンテキストウィンドウに収まるように引き下げられます。
部分的な進捗をストリーミングで返すかどうか。設定すると、トークンはデータ専用のサーバー送信イベント (SSE) として利用可能になり次第送信され、ストリームは
data: [DONE] メッセージで終了します。各プロンプトに対して生成する補完の数。注意:このパラメータは多数の補完を生成するため、トークン割り当てを急速に消費する可能性があります。慎重に使用し、max_tokens と stop に適切な設定を行ってください。必須範囲:
1 < x < 128正の値は、新しいトークンがテキスト内に既に出現している頻度に基づいてペナルティを与え、モデルが同じ行を逐語的に繰り返す可能性を低下させます。目的が繰り返しサンプルを少し減らすだけであれば、0.1 から 1 の間が妥当な値です。繰り返しを強く抑制することが目的であれば、係数を 2 まで増やすこともできますが、サンプル品質が大幅に低下する可能性があります。負の値は、繰り返しの可能性を高めるために使用できます。少なくとも 1 回出現したトークンに固定率でペナルティを与える presence_penalty も参照してください。必須範囲:
-2 < x < 2正の値は、新しいトークンがテキスト内に出現しているかどうかに基づいてペナルティを与え、モデルが新しいトピックについて話す可能性を高めます。目的が繰り返しサンプルを少し減らすだけであれば、0.1 から 1 の間が妥当な値です。繰り返しを強く抑制することが目的であれば、係数を 2 まで増やすこともできますが、サンプル品質が大幅に低下する可能性があります。負の値は、繰り返しの可能性を高めるために使用できます。トークンの出現頻度に基づいて増加率でトークンにペナルティを与える
frequency_penalty も参照してください。必須範囲:-2 < x < 2繰り返しを抑制または促進するために、繰り返されるトークンにペナルティを適用します。値 1.0 はペナルティなしを意味し、自由な繰り返しを許可します。1.0 より大きい値は繰り返しにペナルティを与え、繰り返しトークンの可能性を低下させます。0.0 から 1.0 の間の値は繰り返しに報酬を与え、繰り返しトークンの機会を増やします。良好なバランスを得るには、通常 1.2 の値を使用することをお勧めします。ペナルティは、生成された出力とデコーダー専用モデルのプロンプトに適用されることに注意してください。必須範囲:
0 < x < 2使用するサンプリング温度。0 から 2 の間です。0.8 のように高い値にすると出力はよりランダムになり、0.2 のように低い値にするとより集中し決定論的になります。通常、この項目または
top_p のどちらか一方のみを変更し、両方を同時に変更しないことをお勧めします。必須範囲:0 < x < 2サンプリング温度の代替手法で、核サンプリングと呼ばれます。モデルは top_p の確率質量を持つトークン結果を考慮します。したがって、0.1 は上位 10% の確率質量を構成するトークンのみを考慮することを意味します。通常、この項目または temperature のどちらか一方のみを変更し、両方を同時に変更しないことをお勧めします。必須範囲:
0 < x <= 1Top-k サンプリングはもう 1 つのサンプリング手法で、最も可能性の高い次の k 個のトークンがフィルタリングされ、確率質量はこれら k 個の次トークン間でのみ再分配されます。k の値は、テキスト生成中の各ステップにおける次トークンの候補数を制御します。必須範囲:
1 < x < 128指定したトークンが補完に出現する可能性を変更します。JSON オブジェクトを受け取り、トークンを -100 から 100 の間の関連するバイアス値にマッピングします。
数学的には、サンプリング前にモデルが生成した logits にバイアスが追加されます。正確な効果はモデルによって異なります。たとえば、
"logit_bias":{"1024": 6} を設定すると、token ID が 1024 のトークンの可能性が高まります。0 から 20 の間の整数で、各トークン位置で返される最も可能性の高いトークン数を指定します。各トークンには関連する対数確率があります。このパラメータを使用する場合は、
logprobs を true に設定する必要があります。必須範囲:0 <= x <= 20モデルが呼び出せるツールのリスト。現在、ツールとしてサポートされているのは関数のみです。モデルが JSON 入力を生成できる関数のリストを提供するために使用します。関数呼び出しの詳細については、関数呼び出しガイドを参照してください。
表示 プロパティ
表示 プロパティ
表示 プロパティ
表示 プロパティ
関数が受け取るパラメータ。JSON Schema オブジェクトとして記述します。形式に関するドキュメントは JSON Schema リファレンスを参照してください。
モデルに特定の出力形式を生成させることができます。
{ "type": "json_schema", "json_schema": {...} } に設定すると構造化出力が有効になり、モデルが提供された JSON schema に一致することを保証します。{ "type": "json_object" } に設定すると従来の JSON モードが有効になり、モデルが生成するメッセージが有効な JSON であることを保証します。対応しているモデルでは、json_schema の使用をお勧めします。推論を “content” から分離して “reasoning_content” フィールドに入れるかどうか。サポートされるモデル:
deepseek/deepseek-r1-turbo
レスポンス情報
チャット補完オプションのリスト。
表示 プロパティ
表示 プロパティ
モデルがトークン生成を停止した理由。モデルが自然な停止点または提供された停止シーケンスに到達した場合は “stop”、リクエストで指定された最大トークン数に到達した場合は “length” です。利用可能なオプション:
stop, length最終更新日 2026年6月10日