curl --request POST \
--url https://api.senseaudio.cn/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "senseaudio-s2",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "你好,Claude!请简要介绍一下你自己。"
}
],
"temperature": 1,
"stream": false
}
'import requests
url = "https://api.senseaudio.cn/v1/messages"
payload = {
"model": "senseaudio-s2",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "你好,Claude!请简要介绍一下你自己。"
}
],
"temperature": 1,
"stream": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'senseaudio-s2',
max_tokens: 1024,
messages: [{role: 'user', content: '你好,Claude!请简要介绍一下你自己。'}],
temperature: 1,
stream: false
})
};
fetch('https://api.senseaudio.cn/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.senseaudio.cn/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'senseaudio-s2',
'max_tokens' => 1024,
'messages' => [
[
'role' => 'user',
'content' => '你好,Claude!请简要介绍一下你自己。'
]
],
'temperature' => 1,
'stream' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.senseaudio.cn/v1/messages"
payload := strings.NewReader("{\n \"model\": \"senseaudio-s2\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"你好,Claude!请简要介绍一下你自己。\"\n }\n ],\n \"temperature\": 1,\n \"stream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.senseaudio.cn/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"senseaudio-s2\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"你好,Claude!请简要介绍一下你自己。\"\n }\n ],\n \"temperature\": 1,\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.senseaudio.cn/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"senseaudio-s2\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"你好,Claude!请简要介绍一下你自己。\"\n }\n ],\n \"temperature\": 1,\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_01ABCDxyz0123456789",
"content": [
{
"citations": [
{
"cited_text": "<string>",
"document_index": 123,
"document_title": "<string>",
"end_char_index": 123,
"file_id": "<string>",
"start_char_index": 123,
"type": "char_location"
}
],
"text": "<string>",
"type": "text"
}
],
"model": "senseaudio-s2",
"role": "assistant",
"type": "message",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation": {
"ephemeral_1h_input_tokens": 123,
"ephemeral_5m_input_tokens": 123
},
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"inference_geo": "<string>",
"iterations": [
{
"cache_creation": {
"ephemeral_1h_input_tokens": 123,
"ephemeral_5m_input_tokens": 123
},
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"type": "message"
}
],
"server_tool_use": {
"web_fetch_requests": 123,
"web_search_requests": 123
},
"service_tier": "standard",
"speed": "standard"
},
"container": {
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"skills": [
{
"skill_id": "<string>",
"type": "anthropic",
"version": "<string>"
}
]
},
"context_management": {
"applied_edits": [
{
"cleared_input_tokens": 123,
"cleared_tool_uses": 123,
"type": "clear_tool_uses_20250919"
}
]
},
"stop_details": {
"category": "cyber",
"explanation": "<string>",
"type": "refusal"
},
"stop_reason": "end_turn",
"stop_sequence": "\n\nHuman:"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid API key."
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid API key."
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid API key."
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid API key."
}
}消息 (Messages)
发送结构化的输入消息列表(支持文本和/或图片内容),模型将在会话中生成下一条消息。
curl --request POST \
--url https://api.senseaudio.cn/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "senseaudio-s2",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "你好,Claude!请简要介绍一下你自己。"
}
],
"temperature": 1,
"stream": false
}
'import requests
url = "https://api.senseaudio.cn/v1/messages"
payload = {
"model": "senseaudio-s2",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "你好,Claude!请简要介绍一下你自己。"
}
],
"temperature": 1,
"stream": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'senseaudio-s2',
max_tokens: 1024,
messages: [{role: 'user', content: '你好,Claude!请简要介绍一下你自己。'}],
temperature: 1,
stream: false
})
};
fetch('https://api.senseaudio.cn/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.senseaudio.cn/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'senseaudio-s2',
'max_tokens' => 1024,
'messages' => [
[
'role' => 'user',
'content' => '你好,Claude!请简要介绍一下你自己。'
]
],
'temperature' => 1,
'stream' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.senseaudio.cn/v1/messages"
payload := strings.NewReader("{\n \"model\": \"senseaudio-s2\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"你好,Claude!请简要介绍一下你自己。\"\n }\n ],\n \"temperature\": 1,\n \"stream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.senseaudio.cn/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"senseaudio-s2\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"你好,Claude!请简要介绍一下你自己。\"\n }\n ],\n \"temperature\": 1,\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.senseaudio.cn/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"senseaudio-s2\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"你好,Claude!请简要介绍一下你自己。\"\n }\n ],\n \"temperature\": 1,\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_01ABCDxyz0123456789",
"content": [
{
"citations": [
{
"cited_text": "<string>",
"document_index": 123,
"document_title": "<string>",
"end_char_index": 123,
"file_id": "<string>",
"start_char_index": 123,
"type": "char_location"
}
],
"text": "<string>",
"type": "text"
}
],
"model": "senseaudio-s2",
"role": "assistant",
"type": "message",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation": {
"ephemeral_1h_input_tokens": 123,
"ephemeral_5m_input_tokens": 123
},
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"inference_geo": "<string>",
"iterations": [
{
"cache_creation": {
"ephemeral_1h_input_tokens": 123,
"ephemeral_5m_input_tokens": 123
},
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"type": "message"
}
],
"server_tool_use": {
"web_fetch_requests": 123,
"web_search_requests": 123
},
"service_tier": "standard",
"speed": "standard"
},
"container": {
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"skills": [
{
"skill_id": "<string>",
"type": "anthropic",
"version": "<string>"
}
]
},
"context_management": {
"applied_edits": [
{
"cleared_input_tokens": 123,
"cleared_tool_uses": 123,
"type": "clear_tool_uses_20250919"
}
]
},
"stop_details": {
"category": "cyber",
"explanation": "<string>",
"type": "refusal"
},
"stop_reason": "end_turn",
"stop_sequence": "\n\nHuman:"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid API key."
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid API key."
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid API key."
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid API key."
}
}授权
格式:Bearer <API_KEY>
请求体
生成的最大 token 数,达到该值后模型将停止生成。
1024
输入消息列表。单次请求最多包含 100,000 条消息。
100000Show child attributes
Show child attributes
用于补全你提示词的模型。
senseaudio-s2, senseaudio-s2-flash, senseaudio-s2-lite, deepseek-v4.1-flash, deepseek-v4-flash-0731, glm-5.3-flash, qwen3.8-27b "senseaudio-s2"
顶层缓存控制;将自动在请求中最后一个可缓存的内容块上添加 cache_control 标记。
Show child attributes
Show child attributes
容器标识符,用于跨请求复用。
Show child attributes
Show child attributes
上下文管理配置。控制 Claude 在多次请求之间如何管理上下文。
Show child attributes
Show child attributes
指定推理处理的地理区域。
"us"
本次请求中使用的 MCP 服务器
Show child attributes
Show child attributes
描述请求相关的元数据对象。
Show child attributes
Show child attributes
模型输出配置选项,例如输出格式等。
Show child attributes
Show child attributes
已废弃:请改用 output_config.format。
Show child attributes
Show child attributes
是否优先使用优先容量(可用时),或仅使用标准容量。
auto, standard_only "auto"
推理速度模式。'fast' 模式启用每秒更高输出 token 数的推理。
standard, fast "standard"
自定义停止文本序列,模型在生成到这些序列时会停止。
是否通过 Server-Sent Events (SSE) 以增量方式流式返回响应。
false
系统提示词(System Prompt)。
"你是一个严谨且乐于助人的人工智能助手。"
响应的随机性强度。默认值为 1.0。
0 <= x <= 11
启用思考模式的配置。
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
由模型自行决定是否使用工具。
- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
模型可以使用的工具定义列表。
用户自定义工具定义。
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
- Option 19
- Option 20
- Option 21
- Option 22
- Option 23
Show child attributes
Show child attributes
仅从每个后续 token 的 top-K 个候选中采样。
5
使用核采样(nucleus sampling)。
0.9
用于归属本次请求的用户配置 ID。
"user-profile-123"
响应
成功响应:非流式模式返回完整消息,流式模式(stream=true)返回 Server-Sent Events 事件流。
模型生成的消息响应对象。
唯一对象标识符。
"msg_01ABCDxyz0123456789"
响应内容块列表。
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
Show child attributes
Show child attributes
用于补全你提示词的模型。
senseaudio-s2, senseaudio-s2-flash, senseaudio-s2-lite, deepseek-v4.1-flash, deepseek-v4-flash-0731, glm-5.3-flash, qwen3.8-27b "senseaudio-s2"
消息角色,响应固定为 assistant。
assistant "assistant"
对象类型,固定为 message。
message "message"
Billing and rate-limit usage.
Show child attributes
Show child attributes
Information about the container used in the request (for the code execution tool)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
end_turn, max_tokens, stop_sequence, tool_use, pause_turn, compaction, refusal, model_context_window_exceeded 触发停止生成的自定义停止序列(若命中)。
"\n\nHuman:"