ai-gateway
Two primitives of the Nutrient AI Gateway. Chat models (`nutrient-s`/`nutrient-m`/`nutrient-l` via `POST /responses` or `POST /chat/completions`) are…
от PSPDFKit-labs★ 18 звёзд на GitHub
Установить ai-gateway в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Nutrient AI Gateway
Two primitives, no bundled script — AI Gateway is a plain REST API, so write the call in
whatever language the project already uses. Chat models (nutrient-s, nutrient-m,
nutrient-l) answer POST /responses or POST /chat/completions with OpenAI-compatible
request/response shapes. Decision models (nutrient-document-decision, nutrient-systemone) answer
POST /systemone with a calibrated probability instead of free text.
Choosing chat vs. decision
| The task is… | Use | Why |
|---|---|---|
| "Is this true/false", "classify this", "route to a category", "flag for review", "rate the severity/quality" | Decision API (/systemone) |
Returns a calibrated probability or confidence, not text to re-parse — replaces regex, keyword matching, or asking a chat model for JSON it might get wrong |
| Open-ended generation, summarization, drafting, tool-calling | Chat model (/responses or /chat/completions) |
Free-text output is the point |
| Structured extraction from a document (fields, tables, citations) | Neither — use the sibling document-extraction-api skill |
AI Gateway decides about content; it doesn't parse documents |
The decision API's whole purpose is standing in for fragile code: a noul question
replaces a keyword-matching if/else; a choice question replaces a brittle classifier or
lookup table; a score question replaces a hand-tuned heuristic scale. If you're about to write
a regex or a long if/elif chain to decide something about text, consider a decision question
instead.
Question types (POST /systemone)
One request can carry multiple named questions evaluated independently against one shared
state (any JSON: string, object, or array):
| Type | Returns | Use for |
|---|---|---|
noul |
{noul} — a probability from 0 to 1 that the answer is "yes" — not a Boolean |
Yes/no judgments: "Is this about billing?", "Is this amount plausible?" |
choice |
{choice, confidence, probabilities} — choice is a label from criteria, probabilities maps every label to its probability |
Picking one of several categories: support-ticket routing, sentiment buckets |
score |
{score, confidence, legend, probabilities} — score is the probability-weighted index (e.g. 1.43 on a 3-level scale), not necessarily an integer; legend maps each 0-based index to its criteria label; probabilities is keyed by index, not label |
Placing content on a scale: severity, quality, confidence tier |
Don't treat score as an integer level — round or bucket it deliberately (e.g. Math.round(score)
then look up legend[rounded]) rather than assuming it lands exactly on a level. confidence on
score is not the same metric as confidence on choice: a score neighbor-level probability
costs less confidence than the same probability on a distant level, so the two aren't comparable
across question types.
Label/level limits differ by model: nutrient-systemone accepts up to 255 choice labels and
2–10 score levels; nutrient-document-decision accepts at most 26 choice labels and 2–26 score
levels (each option must tokenize to a single native label — a request exceeding either model's
limit is rejected with HTTP 400, upstream_rejected_request).
curl --fail-with-body https://api.nutrient.io/ai/v1/systemone \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nutrient-document-decision",
"state": "I was charged twice for my subscription this month.",
"questions": {
"billing": { "type": "noul", "instructions": "Is this message about billing?" },
"category": {
"type": "choice",
"instructions": "Which support category applies?",
"criteria": { "billing": "A billing or payment issue", "bug": "A product defect", "question": "A how-to question" }
}
}
}'
Read answers.billing.noul as a probability, not a Boolean — choose a decision threshold using
your own evaluation data, and route uncertain results for review rather than hard-coding 0.5.
Two decision models — pick one, know the difference
nutrient-document-decision(recommended) — Nutrient's own model, run on Nutrient infrastructure. Accepts images embedded anywhere instate, at any nesting depth, as{"type": "image", "source": "data:<mime>;base64,<bytes>"}; surrounding text and every embedded image are evaluated together.nutrient-systemone— a third-party-provider model. Text-only — embedding an image in anutrient-systemonerequest is rejected the same way any other unsupported question shape is.
Don't assume feature parity between the two just because they share a request format — check
GET /models for what's actually available to the calling key before relying on a capability
(image input, specific label counts) that only one of them has.
Chat models (POST /responses, `POST /chat/comple
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл ai-gateway?
Two primitives of the Nutrient AI Gateway. Chat models (`nutrient-s`/`nutrient-m`/`nutrient-l` via `POST /responses` or `POST /chat/completions`) are OpenAI-compatible, for open-ended generation. The decision API (`POST /systemone`, TypeSafe-compatible) returns calibrated probabilities instead of free text, for routing, flagging, and scoring — `noul` for yes/no, `choice` for picking one of several labels, `score` for placing content on an ordered scale. Route to the decision API whenever the task is "classify this", "is this true/false", "route to a category", "flag for review", "rate the severity/quality", or anything else that would otherwise need regex, keyword matching, or asking a chat model to emit structured JSON. Route to a chat model for open-ended generation, summarization, or tool-calling. Triggers include AI Gateway, nutrient-document-decision, nutrient-systemone, System One, TypeSafe, calibrated probability, noul question, choice question, score question, classify this document/message, route to a category, flag for review, confidence threshold.
Как установить скилл ai-gateway?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ai-gateway запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…