diff --git a/content/.metadata.json b/content/.metadata.json index da2c051..1089e9a 100644 --- a/content/.metadata.json +++ b/content/.metadata.json @@ -356,7 +356,7 @@ }, "content/zh-cn/news/news250120.md": { "url": "https://api-docs.deepseek.com/zh-cn/news/news250120", - "title": "DeepSeek-R1 发布,性能对标 OpenAI o1 正式版" + "error": "served fallback shell for https://api-docs.deepseek.com/zh-cn/news/news250120 (canonical: https://api-docs.deepseek.com/)" }, "content/zh-cn/news/news0725.md": { "url": "https://api-docs.deepseek.com/zh-cn/news/news0725", @@ -1027,6 +1027,6 @@ "title": "Agent Teams" } }, - "updated": "2026-08-26", + "updated": "2026-08-27", "site": "https://api-docs.deepseek.com" } \ No newline at end of file diff --git a/content/en/api/create-chat-completion.md b/content/en/api/create-chat-completion.md index 99fa59e..d1ba460 100644 --- a/content/en/api/create-chat-completion.md +++ b/content/en/api/create-chat-completion.md @@ -2,7 +2,7 @@ title: "Chat Completions API" description: "Creates a model response for the given chat conversation." source: https://api-docs.deepseek.com/api/create-chat-completion -fetched: 2026-08-23 +fetched: 2026-08-27 --- # Chat Completions API @@ -260,7 +260,9 @@ Options for streaming response. Only set this when you set `stream: true`. **include\_usage** boolean -If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. +If set to `true`, all chunks in the stream will include a `usage` field, whose value is `null` on every chunk except the last one. If omitted or set to `false`, the `usage` field is absent from all chunks except the last one. + +Either way, the last chunk before the `data: [DONE]` message carries the token usage statistics for the entire request in its `usage` field. Note that no separate usage-only chunk is emitted: the statistics ride on the last content chunk, whose `choices` array always contains exactly one element that carries no new content and a non-null `finish_reason`. **temperature** numbernullable diff --git a/content/en/api/create-completion.md b/content/en/api/create-completion.md index 9fae84c..fc3b852 100644 --- a/content/en/api/create-completion.md +++ b/content/en/api/create-completion.md @@ -2,7 +2,7 @@ title: "FIM Completion API (Beta)" description: "FIM (Fill In the Middle) Completion API.
User must set `base_url='https://api.deepseek.com/beta'` to use this feature." source: https://api-docs.deepseek.com/api/create-completion -fetched: 2026-08-02 +fetched: 2026-08-27 --- # FIM Completion API (Beta) @@ -79,7 +79,9 @@ Options for streaming response. Only set this when you set `stream: true`. **include\_usage** boolean -If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. +If set to `true`, all chunks in the stream will include a `usage` field, whose value is `null` on every chunk except the last one. If omitted or set to `false`, the `usage` field is absent from all chunks except the last one. + +Either way, the last chunk before the `data: [DONE]` message carries the token usage statistics for the entire request in its `usage` field. Note that no separate usage-only chunk is emitted: the statistics ride on the last content chunk, whose `choices` array always contains exactly one element that carries no new content and a non-null `finish_reason`. **suffix** stringnullable diff --git a/content/zh-cn/api/create-chat-completion.md b/content/zh-cn/api/create-chat-completion.md index 7b1bea5..f438355 100644 --- a/content/zh-cn/api/create-chat-completion.md +++ b/content/zh-cn/api/create-chat-completion.md @@ -2,7 +2,7 @@ title: "Chat Completions API" description: "根据输入的上下文,来让模型补全对话内容。" source: https://api-docs.deepseek.com/zh-cn/api/create-chat-completion -fetched: 2026-08-23 +fetched: 2026-08-27 --- # Chat Completions API @@ -258,7 +258,9 @@ string **include\_usage** boolean -如果设置为 true,在流式消息最后的 `data: [DONE]` 之前将会传输一个额外的块。此块上的 usage 字段显示整个请求的 token 使用统计信息,而 choices 字段将始终是一个空数组。所有其他块也将包含一个 usage 字段,但其值为 null。 +如果设置为 `true`,流式返回的所有块都会包含 `usage` 字段,其中除最后一个块外,该字段的值均为 `null`。如果不设置或设置为 `false`,则除最后一个块外,其余块都不含 `usage` 字段。 + +无论是否设置,`data: [DONE]` 之前的最后一个块都会在其 `usage` 字段中给出整个请求的 token 使用统计信息。请注意,这里不会单独下发一个只含 usage 的块:统计信息附加在最后一个内容块上,该块的 `choices` 数组始终只包含一个元素,其中不含新增内容且 `finish_reason` 非 null。 **temperature** numbernullable diff --git a/content/zh-cn/api/create-completion.md b/content/zh-cn/api/create-completion.md index fe20b7f..dbf5fe8 100644 --- a/content/zh-cn/api/create-completion.md +++ b/content/zh-cn/api/create-completion.md @@ -2,7 +2,7 @@ title: "FIM 补全 API(Beta)" description: "FIM (Fill In the Middle) 补全 API。
用户需要设置 `base_url='https://api.deepseek.com/beta'` 来使用此功能。" source: https://api-docs.deepseek.com/zh-cn/api/create-completion -fetched: 2026-08-23 +fetched: 2026-08-27 --- # FIM 补全 API(Beta) @@ -79,7 +79,9 @@ string **include\_usage** boolean -如果设置为 true,在流式消息最后的 `data: [DONE]` 之前将会传输一个额外的块。此块上的 usage 字段显示整个请求的 token 使用统计信息,而 choices 字段将始终是一个空数组。所有其他块也将包含一个 usage 字段,但其值为 null。 +如果设置为 `true`,流式返回的所有块都会包含 `usage` 字段,其中除最后一个块外,该字段的值均为 `null`。如果不设置或设置为 `false`,则除最后一个块外,其余块都不含 `usage` 字段。 + +无论是否设置,`data: [DONE]` 之前的最后一个块都会在其 `usage` 字段中给出整个请求的 token 使用统计信息。请注意,这里不会单独下发一个只含 usage 的块:统计信息附加在最后一个内容块上,该块的 `choices` 数组始终只包含一个元素,其中不含新增内容且 `finish_reason` 非 null。 **suffix** stringnullable diff --git a/llms-full.txt b/llms-full.txt index 41f4155..41314e9 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -7,7 +7,7 @@ title: "Chat Completions API" description: "Creates a model response for the given chat conversation." source: https://api-docs.deepseek.com/api/create-chat-completion -fetched: 2026-08-23 +fetched: 2026-08-27 --- # Chat Completions API @@ -265,7 +265,9 @@ Options for streaming response. Only set this when you set `stream: true`. **include\_usage** boolean -If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. +If set to `true`, all chunks in the stream will include a `usage` field, whose value is `null` on every chunk except the last one. If omitted or set to `false`, the `usage` field is absent from all chunks except the last one. + +Either way, the last chunk before the `data: [DONE]` message carries the token usage statistics for the entire request in its `usage` field. Note that no separate usage-only chunk is emitted: the statistics ride on the last content chunk, whose `choices` array always contains exactly one element that carries no new content and a non-null `finish_reason`. **temperature** numbernullable @@ -990,7 +992,7 @@ Loading... title: "FIM Completion API (Beta)" description: "FIM (Fill In the Middle) Completion API.
User must set `base_url='https://api.deepseek.com/beta'` to use this feature." source: https://api-docs.deepseek.com/api/create-completion -fetched: 2026-08-02 +fetched: 2026-08-27 --- # FIM Completion API (Beta) @@ -1067,7 +1069,9 @@ Options for streaming response. Only set this when you set `stream: true`. **include\_usage** boolean -If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. +If set to `true`, all chunks in the stream will include a `usage` field, whose value is `null` on every chunk except the last one. If omitted or set to `false`, the `usage` field is absent from all chunks except the last one. + +Either way, the last chunk before the `data: [DONE]` message carries the token usage statistics for the entire request in its `usage` field. Note that no separate usage-only chunk is emitted: the statistics ride on the last content chunk, whose `choices` array always contains exactly one element that carries no new content and a non-null `finish_reason`. **suffix** stringnullable