Developer docs

System One API

Send state and named questions to get the model name, structured answers, and token usage.

Quickstart

The API base URL is https://api.wizmodel.com. Create a key in the developer console and send it in the Authorization: Bearer header.

List models with GET /v1/models. Submit questions with POST /v1/systemone.

curl https://api.wizmodel.com/v1/models \
  -H "Authorization: Bearer $XIDIAN_API_KEY"

curl -X POST https://api.wizmodel.com/v1/systemone \
  -H "Authorization: Bearer $XIDIAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"daoshu","state":"I was charged twice for my subscription. Can you refund the duplicate charge?","questions":{"refund":{"type":"noul","instructions":"Is the customer asking for a refund?","criteria":{"true":"Explicitly requests a refund","false":"Only asks about charges or refund policy"}}}}'

Request format

Pass model, state, and questions. State can be a string, object, or array. The same question IDs appear in answers.

  • Noul · Ask a true-or-false question and receive the probability of yes.
  • Choice · Provide 1 to 255 named options. The response includes the top option, confidence, and the probability distribution.
  • Score · Provide 1 to 10 ordered levels. The response includes a zero-based expected score, level descriptions, confidence, and the probability distribution.

Successful responses include model, answers, usage.input_tokens, and usage.output_tokens. Daoshu counts input tokens across all question sequences, excluding padding.

Sample data
Request
POST /v1/systemone
{
  "model": "daoshu",
  "state": "I was charged twice for my subscription. Can you refund the duplicate charge?",
  "questions": {
    "route": {
      "type": "choice",
      "instructions": "Which team should handle this request?",
      "criteria": {
        "billing": "Payments, charges, or refunds",
        "support": "Product issues or integrations",
        "sales": "Purchase or upgrade inquiries"
      }
    }
  }
}
Response200

Pick the best match from a set of options and get a probability for each one.

{
  "model": "daoshu",
  "usage": {
    "input_tokens": 146,
    "output_tokens": 0
  },
  "answers": {
    "route": {
      "type": "choice",
      "choice": "billing",
      "probabilities": {
        "billing": 0.94,
        "support": 0.04,
        "sales": 0.02
      },
      "confidence": 0.91
    }
  }
}

Browse all request examples

The Daoshu model supports text input.

JavaScript example

Daoshu currently offers an HTTP API. An official SDK is unavailable. Use fetch in Node.js and read the key from the server-side environment variable XIDIAN_API_KEY.

const response = await fetch("https://api.wizmodel.com/v1/systemone", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.XIDIAN_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "daoshu",
    "state": "I was charged twice for my subscription. Can you refund the duplicate charge?",
    "questions": {
      "refund": {
        "type": "noul",
        "instructions": "Is the customer asking for a refund?",
        "criteria": {
          "true": "Explicitly requests a refund",
          "false": "Only asks about charges or refund policy"
        }
      }
    }
  }),
});
if (!response.ok) throw new Error(await response.text());
const { answers } = await response.json();
console.log(answers.refund.noul);

Error handling

Errors use the detail field. 400 indicates a request rule or model capability mismatch. 401 indicates a missing or invalid key. 422 returns an array of field validation errors with loc, msg, and type.