Ultineo Reasoning 的 API
从您自己的软件运行目录中的应用。API 通过 HTTPS 使用 JSON,以项目密钥验证每次调用,并以相同格式响应所有调用。
围绕应用、运行和密钥构建
- 应用
基于输入字段和指令创建应用,然后列出、查看和编辑您的应用。
- Runs and usage
一次调用携带输入启动应用,另一次调用读取该运行及其回答。摘要会显示当前计费周内已使用的令牌数及其金额。
- 密钥
带有权限范围、可选有效期以及可停用状态的项目密钥。
随处集成
- In your software
Add a reasoning step to an existing screen: a summary, a suggested reply, a classification.
- 在您的自动化中
A script or an automation tool launches a run at each event: a form received, a file dropped.
- 从一个答案到下一个
单次运行的结果可作为下一步的字段:您的代码可按需串联步骤。
The same run, through the API
Your software sends the application’s identifier and its fields, then reads the run back until it is finished.
您发送的内容
{
"app_id": "mapp_0ceacb46e5b3a99e91b6",
"data": {
"message": "My parcel has not arrived and the tracking has not moved for a week."
}
} 您回读的内容
{
"id": "runi_1b7f4e0c96a2d8531fca",
"object": "reasoning",
"status": "finished",
"response": { "miid_9a4c07e5b312df8641ca": "urgent" },
"tokens": { "input": 412, "output": 3, "total": 415 },
"duration": 1.84
} 身份验证与权限范围
- Bearer 密钥
每次调用都在 Authorization 请求头中发送您的项目密钥,且仅通过 HTTPS 传输。
- 仅限一个项目
一把密钥只绑定一个项目,无论发出何种请求,都无法读取或写入其他项目的数据。
- 以哈希值存储
系统只保存密钥的哈希值,因此完整密钥只显示一次。密钥丢失后会被替换,永远无法找回。
启动运行并读取回答
- 创建
指定应用,并为每个输入字段提供一个值,以应用返回的字段名作为键。
- 跟踪
运行是异步的:请反复读取该运行,直到其状态变为已完成或已失败。这两种状态都是最终状态。
- 读取
已完成的运行包含其回答、耗时以及输入和输出的 Token 数。
The runs your software started, one by one
Every call made through the API appears in the reasonings list, marked API, with its duration and its tokens. Each application shows the identifier your software calls.
所有响应采用统一格式
- 始终是相同的三个字段
无论成功还是失败,每个响应都包含状态码、简短标题和返回内容。
- 稳定的消息
错误消息是固定的英文字符串,会指出缺少的权限范围或被拒绝的值。
- Refusals are explicit
A call that cannot be accepted, for example while an invoice is overdue, is refused with its own status code.
获取密钥
API access is included with Ultineo Reasoning. There is no self-service sign-up: our team opens your project and hands you its first key.
关于 API 的常见问题
Yes. Every project can call the API; a call is billed like any other run, on the tokens it uses.
不会。指令归应用所有者所有。API 返回的是输入字段,也就是调用方需要填写的内容。
创建运行后会立即返回新的状态。请反复读取该运行,直到其完成,即可获得回答。
可以。每把密钥都带有权限范围和可选有效期,且密钥永远无法创建权限范围比自身更大的另一把密钥。