メインコンテンツへスキップ
POST
/
v1
/
chat
/
completions
curl --request POST \
  --url 'https://api.elkapi.com/v1/chat/completions' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gpt-5.5",
  "messages": [
    {
      "role": "user",
      "content": "こんにちは、自己紹介してください"
    }
  ],
  "temperature": 1,
  "stream": false,
  "max_tokens": 1024,
  "response_format": "json"
}'
{
  "id": "id",
  "object": "chat.completion",
  "created": 1,
  "model": "gpt-5.5",
  "choices": [
    {
      "index": 1,
      "message": {
        "role": "user",
        "content": "こんにちは、自己紹介してください",
        "name": "name",
        "tool_calls": [
          {
            "id": {},
            "type": {},
            "function": {}
          }
        ],
        "tool_call_id": "tool_call_id",
        "reasoning_content": "reasoning_content"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1,
    "completion_tokens": 1,
    "total_tokens": 1,
    "prompt_tokens_details": {
      "cached_tokens": 1,
      "text_tokens": 1,
      "audio_tokens": 1,
      "image_tokens": 1
    },
    "completion_tokens_details": {
      "text_tokens": 1,
      "audio_tokens": 1,
      "reasoning_tokens": 1
    }
  },
  "system_fingerprint": "system_fingerprint"
}

Documentation Index

Fetch the complete documentation index at: https://docs.elkapi.com/llms.txt

Use this file to discover all available pages before exploring further.

curl --request POST \
  --url 'https://api.elkapi.com/v1/chat/completions' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gpt-5.5",
  "messages": [
    {
      "role": "user",
      "content": "こんにちは、自己紹介してください"
    }
  ],
  "temperature": 1,
  "stream": false,
  "max_tokens": 1024,
  "response_format": "json"
}'
{
  "id": "id",
  "object": "chat.completion",
  "created": 1,
  "model": "gpt-5.5",
  "choices": [
    {
      "index": 1,
      "message": {
        "role": "user",
        "content": "こんにちは、自己紹介してください",
        "name": "name",
        "tool_calls": [
          {
            "id": {},
            "type": {},
            "function": {}
          }
        ],
        "tool_call_id": "tool_call_id",
        "reasoning_content": "reasoning_content"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1,
    "completion_tokens": 1,
    "total_tokens": 1,
    "prompt_tokens_details": {
      "cached_tokens": 1,
      "text_tokens": 1,
      "audio_tokens": 1,
      "image_tokens": 1
    },
    "completion_tokens_details": {
      "text_tokens": 1,
      "audio_tokens": 1,
      "reasoning_tokens": 1
    }
  },
  "system_fingerprint": "system_fingerprint"
}

Authorizations

Authorization
string
必須
すべてのエンドポイントで Bearer Token 認証が必要です。リクエストヘッダーに追加します:
Authorization: Bearer YOUR_API_KEY

Body

model
string
デフォルト:"gpt-5.5"
必須
モデルID例:gpt-5.5
messages
array<object>
必須
チャットメッセージ一覧
messages.role
string
必須
メッセージロール指定可能な値:systemuserassistanttooldeveloper
messages.content
string or array<object>
必須
メッセージ内容
messages.name
string
送信者名
messages.tool_calls
array<object>
messages.tool_calls.id
string
messages.tool_calls.type
string
例:function
messages.tool_calls.function
object
messages.tool_calls.function.name
string
messages.tool_calls.function.arguments
string
messages.tool_call_id
string
ツール呼び出しID(toolロールメッセージ用)
messages.reasoning_content
string
推論内容
temperature
number
デフォルト:"1"
サンプリング温度
top_p
number
デフォルト:"1"
ニュークリアスサンプリングパラメーター
n
integer
デフォルト:"1"
生成数
stream
boolean
デフォルト:"false"
ストリーミング応答にするかどうか
stream_options
object
stream_options.include_usage
boolean
stop
string or array<string>
停止シーケンス
max_tokens
integer
最大生成トークン数
max_completion_tokens
integer
最大補完トークン数
presence_penalty
number
デフォルト:"0"
frequency_penalty
number
デフォルト:"0"
logit_bias
object
user
string
tools
array<object>
tools.type
string
例:function
tools.function
object
tools.function.name
string
tools.function.description
string
tools.function.parameters
object
JSON Schema形式のパラメーター定義
tool_choice
string or object
tool_choice.type
string
tool_choice.function
object
tool_choice.function.name
string
response_format
object
response_format.type
string
指定可能な値:textjson_objectjson_schema
response_format.json_schema
object
JSON Schema定義
seed
integer
reasoning_effort
string
推論強度(推論対応モデル用)指定可能な値:lowmediumhigh
modalities
array<string>
audio
object
audio.voice
string
audio.format
string

Response

id
string
object
string
例:chat.completion
created
integer
model
string
デフォルト:"gpt-5.5"
例:gpt-5.5
choices
array<object>
choices.index
integer
choices.message
object
choices.message.role
string
必須
メッセージロール指定可能な値:systemuserassistanttooldeveloper
choices.message.content
string or array<object>
必須
メッセージ内容
choices.message.name
string
送信者名
choices.message.tool_calls
array<object>
choices.message.tool_calls.id
string
choices.message.tool_calls.type
string
例:function
choices.message.tool_calls.function
object
choices.message.tool_call_id
string
ツール呼び出しID(toolロールメッセージ用)
choices.message.reasoning_content
string
推論内容
choices.finish_reason
string
指定可能な値:stoplengthtool_callscontent_filter
usage
object
usage.prompt_tokens
integer
プロンプトトークン数
usage.completion_tokens
integer
補完トークン数
usage.total_tokens
integer
合計トークン数
usage.prompt_tokens_details
object
usage.prompt_tokens_details.cached_tokens
integer
usage.prompt_tokens_details.text_tokens
integer
usage.prompt_tokens_details.audio_tokens
integer
usage.prompt_tokens_details.image_tokens
integer
usage.completion_tokens_details
object
usage.completion_tokens_details.text_tokens
integer
usage.completion_tokens_details.audio_tokens
integer
usage.completion_tokens_details.reasoning_tokens
integer
system_fingerprint
string