DeepSeek API
🇯🇵 Japanese
  • 🇺🇸 English
  • 🇯🇵 Japanese
  • 🇰🇷 Korea
  • 🇵🇹 Portuguese
  1. APIリファレンス
DeepSeek API
🇯🇵 Japanese
  • 🇺🇸 English
  • 🇯🇵 Japanese
  • 🇰🇷 Korea
  • 🇵🇹 Portuguese
  • 迅速に開始します
    • 最初のAPI呼び出し
    • モデルと価格
    • Temperature パラメーター
    • トークンとトークンの使用
    • 制限
    • エラーコード
  • APIリファレンス
    • 導入
    • チャット完了を作成します
      POST
    • FIM完了を作成(ベータ)
      POST
    • モデルをリストします
      GET
    • ユーザーのバランスを取得します
      GET
  • APIガイド
    • 推論モデル(Deepseek Reautoner)
    • 会話の複数のラウンド
    • チャットプレフィックスの完了(ベータ)
    • FIM完了(ベータ)
    • JSON出力
    • 関数呼び出し
  • FAQ
    • FAQ
  1. APIリファレンス

チャット完了を作成します

POST
https://api.deepseek.com/chat/completions
指定されたチャット会話に対するモデル応答を作成します。
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.deepseek.com/chat/completions' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
  "messages": [
    {
      "content": "You are a helpful assistant",
      "role": "system"
    },
    {
      "content": "Hi",
      "role": "user"
    }
  ],
  "model": "deepseek-chat",
  "frequency_penalty": 0,
  "max_tokens": 2048,
  "presence_penalty": 0,
  "response_format": {
    "type": "text"
  },
  "stop": null,
  "stream": false,
  "stream_options": null,
  "temperature": 1,
  "top_p": 1,
  "tools": null,
  "tool_choice": "none",
  "logprobs": false,
  "top_logprobs": null
}'
Response Response Example
200 - Success - Success
{
  "id": "string",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "string",
        "reasoning_content": "string",
        "tool_calls": [
          {
            "id": "string",
            "type": "function",
            "function": {
              "name": "string",
              "arguments": "string"
            }
          }
        ],
        "role": "assistant"
      },
      "logprobs": {
        "content": [
          {
            "token": "string",
            "logprob": 0,
            "bytes": [
              0
            ],
            "top_logprobs": [
              {
                "token": "string",
                "logprob": 0,
                "bytes": [
                  0
                ]
              }
            ]
          }
        ]
      }
    }
  ],
  "created": 0,
  "model": "string",
  "system_fingerprint": "string",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 0,
    "prompt_tokens": 0,
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 0,
    "total_tokens": 0,
    "completion_tokens_details": {
      "reasoning_tokens": 0
    }
  }
}

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params
Content-Type
string 
required
Example:
application/json
Authorization
string 
required
Example:
Bearer <TOKEN>
Body Params application/json
messages
array [object {2}] 
required
content
string 
required
role
string 
required
model
string 
required
frequency_penalty
integer 
required
max_tokens
integer 
required
presence_penalty
integer 
required
response_format
object 
required
type
string 
required
stop
null 
required
stream
boolean 
required
stream_options
null 
required
temperature
integer 
required
top_p
integer 
required
tools
null 
required
tool_choice
string 
required
logprobs
boolean 
required
top_logprobs
null 
required
Examples

Responses

🟢200Success
application/json
OK、 chat completion objectに戻ります
Body
id
string 
required
choices
array [object {4}] 
required
finish_reason
string 
optional
index
integer 
optional
message
object 
optional
logprobs
object 
optional
created
integer 
required
model
string 
required
system_fingerprint
string 
required
object
string 
required
usage
object 
required
completion_tokens
integer 
required
prompt_tokens
integer 
required
prompt_cache_hit_tokens
integer 
required
prompt_cache_miss_tokens
integer 
required
total_tokens
integer 
required
completion_tokens_details
object 
required
🟢200 Success
Previous
導入
Next
FIM完了を作成(ベータ)
Built with