メインコンテンツへスキップ
POST
/
v1
/
chat
/
completions
チャットセッションの作成
curl --request POST \
  --url https://api.aiid.edu.kg/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-4",
  "messages": [
    {
      "content": "<string>",
      "name": "<string>",
      "tool_calls": [
        {
          "id": "<string>",
          "type": "function",
          "function": {
            "name": "<string>",
            "arguments": "<string>"
          }
        }
      ],
      "tool_call_id": "<string>",
      "reasoning_content": "<string>"
    }
  ],
  "temperature": 1,
  "top_p": 1,
  "n": 1,
  "stream": false,
  "stream_options": {
    "include_usage": true
  },
  "stop": "<string>",
  "max_tokens": 123,
  "max_completion_tokens": 123,
  "presence_penalty": 0,
  "frequency_penalty": 0,
  "logit_bias": {},
  "user": "<string>",
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "<string>",
        "description": "<string>",
        "parameters": {}
      }
    }
  ],
  "response_format": {
    "json_schema": {}
  },
  "seed": 123,
  "modalities": [],
  "audio": {
    "voice": "<string>",
    "format": "<string>"
  }
}
'
{
  "id": "<string>",
  "object": "chat.completion",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "content": "<string>",
        "name": "<string>",
        "tool_calls": [
          {
            "id": "<string>",
            "type": "function",
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            }
          }
        ],
        "tool_call_id": "<string>",
        "reasoning_content": "<string>"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "prompt_tokens_details": {
      "cached_tokens": 123,
      "text_tokens": 123,
      "audio_tokens": 123,
      "image_tokens": 123
    },
    "completion_tokens_details": {
      "text_tokens": 123,
      "audio_tokens": 123,
      "reasoning_tokens": 123
    }
  },
  "system_fingerprint": "<string>"
}

承認

Authorization
string
header
必須

Bearer Token を使用して認証します。 形式: Authorization: Bearer sk-xxxxxx

ボディ

application/json
model
string
必須

モデル ID

:

"gpt-4"

messages
object[]
必須

対話メッセージ一覧

temperature
number
デフォルト:1

サンプリング温度

必須範囲: 0 <= x <= 2
top_p
number
デフォルト:1

核サンプリングパラメータ

必須範囲: 0 <= x <= 1
n
integer
デフォルト:1

生成数

必須範囲: x >= 1
stream
boolean
デフォルト:false

ストリームレスポンスにするかどうか

stream_options
object
stop

停止シーケンス

max_tokens
integer

最大生成トークン数

max_completion_tokens
integer

最大生成トークン数

presence_penalty
number
デフォルト:0
必須範囲: -2 <= x <= 2
frequency_penalty
number
デフォルト:0
必須範囲: -2 <= x <= 2
logit_bias
object
user
string
tools
object[]
tool_choice
利用可能なオプション:
none,
auto,
required
response_format
object
seed
integer
reasoning_effort
enum<string>

推論の強さ (推論対応モデル用)

利用可能なオプション:
low,
medium,
high
modalities
enum<string>[]
利用可能なオプション:
text,
audio
audio
object

レスポンス

レスポンスの作成に成功しました

id
string
object
string
:

"chat.completion"

created
integer
model
string
choices
object[]
usage
object
system_fingerprint
string