BazaarLinkBazaarLink
Войти
ДокументацияAPI СсылкаSDK СсылкаАгентное использованиеAI Навыки
Decisions

Submit a decisions request

Evaluate a state against named questions with a decisions-output model. This alpha endpoint returns non-streaming JSON. Find available model ids with GET /v1/models?output_modalities=decisions; use this endpoint for Clef instead of chat/completions. Input tokens are billed at the selected model's customer price. Sufficient credits are required. Set BAZAARLINK_API_KEY to your API key; the sample builds its complete Authorization header in BAZAARLINK_AUTH_HEADER.

POST/v1/alpha/decisions

Авторизация

Authorizationобязательно
string · header

Ключ API как Bearer-токен в заголовке Authorization.

Тело

modelобязательно
string

An available decisions-output model id from /v1/models?output_modalities=decisions.

Example: "cloudflare/clef-flash"
stateобязательно
JSON string | object | array

The evidence to evaluate, supplied as a string, JSON object, or array. Structured content parts are preserved. Image interpretation depends on the selected model's supported state format; input_tokens includes image tokens when they are counted.

images
string[]

Optional inline images, up to 4 per request: PNG, JPEG or WebP as a data URI or raw base64, each up to 4 MiB and 8 MiB in total. Remote URLs are not accepted. Images are added to the state for the model; input_tokens includes the image tokens. A request with an unsupported or invalid image is rejected with 400 invalid_images.

questionsобязательно
record<string, Question>

Named questions. Each answer uses the same question id as its key.

typeобязательно
string

noul returns a number for a yes/no decision; choice selects an option; score returns a numeric score.

noulchoicescore
instructionsобязательно
JSON string | object | array

Instructions explaining the decision to make.

criteria
record<string, JSON> | JSON[]

Optional true/false guidance for noul. Required option-to-guidance map for choice, with null allowed as option guidance. Required ordered guidance array with at least one item for score.

stream
boolean

Omit this field or set false. Streaming requests are rejected with HTTP 400.

false

Подробное руководство →

POST /v1/alpha/decisions
export BAZAARLINK_AUTH_HEADER="Authorization: $(printf '%s %s' 'Bearer' "$BAZAARLINK_API_KEY")"

curl https://api.bazaarlink.ai/v1/alpha/decisions \
  -H "$BAZAARLINK_AUTH_HEADER" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "cloudflare/clef-flash",
    "state": "The support agent issued a full refund.",
    "questions": {
      "refunded": {
        "type": "noul",
        "instructions": "Was a refund issued?"
      }
    }
  }'
Примеры ответов

Success. answers contains the typed result for each question. Optional confidence, probabilities and score legend fields depend on the model. usage.input_tokens includes every counted input token; usage.output_tokens reports output tokens. usage.cost is the USD amount charged to the customer. id is an opaque BazaarLink request id and matches x-request-id and x-generation-id. Use this id with GET /v1/generation?id=ID to read back persisted customer usage; retry a 404 briefly while the usage log is written.

{
  "id": "85e6f35c71a31f19-SJC",
  "model": "cloudflare/clef-flash",
  "answers": {
    "refunded": {
      "type": "noul",
      "noul": 0.99
    }
  },
  "usage": {
    "input_tokens": 64,
    "output_tokens": 1,
    "cost": 0.000007
  }
}
Поддержка
Поддержка
Здравствуйте! Чем мы можем помочь?
Отправьте сообщение, и мы ответим в ближайшее время.
Submit a decisions request — BazaarLink API