Chat Completions 形式
会話履歴に基づくレスポンスを、ストリーミングまたは通常形式で生成します。
OpenAI Chat Completions API と互換性があります。
POST
/v1/chat/completions
https://api.covanexus.com
認証
ボディ
認証
Authorization BearerAuth
Authorization Bearer <token>
Bearer トークン認証を使用します。形式: Authorization: Bearer $COVA_NEXUS_API_KEY
場所:ヘッダー
リクエストボディ
application/json
model* string
モデル ID
messages* array[object]
会話メッセージの一覧
temperature? number
サンプリング温度
デフォルト:1 | 範囲:0 ≤ 値 ≤ 2
top_p? number
nucleus sampling(核サンプリング)のパラメータ
デフォルト:1 | 範囲:0 ≤ 値 ≤ 1
n? integer
生成するレスポンス数
デフォルト:1 | 最小値:1
stream? boolean
ストリーミング出力を有効にします
デフォルト:false
stream_options? object
ストリーミング出力のオプション
stop? string | array[string]
停止シーケンス
max_tokens? integer
生成トークンの最大数
max_completion_tokens? integer
出力トークンの最大数
presence_penalty? number
既出トークンにペナルティを与え、新しい話題の生成を促します
デフォルト:0 | 範囲:-2 ≤ 値 ≤ 2
frequency_penalty? number
生成済みテキスト内の出現頻度に応じてトークンへペナルティを与えます
デフォルト:0 | 範囲:-2 ≤ 値 ≤ 2
logit_bias? object
指定したトークンのロジットバイアス
user? string
ユーザー ID
tools? array[object]
Function Calling で利用可能なツールの一覧
tool_choice? string | object
ツールの選択方法
response_format? object
レスポンス形式
seed? integer
乱数シード
reasoning_effort? string
推論の強度
指定可能な値: "low" | "medium" | "high"
modalities? array[string]
出力モダリティ
audio? object
音声出力の設定
レスポンスボディ
| ステータスコード | コンテンツタイプ |
|---|---|
| 200 | application/json |
| 400 | application/json |
| 429 | application/json |
curl -X POST "https://api.covanexus.com/v1/chat/completions" \
-H "Authorization: Bearer " \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [
{
"role": "system",
"content": "string"
},
{
"role": "user",
"content": "string"
}
]
}'200
400
429
{
"id": "string",
"object": "chat.completion",
"created": 0,
"model": "string",
"choices": [
{
"index": 0,
"message": {
"role": "system",
"content": "string"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}BearerAuth