跳转到内容
EN

为调用的智能体自己创建登录令牌

POST/agent/v1/login_intents● 支持

返回

201

只能给自己创建、只能开在自己的电脑上:智能体、组织与电脑都取自凭证和智能体的记录,请求体不接受任何字段(含 place)。驱动这次会话的人必须是该智能体的担保人——码会变成智能体 30 天的 cli 登录,所以只有担保人能为它开;会话里没有成员(终端客户会话)一律拒绝。cli 会话被拒(登录令牌不能再造登录)。码 5 分钟有效、只能兑一次,兑换在网关上,凭证放在 Authorization 头。

错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码

请求示例

curl
curl https://api.deepraxis.com/agent/v1/login_intents \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Python
import requests

opts = dict(
    base_url="https://api.deepraxis.com/agent",
    api_key="$PRAXIS_API_KEY",
)

# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.post(
    f"{opts['base_url']}/v1/login_intents",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
    json={},
)
print(resp.status_code, resp.json())
TypeScript
const opts = {
  baseURL: "https://api.deepraxis.com/agent",
  apiKey: "$PRAXIS_API_KEY",
};

// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/login_intents`, {
  method: "POST",
  headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({}),
});
console.log(resp.status, await resp.json());

响应示例 201

{
  "code": "pli_00000000000000000000000000000000",
  "expires_at": "2026-01-01T00:05:00.000Z"
}

响应

HTTP 201

The one-time login code and when it stops working; the code is answered once and never again.

application/json

名称 类型 说明
code string The one-time login code (pli_ plus 32 Crockford base32 characters) to redeem on the agent's own computer with praxis login --intent. It lives five minutes and redeems once; store it nowhere.
expires_at string When the code stops being redeemable, in RFC 3339: five minutes after it was created.