跳转到内容
EN

结构化决策

POST/model/v1/systemone● 支持

官方文档 ↗

请求体

  • modelstring必填

    Published model id from model.models.list with supported_apis containing typesafe.systemone; returned unchanged in the response.

  • statestring | object | array必填

    Shared content evaluated by every question, supplied as text, a JSON object or an array.

  • questionsobject必填◐ 部分支持

    Non-empty map of caller-chosen question ids to typed questions; answers preserve these ids. noul evaluates yes/no, choice selects a named option, score rates ordered levels. box is unsupported.

    noul、choice、score 支持;box 不支持并返回 400。instructions 可省略且支持结构化 JSON。

  • assetsobject可选○ 未支持

    Unsupported image assets. Supplying this field, including null or an empty collection, returns 400: images are not supported.

    图片输入不支持,传入即返回 400。

返回

200

鉴权、限流、参数校验等平台错误按 problem+json 返回;OCR 的错误也为 problem+json,其它模型调用的错误按该端点所属格式(OpenAI 或 Anthropic)返回,参见 错误码

请求示例

curl
curl https://api.deepraxis.com/model/v1/systemone \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"jev-1.13","state":{"subject":"Charged twice","message":"My card was charged twice for the annual plan. Please refund the extra charge today."},"questions":{"team":{"type":"choice","instructions":"Which team should handle this ticket","criteria":{"billing":"Charges, invoices, refunds","technical":"Errors, outages, broken features","other":"None of these"}},"urgency":{"type":"score","instructions":"How urgent the request is","criteria":["No time pressure","Wants action soon","Wants action today"]},"refund":{"type":"noul","instructions":"The customer is asking for money back"}}}'
Python
import requests

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

resp = requests.post(
    f"{opts['base_url']}/systemone",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
    json={
        "model": "jev-1.13",
        "state": {"subject": "Charged twice", "message": "My card was charged twice for the annual plan. Please refund the extra charge today."},
        "questions": {
            "team": {"type": "choice", "instructions": "Which team should handle this ticket", "criteria": {"billing": "Charges, invoices, refunds", "technical": "Errors, outages, broken features", "other": "None of these"}},
            "urgency": {"type": "score", "instructions": "How urgent the request is", "criteria": ["No time pressure", "Wants action soon", "Wants action today"]},
            "refund": {"type": "noul", "instructions": "The customer is asking for money back"},
        },
    },
)
answers = resp.json()["answers"]
print(answers["team"]["choice"], answers["refund"]["noul"])
TypeScript
const opts = {
  baseURL: "https://api.deepraxis.com/model/v1",
  apiKey: "$PRAXIS_API_KEY",
};

const resp = await fetch(`${opts.baseURL}/systemone`, {
  method: "POST",
  headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    model: "jev-1.13",
    state: { subject: "Charged twice", message: "My card was charged twice for the annual plan. Please refund the extra charge today." },
    questions: {
      team: { type: "choice", instructions: "Which team should handle this ticket", criteria: { billing: "Charges, invoices, refunds", technical: "Errors, outages, broken features", other: "None of these" } },
      urgency: { type: "score", instructions: "How urgent the request is", criteria: ["No time pressure", "Wants action soon", "Wants action today"] },
      refund: { type: "noul", instructions: "The customer is asking for money back" },
    },
  }),
});
const { answers } = await resp.json();
console.log(answers.team.choice, answers.refund.noul);

响应示例 200

{
  "model": "jev-1.13",
  "answers": {
    "refund": {
      "noul": 0.99,
      "type": "noul"
    },
    "team": {
      "choice": "billing",
      "confidence": 1,
      "probabilities": {
        "billing": 1,
        "other": 0,
        "technical": 0
      },
      "type": "choice"
    },
    "urgency": {
      "confidence": 1,
      "legend": {
        "0": "No time pressure",
        "1": "Wants action soon",
        "2": "Wants action today"
      },
      "probabilities": {
        "0": 0,
        "1": 0,
        "2": 1
      },
      "score": 2,
      "type": "score"
    }
  },
  "usage": {
    "input_tokens": 422,
    "output_tokens": 69,
    "cost": 0.000018
  }
}

响应

HTTP 200

Typed answers keyed by the original question ids, token usage, and the actual customer charge in USD.

application/json

名称 类型 说明
model string Model id exactly as supplied in the request, including any public alias or creator prefix.
answers object Results mapped by the caller's question ids; each discriminator matches that question's type.
usage object Provider token counts and the actual input-only customer charge; output tokens are free.
usage.input_tokens integer Authoritative upstream count of input tokens; the sole billed quantity for this operation.
usage.output_tokens integer Upstream count of output tokens, returned for visibility and never charged.
usage.cost number Actual customer charge in USD after micro-dollar rounding; exactly the value in X-Praxis-Cost-Usd, never upstream procurement cost.