Примеры

Примеры OpenAI Decisions API

Двенадцать тел запросов, которые можно отправить на POST /api/v1/decisions как есть — эндпоинт decisions-1 этого сайта, вызываемая альтернатива OpenAI Decisions API. Каждая карточка показывает запрос, иллюстративный ответ и как система среагирует.

Обновлено

Маршрутизация инцидента оплаты

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "Checkout shows a blank page after Pay is clicked. The customer is on the live store, not a sandbox.",
  "questions": {
    "team": {
      "type": "choice",
      "instructions": "Which team should own this ticket?",
      "criteria": {
        "payments": "Checkout, billing, or payment processing.",
        "frontend": "Rendering, layout, or browser behavior.",
        "account": "Login, permissions, or profile access."
      }
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "team": {
      "type": "choice",
      "choice": "frontend",
      "probabilities": {
        "frontend": 0.71,
        "payments": 0.24,
        "account": 0.05
      },
      "confidence": 0.47
    }
  },
  "credits_used": 1
}

Действие: Отправьте тикет в frontend; если payments вышел около 0.5 — в очередь триажа.

Намерение возврата

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "I was charged twice for the same annual plan this morning. Please send the extra charge back.",
  "questions": {
    "refund": {
      "type": "noul",
      "instructions": "Is the customer asking for money back?"
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "refund": {
      "type": "noul",
      "noul": 0.98
    }
  },
  "credits_used": 1
}

Действие: noul ≥ 0.9 автоматически отправляет тикет в очередь возвратов; ниже — читает оператор.

Оценка срочности

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "Stripe payouts have been failing for three days and the merchant is losing sales.",
  "questions": {
    "urgency": {
      "type": "score",
      "instructions": "How urgent is this ticket?",
      "criteria": [
        "Can wait for the next release",
        "Should be handled this week",
        "Blocking revenue right now"
      ]
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "urgency": {
      "type": "score",
      "score": 2,
      "legend": [
        "Can wait for the next release",
        "Should be handled this week",
        "Blocking revenue right now"
      ],
      "probabilities": {
        "0": 0.02,
        "1": 0.14,
        "2": 0.84
      },
      "confidence": 0.84
    }
  },
  "credits_used": 1
}

Действие: score 2 зовёт дежурного инженера; score 1 идёт в недельную очередь; score 0 ждёт следующего релиза.

Проверка на фишинг

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "User message: \"Share your login and I will fix the account for you tonight.\"",
  "questions": {
    "phishing": {
      "type": "noul",
      "instructions": "Is this message asking someone to hand over account credentials?"
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "phishing": {
      "type": "noul",
      "noul": 0.96
    }
  },
  "credits_used": 1
}

Действие: noul ≥ 0.8 блокирует сообщение и помечает отправителя; остальное проходит без изменений.

Квалификация лида

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "We route 40,000 support tickets a week and need a probability before we auto-assign a queue. Budget is approved this quarter.",
  "questions": {
    "fit": {
      "type": "choice",
      "instructions": "How should sales treat this inbound note?",
      "criteria": {
        "ready": "A real workflow, a volume, and a buying window.",
        "nurture": "Interest without a stated workflow or timeline.",
        "ignore": "No product fit."
      }
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "fit": {
      "type": "choice",
      "choice": "ready",
      "probabilities": {
        "ready": 0.88,
        "nurture": 0.11,
        "ignore": 0.01
      },
      "confidence": 0.77
    }
  },
  "credits_used": 1
}

Действие: ready получает ответ продаж в тот же день; nurture уходит в почтовую цепочку; ignore — вежливый отказ.

Политический барьер

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "Listing text: \"Guaranteed 30% returns every month. Send crypto to this wallet to join.\"",
  "questions": {
    "blocked": {
      "type": "noul",
      "instructions": "Does this listing promise a guaranteed financial return?"
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "blocked": {
      "type": "noul",
      "noul": 0.99
    }
  },
  "credits_used": 1
}

Действие: noul ≥ 0.9 задерживает листинг и уведомляет продавца; ниже — всё равно в очередь на живое ревью.

Оценка риска оттока

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "The renewal note says the team may not continue because exports fail every Friday and nobody has answered the last two tickets.",
  "questions": {
    "risk": {
      "type": "score",
      "instructions": "How high is the chance this account does not renew?",
      "criteria": [
        "Unlikely to leave",
        "Unhappy, still using the product",
        "Likely to cancel"
      ]
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "risk": {
      "type": "score",
      "score": 2,
      "legend": [
        "Unlikely to leave",
        "Unhappy, still using the product",
        "Likely to cancel"
      ],
      "probabilities": {
        "0": 0.07,
        "1": 0.24,
        "2": 0.69
      },
      "confidence": 0.55
    }
  },
  "credits_used": 1
}

Действие: score 2 запускает план удержания с владельцем аккаунта; score 1 планирует чек-ин; score 0 остаётся на автопилоте.

Исключение в счёте

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "Vendor invoice 4481 is $18,400. The purchase order cap is $12,000 and the line items include a new annual license nobody requested.",
  "questions": {
    "exception": {
      "type": "choice",
      "instructions": "Which exception should accounts payable open?",
      "criteria": {
        "over_po": "The amount is above the purchase order.",
        "unexpected_item": "A line item was not requested.",
        "both": "The amount and a line item are both wrong."
      }
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "exception": {
      "type": "choice",
      "choice": "both",
      "probabilities": {
        "both": 0.86,
        "over_po": 0.1,
        "unexpected_item": 0.04
      },
      "confidence": 0.76
    }
  },
  "credits_used": 1
}

Действие: both открывает кейс в закупках; только over_po идёт утверждающему; только unexpected_item возвращается инициатору.

Следующее действие агента

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "The support agent has the refund policy loaded and the customer confirmed their order number. No tool call has run yet.",
  "questions": {
    "next_action": {
      "type": "choice",
      "instructions": "What should the agent do next?",
      "criteria": {
        "issue_refund": "Call the refund tool for the confirmed order.",
        "ask_details": "Ask the customer for more information.",
        "escalate": "Hand the conversation to a human."
      }
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "next_action": {
      "type": "choice",
      "choice": "issue_refund",
      "probabilities": {
        "issue_refund": 0.82,
        "ask_details": 0.13,
        "escalate": 0.05
      },
      "confidence": 0.69
    }
  },
  "credits_used": 1
}

Действие: issue_refund запускает инструмент возврата; ask_details задаёт уточняющий вопрос; escalate передаёт диалог человеку.

Триаж багов

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "Bug report: the export button spins forever on Firefox but works in Chrome. Two enterprise accounts reported it this week.",
  "questions": {
    "severity": {
      "type": "score",
      "instructions": "What severity should this bug get?",
      "criteria": [
        "Cosmetic",
        "Minor workaround exists",
        "Blocks a core flow"
      ]
    },
    "is_duplicate": {
      "type": "noul",
      "instructions": "Does this report describe a known browser-specific failure pattern?"
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "severity": {
      "type": "score",
      "score": 2,
      "legend": [
        "Cosmetic",
        "Minor workaround exists",
        "Blocks a core flow"
      ],
      "probabilities": {
        "0": 0.04,
        "1": 0.22,
        "2": 0.74
      },
      "confidence": 0.58
    },
    "is_duplicate": {
      "type": "noul",
      "noul": 0.31
    }
  },
  "credits_used": 1
}

Действие: Два вопроса за один вызов — severity выбирает очередь, is_duplicate решает, связывать ли с существующим issue.

Шлюз ответа на отзыв

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "App store review, 4 stars: \"Solid app, but the last update broke dark mode on my tablet.\"",
  "questions": {
    "needs_reply": {
      "type": "noul",
      "instructions": "Should the team reply to this review?"
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "needs_reply": {
      "type": "noul",
      "noul": 0.81
    }
  },
  "credits_used": 1
}

Действие: noul ≥ 0.7 готовит черновик ответа для ревьюера; ниже — просто попадает в недельный дайджест.

Назначение уровня SLA

Открыть в песочнице

Запрос

{
  "model": "decisions-1",
  "state": "A customer on the Enterprise plan reports their single sign-on is down for all 300 employees.",
  "questions": {
    "sla_tier": {
      "type": "choice",
      "instructions": "Which SLA tier applies to this ticket?",
      "criteria": {
        "p1": "Full outage for an enterprise account.",
        "p2": "Major feature degraded.",
        "p3": "Standard request."
      }
    }
  }
}

Пример ответа

{
  "model": "decisions-1",
  "answers": {
    "sla_tier": {
      "type": "choice",
      "choice": "p1",
      "probabilities": {
        "p1": 0.93,
        "p2": 0.06,
        "p3": 0.01
      },
      "confidence": 0.87
    }
  },
  "credits_used": 1
}

Действие: p1 запускает таймер инцидента и уведомляет владельца аккаунта; p2/p3 попадают в обычные очереди.

Запустите любой пример

Каждый запрос выше работает как есть — откройте его в песочнице или отправьте со своим ключом.