### API Response Structure Source: https://dots.ai/platform/docs Example of a successful chat completion response object returned by the API. ```json "model": "dots3-note-prev", "object": "chat.completion", "system_fingerprint": "", "usage": { "prompt_tokens": 1291, "completion_tokens": 1746, "total_tokens": 3037 } } ``` -------------------------------- ### Audio Transcription API Response Source: https://dots.ai/platform/docs Example response body containing the transcribed text and reasoning process from the model. ```json { "id": "3ea79cea726648b9bb37ed72338e3965", "choices": [ { "index": 0, "finish_reason": "stop", "message": { "role": "assistant", "content": "How old is the Brooklyn Bridge?", "reasoning_content": "Thinking Process:\n\n1. **Analyze the Request:** The user wants a transcription of the audio file. The output must be *only* the transcription text, with no extra analysis, explanation, prefix, or suffix.\n2. **Listen to the Audio:** The audio says \"How old is the Brooklyn Bridge?\"\n3. **Transcribe the Audio:** \"How old is the Brooklyn Bridge?\"\n4. **Format the Output:** Just the transcribed text. \"How old is the Brooklyn Bridge?\"\n" } } ], "created": 1786627279, "model": "dots3-note-prev", "object": "chat.completion", "system_fingerprint": "", "usage": { "prompt_tokens": 55, "completion_tokens": 116, "total_tokens": 171 } } ``` -------------------------------- ### 基础文本对话调用 Source: https://dots.ai/platform/docs 通过 cURL 发送非流式文本请求,系统指令通过顶层 system 参数传入。 ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/messages \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "dots3-note-prev", "system": "你是一个专业、可靠的 AI 助手。", "messages": [ { "role": "user", "content": "你好,请介绍一下自己" } ], "max_tokens": 1024, "stream": false, "thinking": { "type": "disabled" } }' ``` -------------------------------- ### 调用 OpenAI 聊天补全接口 Source: https://dots.ai/platform/docs 使用 curl 发起基础文本对话请求,需在请求头中携带有效的 api-key。 ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "system", "content": "你是一个AI助手" }, { "role": "user", "content": "你好,请介绍一下自己" } ], "stream": false, "max_tokens": 1024, "temperature": 0.9 }' ``` -------------------------------- ### 发送工具调用请求 Source: https://dots.ai/platform/docs 使用 curl 发送包含 tools 定义的 POST 请求,模型将根据描述判断是否调用函数。 ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "波士顿今天天气怎么样?请使用 get_current_weather 工具查询。" } ] } ], "tools": [ { "type": "function", "function": { "name": "get_current_weather", "description": "查询指定地点的当前天气", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "城市名称,例如 Boston" }, "state": { "type": "string", "description": "州名的两个字母缩写,例如 MA" }, "unit": { "type": "string", "description": "温度单位", "enum": ["celsius"] } }, "required": ["city", "state", "unit"] } } } ], "stream": false, "max_tokens": 1024, "temperature": 0.9 }' ``` -------------------------------- ### 启用深度思考的 API 请求 Source: https://dots.ai/platform/docs 通过设置 chat_template_kwargs.enable_thinking 为 true 显式开启深度思考功能。 ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "system", "content": "你是一个AI助手" }, { "role": "user", "content": "你好,请介绍一下自己" } ], "stream": false, "max_tokens": 1024, "temperature": 0.9, "chat_template_kwargs": { "enable_thinking": true } }' ``` -------------------------------- ### 处理工具调用响应 Source: https://dots.ai/platform/docs 当 finish_reason 为 tool_calls 时,从 message.tool_calls 中获取函数名称及参数进行执行。 ```json { "id": "1f79f7638fa145de844a0851a892d01f", "choices": [ { "index": 0, "finish_reason": "tool_calls", "message": { "role": "assistant", "reasoning_content": "用户想查询波士顿的天气。我们需要调用 get_current_weather 工具,传入 city=\"Boston\" 和 state=\"MA\"(马萨诸塞州的缩写)。单位使用摄氏度。\n", "tool_calls": [ { "index": 0, "type": "function", "id": "call_9ef22900ae524ce4a94120a0", "function": { "name": "get_current_weather", "arguments": "{\"city\": \"Boston\", \"state\": \"MA\", \"unit\": \"celsius\"}" } } ] } } ], "created": 1786528610, "model": "dots3-note-prev", "object": "chat.completion", "system_fingerprint": "", "usage": { "prompt_tokens": 246, "completion_tokens": 99, "total_tokens": 345 } } ``` -------------------------------- ### 提交工具执行结果 Source: https://dots.ai/platform/docs 在后续请求中包含完整的对话历史,并将 tool_result 放入消息数组中以获取最终回复。 ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/messages \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "user", "content": "波士顿今天天气怎么样?请使用 get_current_weather 工具查询。" }, { "role": "assistant", "content": [ { "type": "text", "text": "我需要使用 get_current_weather 工具来查询波士顿的天气,但该工具需要提供州(state)参数。波士顿位于马萨诸塞州(Massachusetts),因此我将使用该信息进行查询。" }, { "type": "tool_use", "id": "call_8bf8d5e73316496b9d9181e0", "name": "get_current_weather", "input": { "city": "Boston", "state": "Massachusetts", "unit": "celsius" } } ] }, { "role": "user", "content": [ { "type": "tool_result", "tool_use_id": "call_8bf8d5e73316496b9d9181e0", "content": "当前温度 24°C,晴,湿度 42%" } ] } ], "tools": [ { "name": "get_current_weather", "description": "查询指定地点的当前天气", "input_schema": { "type": "object", "properties": { "city": { "type": "string" }, "state": { "type": "string" }, "unit": { "type": "string", "enum": [ "celsius" ] } }, "required": [ "city", "state", "unit" ] } } ], "thinking": { "type": "disabled" }, "max_tokens": 1024, "stream": false }' ``` -------------------------------- ### 发送工具定义请求 Source: https://dots.ai/platform/docs 通过 POST 请求发送包含工具定义的初始消息,模型将根据输入决定是否调用工具。 ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/messages \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "user", "content": "波士顿今天天气怎么样?请使用 get_current_weather 工具查询。" } ], "tools": [ { "name": "get_current_weather", "description": "查询指定地点的当前天气", "input_schema": { "type": "object", "properties": { "city": { "type": "string" }, "state": { "type": "string" }, "unit": { "type": "string", "enum": [ "celsius" ] } }, "required": [ "city", "state", "unit" ] } } ], "tool_choice": { "type": "auto" }, "max_tokens": 1024, "stream": false, "thinking": { "type": "disabled" } }' ``` -------------------------------- ### 视频输入 API 调用示例 Source: https://dots.ai/platform/docs 通过 API 传入视频 URL 进行分析。注意视频处理的 TTFT 可能较长,建议客户端设置合理的超时时间。 ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "system", "content": [ { "type": "text", "text": "我是你的生活助手。" } ] }, { "role": "user", "content": [ { "type": "image_url", "image_url": { "url": "https://ci.xiaohongshu.com/1040g2sg31stpngqdlm6g5qbe3vodp7j07rja8mg?imageView2/2/w/1080/format/jpg" } }, { "type": "video_url", "video_url": { "url": "https://avtshare01.rz.tu-ilmenau.de/avt-vqdb-uhd-1/test_1/segments/bigbuck_bunny_8bit_200kbps_360p_60.0fps_h264.mp4" } }, { "type": "text", "text": "图片和视频有什么关联?" } ] } ], "stream": false, "max_tokens": 4096, "temperature": 0.9, "chat_template_kwargs": { "enable_thinking": true } }' ``` -------------------------------- ### Configure Deep Thinking via API Request Source: https://dots.ai/platform/docs Use this curl command to send a request with adaptive thinking enabled. Ensure the api-key header is replaced with your actual key. ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/messages \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "user", "content": "请计算 27 × 43,并简要说明计算过程。" } ], "thinking": { "type": "adaptive" }, "output_config": { "effort": "medium" }, "max_tokens": 4096, "stream": false }' ``` -------------------------------- ### 关闭深度思考的 API 请求 Source: https://dots.ai/platform/docs 通过设置 chat_template_kwargs.enable_thinking 为 false 关闭深度思考功能。 ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "system", "content": "你是一个AI助手" }, { "role": "user", "content": "你好,请介绍一下自己" } ], "stream": false, "max_tokens": 1024, "temperature": 0.9, "chat_template_kwargs": { "enable_thinking": false } }' ``` -------------------------------- ### 图片输入调用 Source: https://dots.ai/platform/docs 通过 cURL 发送包含图片 URL 的请求,图片与文本指令在同一内容数组中。 ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/messages \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "user", "content": [ { "type": "image", "source": { "type": "url", "url": "https://picasso-static.xiaohongshu.com/fe-platform/e6d7a4f5dd20a3574caaa72b2b68217bc2e5e2e7.png" } }, { "type": "text", "text": "请用一句话描述这张图片。" } ] } ], "max_tokens": 2048, "stream": false, "thinking": { "type": "disabled" } }' ``` -------------------------------- ### 图片输入 API 调用示例 Source: https://dots.ai/platform/docs 通过 POST 请求发送包含文本和图片 URL 的多模态消息。请确保替换示例中的 API Key 为实际值。 ```bash curl -X POST https://note3-prev-api.askdiandian.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "system", "content": [ { "type": "text", "text": "我是你的生活助手。" } ] }, { "role": "user", "content": [ { "type": "text", "text": "请描述这张图片。" }, { "type": "image_url", "image_url": { "url": "https://picasso-static.xiaohongshu.com/fe-platform/e6d7a4f5dd20a3574caaa72b2b68217bc2e5e2e7.png", "detail": "medium" } } ] } ], "stream": false, "max_tokens": 1024, "temperature": 0.9, "chat_template_kwargs": { "enable_thinking": false } }' ``` -------------------------------- ### 工具调用响应示例 Source: https://dots.ai/platform/docs 模型返回包含 tool_use 块的响应,指示需要执行的工具名称及参数。 ```json { "id": "msg_a61a2da6c80e438897932c37ea3f16a1", "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "我需要使用 get_current_weather 工具来查询波士顿的天气,但该工具需要提供州(state)参数。波士顿位于马萨诸塞州(Massachusetts),因此我将使用该信息进行查询。" }, { "type": "tool_use", "id": "call_8bf8d5e73316496b9d9181e0", "name": "get_current_weather", "input": { "city": "Boston", "state": "Massachusetts", "unit": "celsius" } } ], "model": "dots3-note-prev", "stop_reason": "tool_use", "usage": { "input_tokens": 219, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0 }, "output_tokens": 100 } } ``` -------------------------------- ### POST /v1/chat/completions Source: https://dots.ai/platform/docs 根据输入的消息列表生成模型回复,支持文本、图片、视频、音频输入以及工具调用和深度思考功能。 ```APIDOC ## POST /v1/chat/completions ### Description 根据输入的消息列表生成模型回复。当前 `dots3-note-prev` 的上下文窗口为 512K Token。接口支持文本、图片、视频和音频输入,以及工具调用、深度思考和流式响应。 ### Method POST ### Endpoint https://note3-prev-api.askdiandian.com/v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - 要调用的模型名称,当前示例为 dots3-note-prev。 - **messages** (array) - Required - 按顺序排列的对话消息列表。 - **temperature** (number) - Optional - 控制输出随机性。 - **top_p** (number) - Optional - 控制核采样的候选 Token 范围。 - **stream** (boolean) - Optional - 是否以流式方式返回结果。 - **max_tokens** (integer) - Optional - 本次生成允许使用的最大输出 Token 数。 - **stop** (array) - Optional - 指定一个或多个停止序列。 - **tools** (array) - Optional - 当前请求可供模型选择的工具列表。 - **tool_choice** (string/object) - Optional - 控制模型是否以及如何选择工具。 - **chat_template_kwargs** (object) - Optional - 模型生成行为的可选配置对象。 ### Request Example { "model": "dots3-note-prev", "messages": [ { "role": "system", "content": "你是一个AI助手" }, { "role": "user", "content": "你好,请介绍一下自己" } ], "stream": false, "max_tokens": 1024, "temperature": 0.9 } ### Response #### Success Response (200) - **id** (string) - 响应唯一标识符 - **choices** (array) - 模型生成的回复列表 - **usage** (object) - Token 使用统计信息 #### Response Example { "id": "bb04ce6f700f4b748c5819aa4a5eed8c", "choices": [ { "index": 0, "finish_reason": "stop", "message": { "role": "assistant", "content": "你好!我是 dots...", "reasoning_content": "..." } } ], "usage": { "prompt_tokens": 13, "completion_tokens": 155, "total_tokens": 168 } } ``` -------------------------------- ### 流式响应请求示例 Source: https://dots.ai/platform/docs 使用 curl 发送带有 stream: true 参数的 POST 请求以获取流式响应。 ```bash curl -N -X POST https://note3-prev-api.askdiandian.com/v1/messages \ -H "Content-Type: application/json" \ -H "api-key: YOUR_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "dots3-note-prev", "messages": [ { "role": "user", "content": "用一句话介绍 Dots。" } ], "max_tokens": 256, "stream": true, "thinking": { "type": "disabled" } }' ``` -------------------------------- ### 解析聊天补全响应 Source: https://dots.ai/platform/docs 接口返回的完整 JSON 响应示例,包含模型回复内容及 Token 使用情况。 ```json { "id": "bb04ce6f700f4b748c5819aa4a5eed8c", "choices": [ { "index": 0, "finish_reason": "stop", "message": { "role": "assistant", "content": "你好!我是 dots,中文名叫点点,是小红书 Dots Studio 开发的 AI 大模型。在我们的设计理念里,“点”代表微小的个体。「点」也蕴含了 AI 串联每一个人、连接生活与知识的意味。我可以陪你聊天、帮你分析图片和文件,也能查资料、写代码。希望我能成为你身边自然、可靠又温暖的伙伴。", "reasoning_content": "用户问了一个简单的自我介绍问题。我需要简洁自然地介绍自己—— dots,可以 Mention 我是小红书 Dots Studio 开发的 AI 大模型,名字的含义,以及我存在的定位。不要堆砌背景,保持温暖友好。用户没有指定语言,我会用中文回答。\n" } } ], "created": 1786528606, "model": "dots3-note-prev", "object": "chat.completion", "system_fingerprint": "", "usage": { "prompt_tokens": 13, "completion_tokens": 155, "total_tokens": 168 } } ``` -------------------------------- ### POST /v1/chat/completions Source: https://dots.ai/platform/docs Creates a chat completion response using the dots3-note-prev model, with support for enabling or disabling deep thinking. ```APIDOC ## POST /v1/chat/completions ### Description Sends a message to the AI model to receive a completion. Supports deep thinking configuration via the chat_template_kwargs parameter. ### Method POST ### Endpoint https://note3-prev-api.askdiandian.com/v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The model identifier, e.g., "dots3-note-prev" - **messages** (array) - Required - List of message objects with role and content - **stream** (boolean) - Optional - Whether to stream the response - **max_tokens** (integer) - Optional - Maximum number of tokens to generate - **temperature** (number) - Optional - Sampling temperature - **chat_template_kwargs** (object) - Optional - Configuration object for model generation behavior - **chat_template_kwargs.enable_thinking** (boolean) - Optional - Controls whether to enable deep thinking. Defaults to true. ### Request Example { "model": "dots3-note-prev", "messages": [ {"role": "system", "content": "你是一个AI助手"}, {"role": "user", "content": "你好,请介绍一下自己"} ], "stream": false, "max_tokens": 1024, "temperature": 0.9, "chat_template_kwargs": { "enable_thinking": true } } ### Response #### Success Response (200) - **id** (string) - Unique identifier for the completion - **choices** (array) - List of completion choices - **message** (object) - The assistant's message containing content and reasoning_content - **usage** (object) - Token usage statistics #### Response Example { "id": "5656f21c7eca48cd86e752cf2e79b16b", "choices": [ { "index": 0, "finish_reason": "stop", "message": { "role": "assistant", "content": "你好!我是 dots...", "reasoning_content": "用户问的是自我介绍..." } } ], "model": "dots3-note-prev", "usage": { "prompt_tokens": 13, "completion_tokens": 118, "total_tokens": 131 } } ``` -------------------------------- ### POST /v1/chat/completions Source: https://dots.ai/platform/docs Sends a chat request to the model with support for multimodal content such as audio or video URLs and text instructions. ```APIDOC ## POST /v1/chat/completions ### Description Generates a chat completion response based on the provided messages, which can include text, audio, or video content. ### Method POST ### Endpoint https://note3-prev-api.askdiandian.com/v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The model identifier, e.g., "dots3-note-prev". - **messages** (array) - Required - An array of message objects containing role and content. - **messages[].content** (array) - Required - Multimodal content array (text, audio_url, video_url). - **stream** (boolean) - Optional - Whether to stream the response. - **max_tokens** (integer) - Optional - Maximum number of tokens to generate. - **temperature** (float) - Optional - Sampling temperature. - **chat_template_kwargs** (object) - Optional - Additional configuration, such as `enable_thinking`. ### Request Example { "model": "dots3-note-prev", "messages": [ { "role": "user", "content": [ { "type": "audio_url", "audio_url": { "url": "https://example.com/audio.mp3" } }, { "type": "text", "text": "Please transcribe this." } ] } ], "stream": false, "chat_template_kwargs": { "enable_thinking": true } } ### Response #### Success Response (200) - **id** (string) - Unique identifier for the completion. - **choices** (array) - List of completion choices. - **usage** (object) - Token usage statistics. #### Response Example { "id": "3ea79cea726648b9bb37ed72338e3965", "choices": [ { "message": { "role": "assistant", "content": "How old is the Brooklyn Bridge?" } } ], "usage": { "prompt_tokens": 55, "completion_tokens": 116, "total_tokens": 171 } } ``` -------------------------------- ### 基础文本对话响应 Source: https://dots.ai/platform/docs 上述基础文本请求返回的完整 JSON 响应示例。 ```json { "id": "msg_e6c1458beb264e458d078e0f29ea42dc", "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "你好!我是 dots,由小红书 Dots Studio 开发,是一个 AI 大模型。很高兴认识你,有什么我可以帮你的吗?" } ], "model": "dots3-note-prev", "stop_reason": "end_turn", "usage": { "input_tokens": 24, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0 }, "output_tokens": 32 } } ``` -------------------------------- ### POST /v1/chat/completions Source: https://dots.ai/platform/docs Sends a chat completion request with tool definitions to allow the model to perform function calling. ```APIDOC ## POST /v1/chat/completions ### Description This endpoint allows the model to select and request the execution of defined tools (functions) based on user input. ### Method POST ### Endpoint https://note3-prev-api.askdiandian.com/v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The model identifier. - **messages** (array) - Required - The conversation history. - **tools** (array) - Optional - A list of tools the model may call. - **tool_choice** (string/object) - Optional - Controls tool calling behavior (none, auto, required, or specific function). - **stream** (boolean) - Optional - Whether to stream the response. - **max_tokens** (integer) - Optional - Maximum tokens to generate. - **temperature** (number) - Optional - Sampling temperature. ### Request Example { "model": "dots3-note-prev", "messages": [ { "role": "user", "content": [{"type": "text", "text": "波士顿今天天气怎么样?请使用 get_current_weather 工具查询。"}] } ], "tools": [ { "type": "function", "function": { "name": "get_current_weather", "description": "查询指定地点的当前天气", "parameters": { "type": "object", "properties": { "city": {"type": "string", "description": "城市名称"}, "state": {"type": "string", "description": "州名缩写"}, "unit": {"type": "string", "description": "温度单位"} }, "required": ["city", "state", "unit"] } } } ] } ### Response #### Success Response (200) - **choices** (array) - The list of completion choices, containing tool_calls if triggered. - **usage** (object) - Token usage statistics. #### Response Example { "choices": [ { "finish_reason": "tool_calls", "message": { "tool_calls": [ { "type": "function", "function": { "name": "get_current_weather", "arguments": "{\"city\": \"Boston\", \"state\": \"MA\", \"unit\": \"celsius\"}" } } ] } } ] } ``` -------------------------------- ### SSE 事件响应示例 Source: https://dots.ai/platform/docs 展示了流式接口返回的实际 SSE 事件序列,包括消息开始、内容块增量及结束事件。 ```text event: message_start data: {"type":"message_start","message":{"id":"msg_d51dff47f30340d7b840525d036cba4c","type":"message","role":"assistant","content":[],"model":"dots3-note-prev","usage":{"input_tokens":22,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":0}}} event: content_block_start data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"D","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ots","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" 是由","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"小红书 D","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ots Studio 开发","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"的 AI","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" 大模型,","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"致力于提供","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"自然","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"、智能且贴近","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"生活的","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"对话与多","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"模态交互体验","stop_sequence":null}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"。","stop_sequence":null}} event: content_block_stop data: {"type":"content_block_stop","index":0} event: message_delta data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":0,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":35}} event: message_stop data: {"type":"message_stop"} ``` -------------------------------- ### 深度思考响应示例 Source: https://dots.ai/platform/docs 展示包含 reasoning_content 字段的 API 响应结构。 ```json { "id": "5656f21c7eca48cd86e752cf2e79b16b", "choices": [ { "index": 0, "finish_reason": "stop", "message": { "role": "assistant", "content": "你好!我是 dots,中文名叫点点,是小红书 Dots Studio 开发的 AI 大模型。我可以帮你解答问题、梳理思路、分析图片或文件,也能陪你聊天、一起探讨生活里的各种小事。今天是想聊点什么呢?", "reasoning_content": "用户问的是自我介绍,需要简洁自然地说明我的身份、由谁开发、能做什么,同时保持友好和有温度的语气。不需要列一大串功能清单,重点突出核心能力和陪伴感。最后可以自然地反问一句,让对话活起来。\n" } } ], "created": 1786528611, "model": "dots3-note-prev", "object": "chat.completion", "system_fingerprint": "", "usage": { "prompt_tokens": 13, "completion_tokens": 118, "total_tokens": 131 } } ``` -------------------------------- ### POST /v1/messages Source: https://dots.ai/platform/docs Sends a message to the model with tool definitions to initiate a tool call or provide tool results. ```APIDOC ## POST /v1/messages ### Description Sends a request to the model. When tools are provided, the model may return a `tool_use` block. After executing the tool, the caller sends a `tool_result` back to the model to receive the final answer. ### Method POST ### Endpoint https://note3-prev-api.askdiandian.com/v1/messages ### Request Body - **model** (string) - Required - The model identifier (e.g., "dots3-note-prev") - **messages** (array) - Required - The conversation history including user and assistant roles - **tools** (array) - Optional - Definitions of tools available to the model - **tool_choice** (object) - Optional - Configuration for tool selection behavior - **max_tokens** (integer) - Optional - Maximum tokens for the response - **stream** (boolean) - Optional - Whether to stream the response ### Request Example { "model": "dots3-note-prev", "messages": [ { "role": "user", "content": "波士顿今天天气怎么样?请使用 get_current_weather 工具查询。" } ], "tools": [ { "name": "get_current_weather", "description": "查询指定地点的当前天气", "input_schema": { "type": "object", "properties": { "city": { "type": "string" }, "state": { "type": "string" }, "unit": { "type": "string", "enum": ["celsius"] } }, "required": ["city", "state", "unit"] } } ] } ### Response #### Success Response (200) - **id** (string) - Unique message identifier - **content** (array) - List of content blocks (text or tool_use) - **stop_reason** (string) - Reason for stopping (e.g., "tool_use" or "end_turn") #### Response Example { "id": "msg_a61a2da6c80e438897932c37ea3f16a1", "type": "message", "role": "assistant", "content": [ { "type": "tool_use", "id": "call_8bf8d5e73316496b9d9181e0", "name": "get_current_weather", "input": { "city": "Boston", "state": "Massachusetts", "unit": "celsius" } } ], "stop_reason": "tool_use" } ``` -------------------------------- ### POST /v1/messages Source: https://dots.ai/platform/docs Sends a message to the model with optional tool definitions and deep thinking configuration. ```APIDOC ## POST /v1/messages ### Description Sends a message to the model. Supports tool definitions for function calling and deep thinking configurations for reasoning tasks. ### Method POST ### Endpoint https://note3-prev-api.askdiandian.com/v1/messages ### Request Body - **model** (string) - Required - The model identifier (e.g., "dots3-note-prev"). - **messages** (array) - Required - List of message objects. - **thinking** (object) - Optional - Configuration for deep thinking (e.g., {"type": "adaptive"}). - **output_config** (object) - Optional - Configuration for output effort (e.g., {"effort": "medium"}). - **max_tokens** (integer) - Optional - Maximum number of tokens to generate. - **stream** (boolean) - Optional - Whether to stream the response. - **tools** (array) - Optional - List of tool definitions. - **name** (string) - Required - Tool name. - **description** (string) - Optional - Tool purpose. - **input_schema** (object) - Required - JSON Schema for tool input. ### Request Example { "model": "dots3-note-prev", "messages": [ { "role": "user", "content": "请计算 27 × 43,并简要说明计算过程。" } ], "thinking": { "type": "adaptive" }, "output_config": { "effort": "medium" }, "max_tokens": 4096, "stream": false } ### Response #### Success Response (200) - **id** (string) - Unique message identifier. - **type** (string) - Response type. - **role** (string) - Role of the sender. - **content** (array) - List of content blocks (thinking or text). - **model** (string) - Model used. - **usage** (object) - Token usage statistics. #### Response Example { "id": "msg_4352cea7df6a42859f37129b8b2fcafd", "type": "message", "role": "assistant", "content": [ { "type": "thinking", "thinking": "计算 27 × 43 可以拆成 (20 + 7) × (40 + 3)..." }, { "type": "text", "text": "27 × 43 = 1161。" } ], "model": "dots3-note-prev", "usage": { "input_tokens": 27, "output_tokens": 228 } } ``` -------------------------------- ### 获取基础 URL Source: https://dots.ai/platform/docs Dots API 的基础访问地址。 ```text https://note3-prev-api.askdiandian.com ```