API使用
Chat completions
请求说明
- 基本信息
请求地址:https://www.sophnet.com/api/open-apis/v1/chat/completions
请求方式:POST
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
- Body参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
messages | array(message) | 是 | 聊天上下文信息。支持Qwen VL系列模型。 纯文本示例:messages=[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Knock knock."},{"role": "assistant", "content": "Who's there?"},{"role": "user", "content": "Orange."},] 多模态示例:{"messages":[{"role":"user","content":[{"type":"text","text":"describe the image in 100 words or less"},{"type":"image_url","image_url":{"url":"xxx","detail":"high"}}]}]}} |
model | string | 是 | 模型 |
tools | array | 否 | 工具列表,只支持function,支持的模型有DeepSeek-R1,DeepSeek-v3 |
stream | bool | 否 | 是否以流式接口的形式返回数据,默认false |
max_tokens | integer | 否 | 模型回复最大长度(单位 token) |
temperature | number | 否 | 较高的数值会使输出更加随机,而较低的数值会使其更加集中。默认值1.0,取值范围[0,2.0]。支持的模型有DeepSeek-Prover-V2, DeepSeek-V3-Fast, DeepSeek-V3, Qwen全系列 |
top_p | number | 否 | 影响输出文本的多样性,取值越大,生成文本的多样性越强。默认值1.0。支持的模型有DeepSeek-Prover-V2, DeepSeek-V3-Fast, DeepSeek-v3, Qwen全系列 |
stop | array(string) | 否 | 停止生成更多Tokens的最多4个字符串。支持的模型有DeepSeek-Prover-V2, DeepSeek-V3-Fast, DeepSeek-v3, Qwen全系列 |
presence_penalty | number | 否 | 通过对已生成的token增加惩罚,减少重复生成的现象。默认值0,取值范围:[-2.0, 2.0]。支持的模型有DeepSeek-Prover-V2, DeepSeek-V3-Fast, DeepSeek-v3, Qwen全系列 |
frequency_penalty | number | 否 | 根据新词在当前文本中的频率进行惩罚,降低模型逐字重复同一行的可能性。 默认值0,取值范围:[-2.0, 2.0]。支持的模型有DeepSeek-Prover-V2, DeepSeek-V3-Fast, DeepSeek-v3 |
logprobs | boolean | 否 | 默认值false。是否返回输出 tokens 的对数概率。支持的模型有DeepSeek-Prover-V2, DeepSeek-V3-Fast, DeepSeek-v3 |
top_logprobs | integer | 否 | 默认值0,取值范围为 [0, 20]。指定每个输出 token 位置最有可能返回的 token 数量,每个 token 都有关联的对数概率。仅当 logprobs为true 时可以设置 top_logprobs 参数。支持的模型有DeepSeek-Prover-V2, DeepSeek-V3-Fast, DeepSeek-v3 |
response_format | object | 否 | 指定模型必须输出的格式的对象。 默认值: { "type": "text" } 设置为 { "type": "json_object" } 可启用 JSON 模式,这保证模型生成的消息是有效的 JSON。 重要:使用 JSON 模式时,您还必须通过系统或用户消息提示模型自行生成JSON。支持的模型有DeepSeek-R1-0528,DeepSeek-v3 |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | 流式:text/event-stream非流式:application/json |
- 响应体参数
a.非流式
名称 | 类型 | 描述 |
---|---|---|
object | string | 回包类型 chat.completion.chunk:多轮对话返回 |
created | int | 时间戳 |
model | string | 模型 示例值:Qwen/Qwen2.5-72B-Instruct |
choices | array | |
choices[0].index | int | 索引 |
choices[0].finish_reason | string | 结束原因 正常结束:stop,token超长截断结束:length |
choices[0].message | object | 模型回答 |
choices[0].message.tool_calls | array | 工具列表 |
choices[0].message.tool_calls[0].function | object | 函数调用信息 |
choices[0].refs | array | 引用列表,调用自定义模型且模型输出包含文档引用时存在。在非流式调用中,会在最终结果内输出此次回答包含的所有引用来源信息。 |
choices[0].refs[0].index | int | 引用来源出现顺序 |
choices[0].refs[0].title | string | 引用数据标题 |
choices[0].refs[0].content | string | 引用数据内容 |
choices[0].refs[0].type | string | 引用数据类型,file/qa/web, 分别代表文件知识, Q&A Table和web搜索 |
choices[0].refs[0].url | string | 引用数据url,其中,file和qa数据url访问需配置apikey,web数据url访问无需配置apikey |
b.流式
名称 | 类型 | 描述 |
---|---|---|
object | string | 回包类型 chat.completion.chunk:多轮对话返回 |
created | int | 时间戳 |
model | string | 模型 示例值:Qwen/Qwen2.5-72B-Instruct |
choices | array | |
choices[0].index | int | 索引 |
choices[0].finish_reason | string | 结束原因 正常结束:stop,token超长截断结束:length |
choices[0].delta | object | 模型回答 |
choices[0].refs | array | 引用列表,调用自定义模型且模型输出包含文档引用时存在。在流式响应过程中,会实时于存在引用的位置输出引用来源信息,并在finish_reason不为空时输出此次回答包含的所有引用来源信息。 |
choices[0].refs[0].index | int | 引用来源出现顺序 |
choices[0].refs[0].title | string | 引用数据标题 |
choices[0].refs[0].content | string | 引用数据内容 |
choices[0].refs[0].type | string | 引用数据类型,file/qa/web, 分别代表文件知识, Q&A Table和web搜索 |
choices[0].refs[0].url | string | 引用数据url,其中,file和qa数据url访问需配置apikey,web数据url访问无需配置apikey |
请求示例
示例如下,请将参数示例值替换为实际值。
- 纯文本请求示例
curl --location -g --request POST 'https://www.sophnet.com/api/open-apis/v1/chat/completions' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"messages": [
{
"role": "system",
"content": "你是SophNet的智能助手"
},
{
"role": "user",
"content": "你可以帮我做什么"
}
],
"model":"Qwen2.5-72B-Instruct"
}'
Python SDK
# 支持兼容OpenAI Python SDK 终端运行:pip install OpenAI
from openai import OpenAI
### 初始化客户端
client = OpenAI(
api_key= "API_KEY",
base_url= "https://www.sophnet.com/api/open-apis/v1"
)
### 调用接口
response = client.chat.completions.create(
model="Qwen2.5-72B-Instruct",
messages=[
{"role": "system", "content": "你是SophNet智能助手"},
{"role": "user", "content": "你可以帮我做些什么"},
]
)
# 打印结果
print(response.choices[0].message.content)
- Function Call请求示例
HTTP API
curl --location -g --request POST 'https://www.sophnet.com/api/open-apis/v1/chat/completions' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"messages": [
{
"role": "user",
"content": "今日上海天气如何?"
}
],
"model":"DeepSeek-v3",
"tools": [
{
"type": "function",
"function":
{
"name": "get_weather",
"description": "Get current temperature for provided coordinates in celsius.",
"parameters":
{
"type": "object",
"properties":
{
"latitude": {"type": "number"},
"longitude": {"type": "number"}
},
"required": ["latitude", "longitude"],
"additionalProperties": false
},
"strict": true
}
}
]
}'
# 请求成功后,从返回值的choices[0].message.tool_calls[0].function获取到函数调用信息
# 其中function.name是函数名,function.arguments中含有函数参数
# 假设已通过函数调用获取到返回值是20,且获取到choices[0].message.tool_calls[0].id = "call_f0j0i4meawn7kqx335d4fsj1"
# 接下来是第二次请求,其中messages列表的第一个与之前相同,第二个为choices[0].message.tool_calls,第三个的构造信息参考如下
curl --location -g --request POST 'https://www.sophnet.com/api/open-apis/v1/chat/completions' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"messages": [
{
"role": "user",
"content": "今日上海天气如何?"
},
{
"content": "",
"role": "assistant",
"tool_calls": [
{
"id": "call_f0j0i4meawn7kqx335d4fsj1",
"type": "function",
"function":
{
"name": "get_weather",
"arguments": "{\"latitude\":31.2304,\"longitude\":121.4737}"
}
}
]
},
{
"role": "tool",
"tool_call_id": "call_f0j0i4meawn7kqx335d4fsj1",
"content": "20"
}
],
"model":"DeepSeek-v3",
"tools": [
{
"type": "function",
"function":
{
"name": "get_weather",
"description": "Get current temperature for provided coordinates in celsius.",
"parameters":
{
"type": "object",
"properties":
{
"latitude": {"type": "number"},
"longitude": {"type": "number"}
},
"required": ["latitude", "longitude"],
"additionalProperties": false
},
"strict": true
}
}
]
}'
- 多模态请求示例(Qwen VL模型支持多模态参数请求)
HTTP API
curl --location -g --request POST 'https://www.sophnet.com/api/open-apis/projects/v1/chat/completions' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"messages": [{
"role": "user",
"content": [
{
"type": "text",
"text": "describe the image in 100 words or less"
},
{
"type": "image_url",
"image_url": {
"url": "xxx"
}
}
]
}],
"model":"Qwen2.5-VL-72B-Instruct",
"stream":false
}'
Python SDK
# 支持兼容OpenAI Python SDK 终端运行:pip install OpenAI
from openai import OpenAI
### 初始化客户端
client = OpenAI(
api_key= "API_KEY",
base_url= "https://www.sophnet.com/api/open-apis/v1"
)
### 调用接口
response = client.chat.completions.create(
model="Qwen2.5-VL-72B-Instruct",
messages=[
{"role": "system", "content": "你是SophNet智能助手"},
{
"role": "user",
"content": [
{
"type":"text",
"text":"描述一下这张图片"
},
{
"type":"image_url",
"image_url":{"url":xxx}
}]
},
]
)
# 打印结果
print(response.choices[0].message.content)
响应示例
流式 (event-stream)
data:{"object":"chat.completion.chunk","created":1724651635,"model":"Qwen/Qwen2.5-72B-Instruct","choices":[{"index":0,"delta":{"content":"我可以","role":"assistant"},"finish_reason":null}]}
data:{"object":"chat.completion.chunk","created":1724651635,"model":"Qwen/Qwen2.5-72B-Instruct","choices":[{"index":0,"delta":{"content":"提供","role":null},"finish_reason":null}]}
data:{"object":"chat.completion.chunk","created":1724651635,"model":"Qwen/Qwen2.5-72B-Instruct","choices":[{"index":0,"delta":{"content":"智能问答","role":null},"finish_reason":null}]}
data:{"object":"chat.completion.chunk","created":1724651635,"model":"Qwen/Qwen2.5-72B-Instruct","choices":[{"index":0,"delta":{"content":"和帮助。","role":null},"finish_reason":null}]}
data:{"object":"chat.completion.chunk","created":1724651635,"model":"Qwen/Qwen2.5-72B-Instruct","choices":[{"index":0,"delta":{"content":null,"role":null},"finish_reason":"stop"}]}
非流式 (Json)
{
"object": "chat.completion",
"created": 1724652804,
"model": "Qwen/Qwen2.5-72B-Instruct",
"choices": [
{
"index": 0,
"message": {
"content": "作为SophNet智能助手,我可以帮助你完成多种任务。如果你有具体的需求或问题,请告诉我!",
"role": "assistant"
},
"finish_reason": "stop"
}
]
}
Function Call (Json) 首次返回
{
"object":"chat.completion",
"created":1744967746,
"model":"DeepSeek-v3",
"choices":[
{
"index":0,
"message":
{
"content":"",
"role":"assistant",
"tool_calls":[
{
"id":"call_f0j0i4meawn7kqx335d4fsj1",
"type":"function",
"function":
{
"name":"get_weather",
"arguments":"{\"latitude\":31.2304,\"longitude\":121.4737}"
}
}
]
},
"finish_reason":"tool_calls"
}
]
}
第二次返回
{
"object":"chat.completion",
"created":1744967193,
"model":"DeepSeek-v3",
"choices":[
{
"index":0,
"message":
{
"content":"今日上海的天气温度为20°C。",
"role":"assistant"
},
"finish_reason":"stop",
}
]
}
Speech to text
创建Task
请求说明
- 基本信息
请求地址:https://www.sophnet.com/api/open-apis/projects/{ProjectId}/easyllms/speechtotext/transcriptions
请求方式:POST
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
ProjectId | String | 是 | 项目id |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
- Body参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
audio_url | string | 是 | 语音url路径 支持音频格式:wav、mp3、m4a、flv、mp4、wma、3gp、amr、aac、ogg-opus、flac 音频限制:音频 URL 时长不能大于5小时,文件大小不超过1GB 识别有效时间:识别结果在服务端保存24小时 |
easyllm_id | string | 是 | Easyllm ID |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 描述 |
---|---|---|
task_id | string | 任务id |
created | int | 时间戳 |
请求示例
HTTP API
curl --location --request POST 'https://www.sophnet.com/api/open-apis/projects/{projectId}/easyllms/speechtotext/transcriptions' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"audio_url":"YOUR_AUDIO_URL",
"easyllm_id":"YOUR_SERVICE_ID"
}'
响应示例
{
"taskId": "10047816884",
"created": 1724652804
}
查询Task状态、结果
请求说明
- 基本信息
请求地址:https://www.sophnet.com/api/open-apis/projects/{project_id}/easyllms/speechtotext/transcriptions/{taskId}
请求方式:GET
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
project_id | String | 是 | 项目id |
task_id | String | 是 | 语音转文本task_id |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
- Body参数
无
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 描述 |
---|---|---|
task_id | string | 任务id |
status | string | 任务状态,waiting:任务等待,doing:任务执行中,success:任务成功,failed:任务失败。 示例值:waiting |
result | string | 转录结果 |
errorMsg | string | 错误码 |
请求示例
HTTP API
curl --location --request GET 'https://www.sophnet.com/api/open-apis/projects/{projectId}/easyllms/speechtotext/transcriptions/{taskId}' \
--header "Authorization: Bearer $API_KEY" \
响应示例
{
"taskId": "10045132157",
"status": "success",
"result": "[0:5.840,0:6.690,0] 哎,张总。\n[0:7.520,0:8.270,1] 还要打吗?\n[0:8.700,0:8.925,0] 哎。\n[0:8.925,0:12.550,1] 我能听到这给你们发了有3张图。\n"
}
流式Speech to text
连接请求说明
- 基本信息
请求地址:wss://www.sophnet.com/api/open-apis/projects/{ProjectId}/easyllms/stream-speech
请求方式:Websocket
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
ProjectId | String | 是 | 项目id |
- Request参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
easyllm_id | String | 是 | easyllm id |
apikey | String | 是 | Apikey |
format | String | 是 | 输入音频格式,支持pcm、wav、mp3、aac |
sample_rate | int | 是 | 音频采样率,任意音频采样率,但16k效果更好 |
heartbeat | bool | 是 | 是否开启心跳,若为false即使发送静音音频也会在60s后超时关闭连接,若为true,发送静音音频将保持连接 |
音频数据发送请求说明
- 音频数据发送说明:音频bytes数据,可按照3200的数量发送。
关闭连接请求说明
- 关闭连接请求说明:发送一个字符串"BYE"来主动关闭连接。
连接响应说明
- 响应体参数
名称 | 类型 | 描述 |
---|---|---|
status | string | 连接成功返回'ok',失败则直接关闭连接 |
音频识别结果响应说明
- 响应体参数
名称 | 类型 | 描述 |
---|---|---|
text | string | 句子级识别结果,当is_sentence_end为false时,包含流式识别的输出结果,而为true则表示最终句子识别结果,下一个消息将是新的句子 |
begin_time | int | 句子开始的时刻,单位为毫秒 |
end_time | int | 句子结束的时刻,单位为毫秒 |
words | string | 字级别的预测结果 |
is_sentence_end | bool | 表示句子是否结束 |
连接请求示例
Websocket API
const url = `wss://www.sophnet.com/api/open-apis/projects/${ProjectId}/easyllms/stream-speech`
+ `?easyllm_id=${model}`
+ `&apikey=${apikey}`
+ `&format=${format}`
+ `&sample_rate=${sampleRate}`
+ `&heartbeat=true`;
ws = new WebSocket(url);
ws.binaryType = 'arraybuffer';
ws.onopen = () => {
log('WebSocket 已连接: ' + url);
};
ws.onmessage = (evt) => {
if (typeof evt.data === 'string') {
log('<- ASR_RESULT: ' + evt.data);
} else {
log('<- binary message (' + evt.data.byteLength + ' bytes)');
}
};
ws.onerror = (err) => {
log('WebSocket 错误: ' + err);
};
ws.onclose = (evt) => {
log(`WebSocket 已关闭: [${evt.code}] ${evt.reason}`);
};
音频数据发送请求示例
Websocket API
ws.send(byteData);
连接响应示例
{"status": "ok"}
音频识别结果响应示例
{"text":"这是深度神经网络的语音","begin_time":660,"end_time":null,"words": ["Word(beginTime=660, endTime=1148, text=这是, punctuation=, fixed=false)", "Word(beginTime=1148, endTime=1636, text=深度, punctuation=, fixed=false)", "Word(beginTime=1636, endTime=2124, text=神经, punctuation=, fixed=false)", "Word(beginTime=2124, endTime=2612, text=网络的, punctuation=, fixed=false)", "Word(beginTime=2612, endTime=3100, text=语音, punctuation=, fixed=false)"], "is_sentence_end": false}
{"text":"这是深度神经网络的语音识别","begin_time":660,"end_time":null,"words": ["Word(beginTime=660, endTime=1148, text=这是, punctuation=, fixed=false)", "Word(beginTime=1148, endTime=1636, text=深度, punctuation=, fixed=false)", "Word(beginTime=1636, endTime=2124, text=神经, punctuation=, fixed=false)", "Word(beginTime=2124, endTime=2612, text=网络的, punctuation=, fixed=false)", "Word(beginTime=2612, endTime=3100, text=语音, punctuation=, fixed=false)", "Word(beginTime=3100, endTime=3500, text=识别, punctuation=, fixed=false)"], "is_sentence_end": false}
{"text":"这是深度神经网络的语音识别","begin_time":660,"end_time":null,"words": ["Word(beginTime=660, endTime=1148, text=这是, punctuation=, fixed=false)", "Word(beginTime=1148, endTime=1636, text=深度, punctuation=, fixed=false)", "Word(beginTime=1636, endTime=2124, text=神经, punctuation=, fixed=false)", "Word(beginTime=2124, endTime=2612, text=网络的, punctuation=, fixed=false)", "Word(beginTime=2612, endTime=3100, text=语音, punctuation=, fixed=false)", "Word(beginTime=3100, endTime=3588, text=识别, punctuation=, fixed=false)"], "is_sentence_end": false}
{"text":"这是深度神经网络的语音识别模型。","begin_time":660,"end_time":5540,"words": ["Word(beginTime=660, endTime=1148, text=这是, punctuation=, fixed=false)", "Word(beginTime=1148, endTime=1636, text=深度, punctuation=, fixed=false)", "Word(beginTime=1636, endTime=2124, text=神经, punctuation=, fixed=false)", "Word(beginTime=2124, endTime=2612, text=网络的, punctuation=, fixed=false)", "Word(beginTime=2612, endTime=3100, text=语音, punctuation=, fixed=false)", "Word(beginTime=3100, endTime=3588, text=识别, punctuation=, fixed=false)", "Word(beginTime=3588, endTime=4076, text=模型, punctuation=, fixed=false)"], "is_sentence_end": true}
{"text":"请","begin_time":6001,"end_time":null,"words": ["Word(beginTime=6001, endTime=6502, text=请, punctuation=, fixed=false)"], "is_sentence_end": false}
Embeddings
请求说明
- 基本信息
请求地址:https://www.sophnet.com/api/open-apis/projects/{projectId}/easyllms/embeddings
请求方式:POST
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
ProjectId | String | 是 | 项目id |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
- Body参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
input_texts | array(string) | 是 | 数组中每一个元素是一个文本,最大支持10个文本,每个文本最大8192个Tokens |
dimensions | integer | 是 | 输出Embeddings的维度,支持1,024/768/512/256/128/64 |
easyllm_id | string | 是 | Easyllm ID |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 描述 |
---|---|---|
id | string | 任务id |
usage | dict | 模型推理时Token使用情况 |
data | array | 模型推理结果 |
请求示例
HTTP API
curl --location --request POST 'https://www.sophnet.com/api/open-apis/projects/{projectId}/easyllms/embeddings' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"easyllm_id": "{YOUR_EASYLLM_ID}",
"input_texts": ["你好", "很高兴认识你"],
"dimensions": 1024
}'
响应示例
{
"id": "",
"object": "list",
"usage": {
"prompt_tokens": 4,
"completion_tokens": null,
"total_tokens": 4,
"prompt_tokens_details": null,
"completion_tokens_details": null
},
"data": [
{
"embedding": [
-0.08296291530132294,
0.03833295777440071,
...
],
"index": 0,
"object": "embedding"
},
{
"embedding": [
-0.05998880788683891,
0.04025664180517197,
...
],
"index": 1,
"object": "embedding"
}
]
}
Document Parse
请求说明
- 基本信息
功能描述:高效转换主流格式文档至精准、易用的Markdown文本内容。上传文件(form-data),输出文档内容(Markdown)
请求地址:https://www.sophnet.com/api/open-apis/projects/{ProjectId}/easyllms/doc-parse
请求方式:POST
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
ProjectId | String | 是 | 项目id |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
- form-data参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
file | file | 是 | 文档,支持pdf,docx,doc,xlsx,xls,txt,ppt,pptx格式,大小<50MB |
easyllm_id | string | 是 | Easyllm ID |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
data | string | 文档解析结果(Markdown) |
请求示例
HTTP API
curl --location --request POST 'https://www.sophnet.com/api/open-apis/projects/{projectId}/easyllms/doc-parse' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--form 'file=@"YOUR_DOCUMENT"' \
--form 'easyllm_id="YOUR_SERVICE_ID"'
Python SDK
# 使用SDK前需要安装python库 终端运行:pip install fastmodels-kit
from fastmodels import Client
# 初始化客户端
client = Client(
api_key= "YOUR_API_KEY",
project_id= "YOUR_PROJECT_ID"
)
# 调用接口
response = client.easyllm.doc_parse.create(
easyllm_id="YOUR_SERVICE_ID",
file_path="YOUR_FILE_PATH"
)
# 打印输出
print(response.data)
响应示例
{
"data": "文件编号:HR-2023-06-3-1\n\n发布单位:AMT\n\n发布对象:全员\n\n发布日期:2023.11.16\n\n生效日期:2023.11.16\n\n**管理制度**\n\n......"
}
Text to voice
请求说明
- 基本信息
功能描述:文字转语音服务。发送文件,输出语音(默认为mp3格式)。
请求地址:https://www.sophnet.com/api/open-apis/projects/{ProjectId}/easyllms/voice/synthesize-audio-stream
请求方式:POST
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
ProjectId | String | 是 | 项目id |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
- Body参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
text | array(string) | 是 | 需要转语音的字符串列表 |
stream | bool | 否 | 是否使用流式接口,默认值为true |
synthesis_param | object | 是 | 转语音参数 |
synthesis_param.model | string | 是 | 指定模型,默认值为"cosyvoice-v1" |
synthesis_param.voice | string | 否 | 指定音色,默认值为"longxiaochun" |
synthesis_param.format | string | 否 | 指定音频编码格式及采样率,格式为"文件格式_采样率_通道_比特率",例如MP3_16000HZ_MONO_128KBPS 代表音频格式为mp3,采样率为16kHz。若未指定format,系统将根据voice参数自动选择该音色的推荐格式。 |
synthesis_param.volume | number | 否 | 指定音量,默认值为50,取值范围:[0-100] |
synthesis_param.speechRate | number | 否 | 指定语速,默认值为1,输入范围:[0.5,2] |
synthesis_param.pitchRate | number | 否 | 指定语调,默认值为1,取值范围:[0.5,2] |
easyllm_id | string | 是 | Easyllm ID |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | text/event-stream |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
data | string | base64编码的语音数据 |
请求示例
HTTP API
curl --location --request POST 'https://www.sophnet.com/api/open-apis/projects/{projectId}/easyllms/voice/synthesize-audio-stream' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"easyllm_id": "YOUR_SERVICE_ID",
"text": ["这是要合成的文本", "第二段文本"],
"synthesis_param": {
"model": "cosyvoice-v1",
"voice": "longxiaochun",
"format": "WAV_16000HZ_MONO_16BIT",
"volume": 80,
"speechRate": 1.2,
"pitchRate": 1.0
}
}'
Python requests
- NOTE: 这里演示如何输出为音频文件
import requests
import json
import base64
projectId = "YOUR_PROJECT_ID"
easyllmId = "YOUR_EASYLLM_SERVICE_ID"
API_KEY = "YOUR_API_KEY"
url = f"https://www.sophnet.com/api/open-apis/projects/{projectId}/easyllms/voice/synthesize-audio-stream"
payload = json.dumps({
"easyllm_id": easyllmId,
"text": [
"测试",
],
"synthesis_param": {
"model": "cosyvoice-v1",
"voice": "longxiaochun",
"format": "WAV_16000HZ_MONO_16BIT",
"volume": 80,
"speechRate": 1.2,
"pitchRate": 1
}
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + API_KEY,
}
response = requests.request("POST", url, headers=headers, data=payload)
for chunk in response.iter_lines(decode_unicode=True):
with open("output.mp3","ab") as f:
if chunk:
if (frame:=json.loads(chunk[5:])["audioFrame"]):
f.write(base64.b64decode(frame))
响应示例
{'status': 'accepting', 'usage': None, 'audioFrame': '{BASE64 encoded data}'}
Image OCR
请求说明
- 基本信息
功能描述:图片OCR服务。发送图片,输出图片中的文本信息。
请求地址:https://www.sophnet.com/api/open-apis/projects/{ProjectId}/easyllms/image-ocr
请求方式:POST
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
ProjectId | String | 是 | 项目id |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
- Body参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
type | string | 是 | 图片类型,固定为"image_url" |
image_url | object | 是 | 图片参数 |
image_url.url | string | 是 | 图片,可以是base64图片,固定格式为"data:image/jpeg;base64,{base64_data}";也可以是图片url链接 |
use_doc_ori | int | 是 | 是否使用文档方向分类,1表示使用,0表示不使用 |
use_table | int | 是 | 是否使用表格识别,1表示使用,0表示不使用;此项为1时use_html_out必须为1 |
use_html_out | int | 是 | 是否使用html输出,1表示使用,0表示不使用;使用表格识别时,此项必须为1 |
easyllm_id | string | 是 | Easyllm ID |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
status | int | 0表示成功,其他值表示失败 |
message | string | 调用成功返回请求成功,否则返回错误信息 |
result | array(object) | 返回的结果,有一个个的段落组成,如果是use_html_out我1,则list的长度为1,有每个段落包含以下字段 |
result[0].label | string | 段落的类型,可以是text,table,html等 |
result[0].texts | string | 段落的文本 |
result[0].position | array(int) | 段落的位置,格式为left,top,right,bottom |
请求示例
HTTP API
curl --location --request POST 'https://www.sophnet.com/api/open-apis/projects/{projectId}/easyllms/image-ocr' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"easyllm_id": "YOUR_SERVICE_ID",
"type":"image_url",
"image_url": {
"url": "data:image/jpeg;base64,/9j/..."
},
"use_doc_ori": 1,
"use_table":1,
"use_html_out":1
}'
响应示例
{
"status":0,
"message":"请求成功",
"result": [
{
"label": "text",
"texts": "测试",
"position": "0,0,720,1920"
}
]
}
Chat completions + Text to voice
请求说明
- 基本信息
请求地址:https://www.sophnet.com/api/open-apis/v1/chat/completions-with-voice-output
请求方式:POST
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
- Body参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
chat_completion_req | dict | 是 | 包含Chat completions的参数 |
speech_synthesis_req | dict | 是 | 包含Text to voice的部分参数 |
chat_completion_req参数:参考Chat completions章节,仅支持流式
speech_synthesis_req参数:仅支持流式
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
synthesis_param | dict | 否 | 转语音参数 |
synthesis_param.model | string | 否 | 指定模型,默认值为"cosyvoice-v1" |
synthesis_param.voice | string | 否 | 指定音色,默认值为"longxiaochun",支持longwan/longcheng/longhua/longxiaochun/longxiaoxia/longxiaocheng/longxiaobai/longlaotie/longshu/longshuo/longjing/longyue/loongstella/loongbella |
synthesis_param.format | string | 否 | 指定音频编码格式及采样率,格式为"文件格式_采样率_通道_比特率",例如MP3_16000HZ_MONO_128KBPS 代表音频格式为mp3,采样率为16kHz。若未指定format,系统将根据voice参数自动选择该音色的推荐格式。 |
synthesisParam.volume | number | 否 | 指定音量,默认值为50,取值范围:[0-100] |
synthesisParam.speechRate | number | 否 | 指定语速,默认值为1,输入范围:[0.5,2] |
synthesisParam.pitchRate | number | 否 | 指定语调,默认值为1,取值范围:[0.5,2] |
easyllm_id | string | 是 | Easyllm ID |
响应说明
基本信息:会返回两类消息,分别是Chat completions响应消息和Text to voice响应消息
Chat completions响应说明:参考Chat completions章节
Text to voice响应说明
名称 | 类型 | 值 |
---|---|---|
audioFrame | string | base64编码的语音数据 |
请求示例
示例如下,请将参数示例值替换为实际值。
- curl请求示例
curl --location --request POST 'https://www.sophnet.com/api/open-apis/v1/chat/completions-with-voice-output' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $API_KEY' \
--data-raw '{
"chat_completion_req": {
"messages": [
{
"role": "user",
"content": "你好"
}
],
"model":"Qwen2.5-32B-Instruct",
"stream": true
},
"speech_synthesis_req": {
"easyllm_id": "${easyllm_id}"
}
}'
响应示例
{"choices": [{"delta": {"content": "", "role": "assistant"},"index": 0}],"created": 1749037853,"id": "chatcmpl-xxx","model": "Qwen2.5-32B-Instruct","object": "chat.completion.chunk"}
{"choices":[{"delta":{"content":"你好"},"index":0}],"created":1749037853,"id":"chatcmpl-xxx","model":"Qwen2.5-32B-Instruct","object":"chat.completion.chunk"}
{"choices":[{"delta":{"content":"!"},"index":0}],"created":1749037853,"id":"chatcmpl-xxx","model":"Qwen2.5-32B-Instruct","object":"chat.completion.chunk"}
{"choices":[{"delta":{"content":"有什么"},"index":0}],"created":1749037853,"id":"chatcmpl-xxx","model":"Qwen2.5-32B-Instruct","object":"chat.completion.chunk"}
{"status":"accepting","usage":null,"audioFrame":"SUQzBAAA..."}
{"choices":[{"delta":{"content":"可以帮助你的吗?"},"index":0}],"created":1749037853,"id":"chatcmpl-xxx","model":"Qwen2.5-32B-Instruct","object":"chat.completion.chunk"}
{"status":"accepting","usage":null,"audioFrame":null}
{"status":"accepting","usage":null,"audioFrame":"//PCxO1..."}
{"choices":[{"delta":{"content":""},"finish_reason":"stop","index":0}],"created":1749037853,"id":"chatcmpl-xxx","model":"Qwen2.5-32B-Instruct","object":"chat.completion.chunk"}
{"status":"accepting","usage":null,"audioFrame":"//PAxPJh..."}
{"status":"finish","usage":{"characters":26},"audioFrame":null}
...
自定义模型-文件知识
上传文件
请求说明
- 基本信息
功能描述:为服务新增文件知识,此接口为自动注入,无需再次注入我的模型
请求地址:https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/files
请求方式:POST
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
serviceId | String | 是 | 服务id |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
- form-data参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
file | file | 是 | 文档,支持pdf,docx,xlsx,txt,pptx格式,大小<30MB |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
status | string | 请求状态码,0为成功 |
message | string | 请求执行状态 |
result | object | 执行结果 |
result.id | string | 文档id |
result.title | string | 文档标题 |
result.snippet | string | 文档内容片段 |
result.status | string | 文档状态,ENABLED为已启用,NOT_ENABLED为未启用 |
请求示例
HTTP API
curl --location --request POST 'https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/files' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--form 'file=@"YOUR_DOCUMENT"' \
--form 'easyllm_id="YOUR_SERVICE_ID"'
响应示例
{
"status": 0,
"message": "请求成功",
"result": {
"id": "4pw0y0Foa0lNubkPUriLkA",
"title": "你的文档标题",
"snippet": "文档内容片段",
"status": "ENABLED",
"createdAt": "2025-03-17T06:21:09.175+00:00"
},
"timestamp": 1742192469480
}
查询服务已绑定文件列表
请求说明
- 基本信息
功能描述:查询服务已绑定文件列表
请求地址:https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/files
请求方式:GET
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
serviceId | String | 是 | 服务id |
- Query参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
pageNum | Number | 否 | 分页页数 |
pageSize | Number | 否 | 分页页大小 |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
status | string | 请求状态码,0为成功 |
message | string | 请求执行状态 |
result | object | 执行结果 |
result.pageNum | number | 当前页码 |
result.pageSize | number | 当前页面尺寸 |
result.size | number | 当前页面item数量 |
result.pages | number | 当总页数 |
result.total | number | 总item数量 |
result.list | List<object> | 文档列表 |
result.list[0].id | string | 文档id |
result.list[0].title | string | 文档标题 |
result.list[0].snippet | string | 文档内容片段 |
result.list[0].status | string | 文档状态,ENABLED为已启用,NOT_ENABLED为未启用 |
请求示例
HTTP API
curl --location --request GET 'https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/files?pageNum=1&&pageSize=10' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
响应示例
{
"status": 0,
"message": "请求成功",
"result": {
"pageNum": 1,
"pageSize": 10,
"size": 1,
"pages": 1,
"total": 1,
"list": [
{
"id": "4pw0y0Foa0lNubkPUriLkA",
"title": "你的文档标题",
"snippet": "文档内容片段",
"status": "ENABLED",
"createdAt": "2025-03-17T06:21:09.175+00:00"
}
]
},
"timestamp": 1740536970407
}
获取文件详情
请求说明
- 基本信息
功能描述:查询文件详情
请求地址:https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/files/{fileId}
请求方式:GET
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
serviceId | String | 是 | 服务id |
fileId | String | 是 | 文件id |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
status | string | 请求状态码,0为成功 |
message | string | 请求执行状态 |
result | object | 执行结果 |
result.id | string | 文档id |
result.title | string | 文档标题 |
result.content | string | 文档内容 |
result.downloadUrl | string | 文档源文件下载地址 |
请求示例
HTTP API
curl --location --request GET 'https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/files/{fileId}' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
响应示例
{
"status": 0,
"message": "请求成功",
"result": {
"id": "4pw0y0Foa0lNubkPUriLkA",
"title": "你的文档标题",
"content": "文档内容",
"downloadUrl": "下载地址",
"createdAt": "2025-03-17T06:21:09.175+00:00"
},
"timestamp": 1742192469480
}
删除文件
请求说明
- 基本信息
功能描述:删除服务中的指定文件
请求地址:https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/files/{fileId}
请求方式:DELETE
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
serviceId | String | 是 | 服务id |
fileId | String | 是 | 文件id |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
status | string | 请求状态码,0为成功 |
message | string | 请求执行状态 |
result | object | 执行结果 |
请求示例
HTTP API
curl --location --request DELETE 'https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/files/{fileId}' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
响应示例
{
"status": 0,
"message": "请求成功",
"timestamp": 1742192469480
}
自定义模型-Q&A Table
新增QA记录
请求说明
- 基本信息
功能描述:为服务新增QA记录
请求地址:https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/qa-records
请求方式:POST
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
serviceId | String | 是 | 服务id |
- Body参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
question | String | 是 | QA问题,最长为200个字符 |
answer | String | 是 | QA答案,最长为1000个字符 |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
status | string | 请求状态码,0为成功 |
message | string | 请求执行状态 |
result | object | 执行结果 |
result.id | string | QA记录id |
result.question | string | QA记录问题 |
result.answer | string | QA记录答案 |
请求示例
HTTP API
curl --location --request POST 'https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/qa-records' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"question": "你是谁?",
"answer": "我是SophNet智能助手。"
}'
响应示例
{
"status": 0,
"message": "请求成功",
"result": {
"id": "79CNI1obN033Wi8mydOrZC",
"question": "你是谁?",
"answer": "我是SophNet智能助手。",
"createdAt": "2025-03-14T06:23:42.194+00:00"
},
"timestamp": 1742192469480
}
修改QA记录
请求说明
- 基本信息
功能描述:修改服务QA记录
请求地址:https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/qa-records/{qaId}
请求方式:POST
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
serviceId | String | 是 | 服务id |
qaId | String | 是 | QA记录id |
- Body参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
question | String | 是 | QA问题,最长为200个字符 |
answer | String | 是 | QA答案,最长为1000个字符 |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
status | string | 请求状态码,0为成功 |
message | string | 请求执行状态 |
result | object | 执行结果 |
result.id | string | QA记录id |
result.question | string | QA记录问题 |
result.answer | string | QA记录答案 |
请求示例
HTTP API
curl --location --request POST 'https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/qa-records/{qaId}' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"question": "你是谁?",
"answer": "我是SophNet智能助手。"
}'
响应示例
{
"status": 0,
"message": "请求成功",
"result": {
"id": "79CNI1obN033Wi8mydOrZC",
"question": "你是谁?",
"answer": "我是SophNet智能助手。",
"createdAt": "2025-03-14T06:23:42.194+00:00"
},
"timestamp": 1742192469480
}
查询服务已绑定QA记录列表
请求说明
- 基本信息
功能描述:查询服务已绑定QA记录列表
请求地址:https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/qa-records
请求方式:GET
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
serviceId | String | 是 | 服务id |
- Query参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
pageNum | Number | 否 | 分页页数 |
pageSize | Number | 否 | 分页页大小 |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
status | string | 请求状态码,0为成功 |
message | string | 请求执行状态 |
result | object | 执行结果 |
result.pageNum | number | 当前页码 |
result.pageSize | number | 当前页面尺寸 |
result.size | number | 当前页面item数量 |
result.pages | number | 当总页数 |
result.total | number | 总item数量 |
result.list | List<object> | QA记录文档列表 |
result.list[0].id | string | QA记录文档id |
result.list[0].question | string | QA记录文档问题 |
result.list[0].answer | string | QA记录文档答案 |
请求示例
HTTP API
curl --location --request POST 'https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/qa-records?pageNum=1&&pageSize=10' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
响应示例
{
"status": 0,
"message": "请求成功",
"result": {
"pageNum": 1,
"pageSize": 10,
"size": 1,
"pages": 1,
"total": 1,
"list": [
{
"id": "79CNI1obN033Wi8mydOrZC",
"question": "你是谁?",
"answer": "我是SophNet智能助手。",
"createdAt": "2025-03-14T06:23:42.194+00:00"
}
]
},
"timestamp": 1740536970407
}
删除QA记录
请求说明
- 基本信息
功能描述:删除服务中的指定QA记录
请求地址:https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/qa-records/{qaId}
请求方式:DELETE
- Path参数:
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
serviceId | String | 是 | 服务id |
qaId | String | 是 | QA记录id |
- Header参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Content-Type | String | 是 | 固定值application/json |
Authorization | String | 是 | "Bearer" + Apikey |
响应说明
- 响应头参数
名称 | 值 | 描述 |
---|---|---|
Content-Type | application/json |
- 响应体参数
名称 | 类型 | 值 |
---|---|---|
status | string | 请求状态码,0为成功 |
message | string | 请求执行状态 |
result | object | 执行结果 |
请求示例
HTTP API
curl --location --request DELETE 'https://www.sophnet.com/api/open-apis/service/{serviceId}/kn/qa-records/{qaId}' \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json"
响应示例
{
"status": 0,
"message": "请求成功",
"timestamp": 1742192469480
}