mirror of
https://github.com/hanzoai/site.git
synced 2026-11-21 01:07:08 +00:00
75 lines
54 KiB
HTML
75 lines
54 KiB
HTML
<section aria-labelledby="_R_n5fiv5tf6bdb_" class="is_View _ox-_platformweb_clip _pos-relative _width-10037 _ox-hidden _oy-hidden _dsp-flex _fd-column _justify-center _mt-calc-1calc62003180138 _pt-calc0pxcalc447866377" data-slot="fold"><div aria-hidden="true" class="is_View _pos-absolute _t-0px _l-0px _r-0px _height-640px _pe-none _backgroundImage-radial-grad1214971095"></div><div class="is_View _fd-column _pos-relative _width-10037 _maxW-1320px _mr-auto _ml-auto _pr-page-gutter _pl-page-gutter _pt-max40pxmin8857263194 _pb-max48pxmin8857263194"><div class="is_View _fd-column _mb-c-space-6"><nav class="is_View _fd-row _fwr-wrap _items-center _justify-center _gap-c-space-2 _mb-c-space-5"><a class="is_Text _col-0hover-pure-white _col-_light_muted-foreg108704142 _col-_light_0hover-foreground _col-neutral-300 _dsp-inline-flex _items-center _ws-inherit _td-none _fs-f-size-2 _lh-calc1--250--87537940352 _gap-c-space-2 _fw-500" data-slot="more" href="/models">Models</a><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-calc1--250--87537940352" data-slot="text">/</span><span class="is_Text _col-foreground _fs-f-size-2 _lh-calc1--250--87537940352" data-slot="text">Kai Guide</span></nav></div><div class="is_View _dsp-grid _gridTemplateColumns-minmax01fr1234957 _items-center _gap-max36pxmin5518920252 _width-10037"><div class="is_View _text-_platformweb_center _fd-column _minW-0px _gap-c-space-4 _items-center"><div class="is_View _self-center"><div class="is_View _btlr-_platformweb_9999px _btrr-_platformweb_9999px _bbrr-_platformweb_9999px _bblr-_platformweb_9999px _dsp-_platformweb_inline-flex _width-_platformweb_fit-content _textDecoration-_platformweb_none _self-flex-start _dsp-inline-flex _fd-row _items-center _justify-center _gap-6px _pr-12px _pl-12px _pt-4px _pb-4px _btlr-9999px _btrr-9999px _bbrr-9999px _bblr-9999px _bg-transparent _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border-stro3513 _brc-border-stro3513 _borderBottomColor-border-stro3513 _borderLeftColor-border-stro3513 _pos-relative _ox-hidden _oy-hidden _bbs-solid _bts-solid _bls-solid _brs-solid" data-label=""><span class="is_Text font_mono _col-muted-foreg108704142 _ff-f-family _fs-f-size-1 _lh-f-lineHeigh112920 _fw-600" data-slot="text"><span class="is_View _fd-row _items-center _gap-6px"><span class="is_View _width-6px _height-6px _btlr-radius-full _btrr-radius-full _bbrr-radius-full _bblr-radius-full _bg-foreground"></span><span>Hanzo decision model · 0 output tokens</span></span></span></div></div><h1 class="is_Text font_heading _fs-_sm_f-size-11 _fs-_lg_text-6xl _col-foreground _dsp-revert-laye114 _ws-inherit _ff-f-family _fs-f-size-10 _fw-497 _lh-1--19 _ls--0--012em _textWrap-balance _width-10037 _maxW-900px" data-slot="display" id="_R_n5fiv5tf6bdb_">How to Use Kai</h1><p class="is_Text _textWrap-_platformweb_balance _col-muted-foreg108704142 _dsp-revert-laye114 _ws-inherit _fs-f-size-4 _lh-1--65 _ls-0px _textWrap-pretty _maxW-600px" data-slot="lede">Send a state and typed questions to <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">POST /v1/decisions</span> with <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">model: "kai"</span>. Kai answers each question with a probability for every answer it allows, and writes no text.</p><div class="is_View _fd-row _mt-c-space-2 _fwr-wrap _gap-c-space-3 _justify-center"><a class="is_Text _o-0hover-0--92 _bg-0hover-neutral-100 _col-0hover-pure-black _bg-_light_foreground _col-_light_background _bxsh-_light_04px16px-6p44459065 _bg-_light_0hover-foreground _col-_light_0hover-background _col-pure-black _dsp-inline-flex _items-center _ws-inherit _td-none _fs-f-size-2 _lh-calc1--250--87537940352 _justify-center _gap-c-space-2 _minH-44px _pr-c-space-5 _pl-c-space-5 _btlr-9999px _btrr-9999px _bbrr-9999px _bblr-9999px _fw-500 _backdropFilter-chrome-blur _WebkitBackdropFilter-chrome-blur _btw-0px _brw-0px _borderBottomWidth-0px _borderLeftWidth-0px _bg-pure-white _bxsh-04px20px-2p736498123 _bbs-solid _bts-solid _bls-solid _brs-solid" data-fill="" data-slot="action" href="https://platform.hanzo.ai/api-keys">Get an API key</a><a class="is_Text _bg-0hover-color-mixin40471350 _btc-0hover-white-22 _brc-0hover-white-22 _borderBottomColor-0hover-white-22 _borderLeftColor-0hover-white-22 _col-0hover-pure-white _btc-_light_color-mixin1775990597 _brc-_light_color-mixin1775990597 _borderBottomColor-_light_color-mixin1775990597 _borderLeftColor-_light_color-mixin1775990597 _bg-_light_color-mixin1432854749 _col-_light_foreground _bxsh-_light_02px10px-4p401273020 _btc-_light_0hover-color-mixin2108231940 _brc-_light_0hover-color-mixin2108231940 _borderBottomColor-_light_0hover-color-mixin2108231940 _borderLeftColor-_light_0hover-color-mixin2108231940 _bg-_light_0hover-pure-white _col-_light_0hover-foreground _col-foreground _dsp-inline-flex _items-center _ws-inherit _td-none _fs-f-size-2 _lh-calc1--250--87537940352 _justify-center _gap-c-space-2 _minH-44px _pr-c-space-5 _pl-c-space-5 _btlr-9999px _btrr-9999px _bbrr-9999px _bblr-9999px _fw-500 _backdropFilter-chrome-blur _WebkitBackdropFilter-chrome-blur _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _bts-solid _brs-solid _bbs-solid _bls-solid _btc-white-14 _brc-white-14 _borderBottomColor-white-14 _borderLeftColor-white-14 _bg-color-mixin1333059374 _bxsh-inset01px00639578201" data-slot="action" href="https://docs.hanzo.ai/docs/decisions">Read the reference</a></div></div></div></div></section><section class="is_View _ox-_platformweb_clip _oy-_platformweb_clip _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _pos-relative _pt-c-space-11 _pb-c-space-11 _pr-maxvar--pag1616741076 _pl-maxvar--pag1616741076 _btw-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bts-solid"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _width-10037 _maxW-960px _mr-auto _ml-auto"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _width-10037" data-motion="rise"><div class="is_View _text-_platformweb_center _dsp-grid _gridTemplateColumns-repeat1minm577740846 _gap-16px _shrink-1 _minW-auto _minH-auto _width-10037 _maxW-760px _mr-auto _ml-auto _mb-56px" data-slot="grid" style="font-family:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit"><p class="is_Text _col-muted-foreg108704142 _dsp-revert-laye114 _ws-inherit _fs-f-size-2 _fw-500 _lh-calc1--250--87537940352 _ls-0--2em _tt-uppercase" data-slot="eyebrow" style="min-width:0px">Questions</p><h2 class="is_Text font_heading _col-foreground _dsp-revert-laye114 _ws-inherit _ff-f-family _fs-f-size-7 _fw-497 _lh-1--2 _ls--0--01em _textWrap-balance _mt-c-space-3--53" data-slot="title" style="min-width:0px">Three question types</h2><p class="is_Text _col-muted-foreg108704142 _dsp-revert-laye114 _ws-inherit _fs-f-size-3 _lh-1--65 _ls-0px _textWrap-pretty _mt-c-space-3--53" data-slot="lede" style="min-width:0px">Name each question; its answer comes back under the same name.</p></div></div><div class="is_View _dsp-grid _gridTemplateColumns-repeatauto-1894226745 _gap-16px _shrink-1 _minW-auto _minH-auto" data-slot="grid" style="font-family:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><span class="is_Text _col-ink _fw-700 _mb-c-space-2" data-slot="text"><span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">choice</span></span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mb-c-space-2" data-slot="text">Send<!-- --> <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">criteria</span>: option → description, or a list of options.</span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921" data-slot="text">Get<!-- --> <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">choice</span>, <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">probabilities</span> (one per option, summing to 1), <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">confidence</span>.</span></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><span class="is_Text _col-ink _fw-700 _mb-c-space-2" data-slot="text"><span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">score</span></span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mb-c-space-2" data-slot="text">Send<!-- --> <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">criteria</span>: the levels, lowest first.</span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921" data-slot="text">Get<!-- --> <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">score</span> (the expected level index), <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">legend</span>, <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">probabilities</span> by level index.</span></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><span class="is_Text _col-ink _fw-700 _mb-c-space-2" data-slot="text"><span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">noul</span></span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mb-c-space-2" data-slot="text">Send<!-- --> <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">instructions</span>: a yes/no question.</span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921" data-slot="text">Get<!-- --> <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">noul</span>: P(true). kai-1.3, the default, does not read a noul’s <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">criteria</span>.</span></div></div></div></section><section class="is_View _ox-_platformweb_clip _oy-_platformweb_clip _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _pos-relative _pt-c-space-11 _pb-c-space-11 _pr-maxvar--pag1616741076 _pl-maxvar--pag1616741076 _btw-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _background-light-darkv807404606 _bts-solid"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _width-10037 _maxW-960px _mr-auto _ml-auto"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _width-10037" data-motion="rise"><div class="is_View _text-_platformweb_center _dsp-grid _gridTemplateColumns-repeat1minm577740846 _gap-16px _shrink-1 _minW-auto _minH-auto _width-10037 _maxW-760px _mr-auto _ml-auto _mb-56px" data-slot="grid" style="font-family:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit"><p class="is_Text _col-muted-foreg108704142 _dsp-revert-laye114 _ws-inherit _fs-f-size-2 _fw-500 _lh-calc1--250--87537940352 _ls-0--2em _tt-uppercase" data-slot="eyebrow" style="min-width:0px">Call it</p><h2 class="is_Text font_heading _col-foreground _dsp-revert-laye114 _ws-inherit _ff-f-family _fs-f-size-7 _fw-497 _lh-1--2 _ls--0--01em _textWrap-balance _mt-c-space-3--53" data-slot="title" style="min-width:0px">One request, three questions</h2><p class="is_Text _col-muted-foreg108704142 _dsp-revert-laye114 _ws-inherit _fs-f-size-3 _lh-1--65 _ls-0px _textWrap-pretty _mt-c-space-3--53" data-slot="lede" style="min-width:0px">Every response also carries id, model, usage (output_tokens is 0), routing (the checkpoint that answered: kai-1.3 for the model id kai), state_hash and latency_ms.</p></div></div><div class="is_View _dsp-grid _gridTemplateColumns-repeat1minm577740846 _gap-24px _shrink-1 _minW-auto _minH-auto" data-slot="grid" style="font-family:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-4 _pr-c-space-4 _pb-c-space-4 _pl-c-space-4 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><pre class="is_Text font_mono _bg-_platformweb_light-darkv602359144 _col-codeInk _fs-f-size-2 _lh-leading-rel3008278 _dsp-block _mt-0px _mr-0px _mb-0px _ml-0px _pt-16px _pr-16px _pb-16px _pl-16px _ox-auto _ws-pre _ff-f-family" data-slot="text"><code><span><span data-code="bright">curl</span><span data-code="ink"> </span><span data-code="bright">-sS</span><span data-code="ink"> </span><span data-code="bright">--fail-with-body</span><span data-code="ink"> </span><span data-code="key">https://api.hanzo.ai/v1/decisions</span><span data-code="ink"> </span><span data-code="punctuation">\</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="bright">-H</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">Authorization: Bearer </span><span data-code="punctuation">$</span><span data-code="string">HANZO_API_KEY</span><span data-code="punctuation">"</span><span data-code="ink"> </span><span data-code="punctuation">\</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="bright">-H</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">Content-Type: application/json</span><span data-code="punctuation">"</span><span data-code="ink"> </span><span data-code="punctuation">\</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="bright">-d</span><span data-code="ink"> </span><span data-code="punctuation">'</span><span data-code="string">{</span>
|
||
</span><span><span data-code="string"> "model": "kai",</span>
|
||
</span><span><span data-code="string"> "state": "Customer email: Cancel my plan immediately. Your service was down during our product launch.",</span>
|
||
</span><span><span data-code="string"> "questions": {</span>
|
||
</span><span><span data-code="string"> "department": {</span>
|
||
</span><span><span data-code="string"> "type": "choice",</span>
|
||
</span><span><span data-code="string"> "instructions": "Route ticket to appropriate team",</span>
|
||
</span><span><span data-code="string"> "criteria": {</span>
|
||
</span><span><span data-code="string"> "executive_escalations": "high-value customer cancellation threats",</span>
|
||
</span><span><span data-code="string"> "support": "general technical inquiries",</span>
|
||
</span><span><span data-code="string"> "billing": "standard invoice updates"</span>
|
||
</span><span><span data-code="string"> }</span>
|
||
</span><span><span data-code="string"> },</span>
|
||
</span><span><span data-code="string"> "urgency": {</span>
|
||
</span><span><span data-code="string"> "type": "score",</span>
|
||
</span><span><span data-code="string"> "instructions": "Rate ticket urgency",</span>
|
||
</span><span><span data-code="string"> "criteria": ["low", "normal", "high", "critical"]</span>
|
||
</span><span><span data-code="string"> },</span>
|
||
</span><span><span data-code="string"> "churn_risk": {</span>
|
||
</span><span><span data-code="string"> "type": "noul",</span>
|
||
</span><span><span data-code="string"> "instructions": "Is this account at risk of churning?"</span>
|
||
</span><span><span data-code="string"> }</span>
|
||
</span><span><span data-code="string"> }</span>
|
||
</span><span><span data-code="string"> }</span><span data-code="punctuation">'</span></span></code></pre></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-4 _pr-c-space-4 _pb-c-space-4 _pl-c-space-4 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><pre class="is_Text font_mono _bg-_platformweb_light-darkv602359144 _col-codeInk _fs-f-size-2 _lh-leading-rel3008278 _dsp-block _mt-0px _mr-0px _mb-0px _ml-0px _pt-16px _pr-16px _pb-16px _pl-16px _ox-auto _ws-pre _ff-f-family" data-slot="text"><code><span><span data-code="comment" data-face="italic"># pip install hanzoai</span>
|
||
</span><span><span data-code="keyword" data-face="bold">import</span><span data-code="ink"> os</span>
|
||
</span><span>
|
||
</span><span><span data-code="keyword" data-face="bold">from</span><span data-code="ink"> hanzoai</span><span data-code="punctuation">.</span><span data-code="ink">cloud </span><span data-code="keyword" data-face="bold">import</span><span data-code="ink"> ApiClient</span><span data-code="punctuation">,</span><span data-code="ink"> Configuration</span>
|
||
</span><span><span data-code="keyword" data-face="bold">from</span><span data-code="ink"> hanzoai</span><span data-code="punctuation">.</span><span data-code="ink">cloud</span><span data-code="punctuation">.</span><span data-code="ink">api </span><span data-code="keyword" data-face="bold">import</span><span data-code="ink"> AiApi</span>
|
||
</span><span><span data-code="keyword" data-face="bold">from</span><span data-code="ink"> hanzoai</span><span data-code="punctuation">.</span><span data-code="ink">cloud</span><span data-code="punctuation">.</span><span data-code="ink">models</span><span data-code="punctuation">.</span><span data-code="ink">ai_decisions_request </span><span data-code="keyword" data-face="bold">import</span><span data-code="ink"> AiDecisionsRequest</span>
|
||
</span><span>
|
||
</span><span><span data-code="ink">ai = AiApi</span><span data-code="punctuation">(</span><span data-code="ink">ApiClient</span><span data-code="punctuation">(</span><span data-code="ink">Configuration</span><span data-code="punctuation">(</span><span data-code="ink">access_token=os</span><span data-code="punctuation">.</span><span data-code="ink">environ</span><span data-code="punctuation">[</span><span data-code="punctuation">"</span><span data-code="string">HANZO_API_KEY</span><span data-code="punctuation">"</span><span data-code="punctuation">])))</span>
|
||
</span><span><span data-code="ink">decision = ai</span><span data-code="punctuation">.</span><span data-code="ink">post_decisions</span><span data-code="punctuation">(</span><span data-code="ink">AiDecisionsRequest</span><span data-code="punctuation">.</span><span data-code="ink">from_dict</span><span data-code="punctuation">({</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">model</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">kai</span><span data-code="punctuation">"</span><span data-code="punctuation">,</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">state</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">{</span><span data-code="punctuation">"</span><span data-code="string">ticket_id</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="number">4821</span><span data-code="punctuation">,</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">text</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">Can I get an extension on my payment due date?</span><span data-code="punctuation">"</span><span data-code="punctuation">},</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">questions</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">{</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">team</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">{</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">type</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">choice</span><span data-code="punctuation">"</span><span data-code="punctuation">,</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">instructions</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">Which team handles this?</span><span data-code="punctuation">"</span><span data-code="punctuation">,</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">criteria</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">{</span><span data-code="punctuation">"</span><span data-code="string">billing</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">invoices and payments</span><span data-code="punctuation">"</span><span data-code="punctuation">,</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">support</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">technical issues</span><span data-code="punctuation">"</span><span data-code="punctuation">},</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">},</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">is_churn_risk</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">{</span><span data-code="punctuation">"</span><span data-code="string">type</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">noul</span><span data-code="punctuation">"</span><span data-code="punctuation">,</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">instructions</span><span data-code="punctuation">"</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">Is the user churning?</span><span data-code="punctuation">"</span><span data-code="punctuation">},</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">},</span>
|
||
</span><span><span data-code="punctuation">}))</span>
|
||
</span><span>
|
||
</span><span><span data-code="bright">print</span><span data-code="punctuation">(</span><span data-code="ink">decision</span><span data-code="punctuation">.</span><span data-code="ink">answers</span><span data-code="punctuation">[</span><span data-code="punctuation">"</span><span data-code="string">team</span><span data-code="punctuation">"</span><span data-code="punctuation">].</span><span data-code="ink">choice</span><span data-code="punctuation">,</span><span data-code="ink"> decision</span><span data-code="punctuation">.</span><span data-code="ink">answers</span><span data-code="punctuation">[</span><span data-code="punctuation">"</span><span data-code="string">team</span><span data-code="punctuation">"</span><span data-code="punctuation">].</span><span data-code="ink">probabilities</span><span data-code="punctuation">)</span>
|
||
</span><span><span data-code="bright">print</span><span data-code="punctuation">(</span><span data-code="ink">decision</span><span data-code="punctuation">.</span><span data-code="ink">answers</span><span data-code="punctuation">[</span><span data-code="punctuation">"</span><span data-code="string">is_churn_risk</span><span data-code="punctuation">"</span><span data-code="punctuation">].</span><span data-code="ink">noul</span><span data-code="punctuation">)</span></span></code></pre></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-4 _pr-c-space-4 _pb-c-space-4 _pl-c-space-4 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><pre class="is_Text font_mono _bg-_platformweb_light-darkv602359144 _col-codeInk _fs-f-size-2 _lh-leading-rel3008278 _dsp-block _mt-0px _mr-0px _mb-0px _ml-0px _pt-16px _pr-16px _pb-16px _pl-16px _ox-auto _ws-pre _ff-f-family" data-slot="text"><code><span><span data-code="comment" data-face="italic">// npm install hanzoai</span>
|
||
</span><span><span data-code="keyword" data-face="bold">import</span><span data-code="ink"> </span><span data-code="punctuation">{</span><span data-code="ink"> AiApi</span><span data-code="punctuation">,</span><span data-code="ink"> Configuration </span><span data-code="punctuation">}</span><span data-code="ink"> </span><span data-code="keyword" data-face="bold">from</span><span data-code="ink"> </span><span data-code="punctuation">'</span><span data-code="string">hanzoai</span><span data-code="punctuation">'</span>
|
||
</span><span>
|
||
</span><span><span data-code="keyword" data-face="bold">const</span><span data-code="ink"> ai = new </span><span data-code="bright">AiApi</span><span data-code="punctuation">(</span><span data-code="ink">new </span><span data-code="bright">Configuration</span><span data-code="punctuation">({</span><span data-code="ink"> </span><span data-code="key">accessToken</span><span data-code="punctuation">:</span><span data-code="ink"> process.env.HANZO_API_KEY </span><span data-code="punctuation">}))</span>
|
||
</span><span><span data-code="keyword" data-face="bold">const</span><span data-code="ink"> </span><span data-code="punctuation">{</span><span data-code="ink"> data</span><span data-code="punctuation">:</span><span data-code="ink"> decision </span><span data-code="punctuation">}</span><span data-code="ink"> = </span><span data-code="keyword" data-face="bold">await</span><span data-code="ink"> ai.</span><span data-code="bright">postDecisions</span><span data-code="punctuation">({</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="key">aiDecisionsRequest</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">{</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="key">model</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">'</span><span data-code="string">kai</span><span data-code="punctuation">'</span><span data-code="punctuation">,</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="key">state</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">{</span><span data-code="ink"> </span><span data-code="key">pull_request</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="number">104</span><span data-code="punctuation">,</span><span data-code="ink"> </span><span data-code="key">diff_lines</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="number">480</span><span data-code="punctuation">,</span><span data-code="ink"> </span><span data-code="key">files</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">[</span><span data-code="punctuation">'</span><span data-code="string">auth.ts</span><span data-code="punctuation">'</span><span data-code="punctuation">,</span><span data-code="ink"> </span><span data-code="punctuation">'</span><span data-code="string">token.go</span><span data-code="punctuation">'</span><span data-code="punctuation">]</span><span data-code="ink"> </span><span data-code="punctuation">},</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="key">questions</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">{</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="key">risk</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">{</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="key">type</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">'</span><span data-code="string">score</span><span data-code="punctuation">'</span><span data-code="punctuation">,</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="key">instructions</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">'</span><span data-code="string">Rate security risk of code change</span><span data-code="punctuation">'</span><span data-code="punctuation">,</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="key">criteria</span><span data-code="punctuation">:</span><span data-code="ink"> </span><span data-code="punctuation">[</span><span data-code="punctuation">'</span><span data-code="string">low: documentation or cosmetic</span><span data-code="punctuation">'</span><span data-code="punctuation">,</span><span data-code="ink"> </span><span data-code="punctuation">'</span><span data-code="string">medium: internal logic</span><span data-code="punctuation">'</span><span data-code="punctuation">,</span><span data-code="ink"> </span><span data-code="punctuation">'</span><span data-code="string">high: security or auth paths</span><span data-code="punctuation">'</span><span data-code="punctuation">],</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">},</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">},</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="punctuation">},</span>
|
||
</span><span><span data-code="punctuation">})</span>
|
||
</span><span>
|
||
</span><span><span data-code="ink">console.</span><span data-code="bright">log</span><span data-code="punctuation">(</span><span data-code="ink">decision.answers.risk.score</span><span data-code="punctuation">,</span><span data-code="ink"> decision.answers.risk.probabilities</span><span data-code="punctuation">)</span></span></code></pre></div></div></div></section><section class="is_View _ox-_platformweb_clip _oy-_platformweb_clip _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _pos-relative _pt-c-space-11 _pb-c-space-11 _pr-maxvar--pag1616741076 _pl-maxvar--pag1616741076 _btw-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bts-solid"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _width-10037 _maxW-960px _mr-auto _ml-auto"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _width-10037" data-motion="rise"><div class="is_View _text-_platformweb_center _dsp-grid _gridTemplateColumns-repeat1minm577740846 _gap-16px _shrink-1 _minW-auto _minH-auto _width-10037 _maxW-760px _mr-auto _ml-auto _mb-56px" data-slot="grid" style="font-family:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit"><p class="is_Text _col-muted-foreg108704142 _dsp-revert-laye114 _ws-inherit _fs-f-size-2 _fw-500 _lh-calc1--250--87537940352 _ls-0--2em _tt-uppercase" data-slot="eyebrow" style="min-width:0px">Limits</p><h2 class="is_Text font_heading _col-foreground _dsp-revert-laye114 _ws-inherit _ff-f-family _fs-f-size-7 _fw-497 _lh-1--2 _ls--0--01em _textWrap-balance _mt-c-space-3--53" data-slot="title" style="min-width:0px">What a request may hold</h2></div></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto"><div class="is_View _fd-row _gap-c-space-4 _pt-c-space-3 _pb-c-space-3 _btw-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _items-baseline _fwr-wrap _bts-solid"><span class="is_Text _width-_maxsm_10037 _col-ink _width-120px _fs-f-size-3 _lh-f-lineHeigh112922 _fw-600" data-slot="text">Model</span><span class="is_Text _col-muted-foreg108704142 _grow-1 _shrink-1 _fb-0px _minW-240px _fs-f-size-2 _lh-f-lineHeigh112921" data-slot="text">The model id <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">kai</span> answers from kai-1.3, the default. Ask for <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">kai-1.4</span> by id for the unified version: one encoder and one head, trained on long states. Ask for <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">kai-1.5</span> by id for the agentic preview: whether a tool fits a request, and whether to call one at all.</span></div><div class="is_View _fd-row _gap-c-space-4 _pt-c-space-3 _pb-c-space-3 _btw-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _items-baseline _fwr-wrap _bts-solid"><span class="is_Text _width-_maxsm_10037 _col-ink _width-120px _fs-f-size-3 _lh-f-lineHeigh112922 _fw-600" data-slot="text">Questions</span><span class="is_Text _col-muted-foreg108704142 _grow-1 _shrink-1 _fb-0px _minW-240px _fs-f-size-2 _lh-f-lineHeigh112921" data-slot="text">Up to 100 a request; 101 is refused with 422.</span></div><div class="is_View _fd-row _gap-c-space-4 _pt-c-space-3 _pb-c-space-3 _btw-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _items-baseline _fwr-wrap _bts-solid"><span class="is_Text _width-_maxsm_10037 _col-ink _width-120px _fs-f-size-3 _lh-f-lineHeigh112922 _fw-600" data-slot="text">State</span><span class="is_Text _col-muted-foreg108704142 _grow-1 _shrink-1 _fb-0px _minW-240px _fs-f-size-2 _lh-f-lineHeigh112921" data-slot="text">kai-1.3, the default, was trained on 1,024 tokens of state beside each question. Up to 32,768 is answered with <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">routing.extrapolated: true</span> and is unreliable: a fact at the end of a 3,982-token state read 0.507. <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">kai-1.4</span> was trained on long states and marks no read up to 32,768 extrapolated. Past 32,768 the answer is 422 <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">state_too_long</span>.</span></div><div class="is_View _fd-row _gap-c-space-4 _pt-c-space-3 _pb-c-space-3 _btw-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _items-baseline _fwr-wrap _bts-solid"><span class="is_Text _width-_maxsm_10037 _col-ink _width-120px _fs-f-size-3 _lh-f-lineHeigh112922 _fw-600" data-slot="text">Time</span><span class="is_Text _col-muted-foreg108704142 _grow-1 _shrink-1 _fb-0px _minW-240px _fs-f-size-2 _lh-f-lineHeigh112921" data-slot="text">One yes/no question takes <1 ms of server time at p50 in production on GPU (0.27 ms cached in process). Every response reports its own <span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">latency_ms</span>.</span></div><div class="is_View _fd-row _gap-c-space-4 _pt-c-space-3 _pb-c-space-3 _btw-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _items-baseline _fwr-wrap _bts-solid"><span class="is_Text _width-_maxsm_10037 _col-ink _width-120px _fs-f-size-3 _lh-f-lineHeigh112922 _fw-600" data-slot="text">Price</span><span class="is_Text _col-muted-foreg108704142 _grow-1 _shrink-1 _fb-0px _minW-240px _fs-f-size-2 _lh-f-lineHeigh112921" data-slot="text">$0.021 per million input tokens; output is free. Jev costs $0.042.</span></div></div></div></section><section class="is_View _ox-_platformweb_clip _oy-_platformweb_clip _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _pos-relative _pt-c-space-11 _pb-c-space-11 _pr-maxvar--pag1616741076 _pl-maxvar--pag1616741076 _btw-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bts-solid"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _width-10037 _maxW-960px _mr-auto _ml-auto"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _width-10037" data-motion="rise"><div class="is_View _text-_platformweb_center _dsp-grid _gridTemplateColumns-repeat1minm577740846 _gap-16px _shrink-1 _minW-auto _minH-auto _width-10037 _maxW-760px _mr-auto _ml-auto _mb-56px" data-slot="grid" style="font-family:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit"><p class="is_Text _col-muted-foreg108704142 _dsp-revert-laye114 _ws-inherit _fs-f-size-2 _fw-500 _lh-calc1--250--87537940352 _ls-0--2em _tt-uppercase" data-slot="eyebrow" style="min-width:0px">Recipes & Blueprints</p><h2 class="is_Text font_heading _col-foreground _dsp-revert-laye114 _ws-inherit _ff-f-family _fs-f-size-7 _fw-497 _lh-1--2 _ls--0--01em _textWrap-balance _mt-c-space-3--53" data-slot="title" style="min-width:0px">Composable Decision Recipes</h2><p class="is_Text _col-muted-foreg108704142 _dsp-revert-laye114 _ws-inherit _fs-f-size-3 _lh-1--65 _ls-0px _textWrap-pretty _mt-c-space-3--53" data-slot="lede" style="min-width:0px">Modular Rust structs and TypeScript workflows that sit inside your pipelines: retail triage, industrial diagnostics, confidence routing, and agent loops.</p></div></div><div class="is_View _dsp-grid _gridTemplateColumns-repeatauto-44935301 _gap-16px _shrink-1 _minW-auto _minH-auto" data-slot="grid" style="font-family:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><span class="is_Text _col-ink _fw-700 _mb-c-space-2" data-slot="text"><span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">recipes::retail</span></span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mb-c-space-3" data-slot="text">Shelf inventory triage, return fraud checks, and corporate pricing safety guardrails.</span></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><span class="is_Text _col-ink _fw-700 _mb-c-space-2" data-slot="text"><span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">recipes::industrial</span></span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mb-c-space-3" data-slot="text">Multi-criteria powertrain trade studies and telemetry equipment readiness gating.</span></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><span class="is_Text _col-ink _fw-700 _mb-c-space-2" data-slot="text"><span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">recipes::routing</span></span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mb-c-space-3" data-slot="text">Confidence margin gates that stand on high-certainty decisions and escalate low-confidence queries to Zen.</span></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><span class="is_Text _col-ink _fw-700 _mb-c-space-2" data-slot="text"><span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">recipes::zen</span></span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mb-c-space-3" data-slot="text">OpenAI-compatible request builders and SSE stream accumulators for reasoning thought tokens.</span></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><span class="is_Text _col-ink _fw-700 _mb-c-space-2" data-slot="text"><span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">recipes::kata</span></span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mb-c-space-3" data-slot="text">Autonomous test-and-repair agent state machine gating code patch generation vs human review.</span></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><span class="is_Text _col-ink _fw-700 _mb-c-space-2" data-slot="text"><span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">recipes::gen</span></span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mb-c-space-3" data-slot="text">Conversational assistant harness managing multi-turn history and Model Context Protocol (MCP) dispatch.</span></div></div><div class="is_View _fd-row _mt-c-space-6 _fwr-wrap _gap-c-space-4"><a class="is_Text _bg-0hover-color-mixin40471350 _btc-0hover-white-22 _brc-0hover-white-22 _borderBottomColor-0hover-white-22 _borderLeftColor-0hover-white-22 _col-0hover-pure-white _btc-_light_color-mixin1775990597 _brc-_light_color-mixin1775990597 _borderBottomColor-_light_color-mixin1775990597 _borderLeftColor-_light_color-mixin1775990597 _bg-_light_color-mixin1432854749 _col-_light_foreground _bxsh-_light_02px10px-4p401273020 _btc-_light_0hover-color-mixin2108231940 _brc-_light_0hover-color-mixin2108231940 _borderBottomColor-_light_0hover-color-mixin2108231940 _borderLeftColor-_light_0hover-color-mixin2108231940 _bg-_light_0hover-pure-white _col-_light_0hover-foreground _col-foreground _dsp-inline-flex _items-center _ws-inherit _td-none _fs-f-size-2 _lh-calc1--250--87537940352 _justify-center _gap-c-space-2 _minH-44px _pr-c-space-5 _pl-c-space-5 _btlr-9999px _btrr-9999px _bbrr-9999px _bblr-9999px _fw-500 _backdropFilter-chrome-blur _WebkitBackdropFilter-chrome-blur _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _bts-solid _brs-solid _bbs-solid _bls-solid _btc-white-14 _brc-white-14 _borderBottomColor-white-14 _borderLeftColor-white-14 _bg-color-mixin1333059374 _bxsh-inset01px00639578201" data-slot="action" href="https://docs.hanzo.ai/docs/guides/cookbook/recipes">Read the Recipes Guide</a><a class="is_Text _bg-0hover-color-mixin40471350 _btc-0hover-white-22 _brc-0hover-white-22 _borderBottomColor-0hover-white-22 _borderLeftColor-0hover-white-22 _col-0hover-pure-white _btc-_light_color-mixin1775990597 _brc-_light_color-mixin1775990597 _borderBottomColor-_light_color-mixin1775990597 _borderLeftColor-_light_color-mixin1775990597 _bg-_light_color-mixin1432854749 _col-_light_foreground _bxsh-_light_02px10px-4p401273020 _btc-_light_0hover-color-mixin2108231940 _brc-_light_0hover-color-mixin2108231940 _borderBottomColor-_light_0hover-color-mixin2108231940 _borderLeftColor-_light_0hover-color-mixin2108231940 _bg-_light_0hover-pure-white _col-_light_0hover-foreground _col-foreground _dsp-inline-flex _items-center _ws-inherit _td-none _fs-f-size-2 _lh-calc1--250--87537940352 _justify-center _gap-c-space-2 _minH-44px _pr-c-space-5 _pl-c-space-5 _btlr-9999px _btrr-9999px _bbrr-9999px _bblr-9999px _fw-500 _backdropFilter-chrome-blur _WebkitBackdropFilter-chrome-blur _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _bts-solid _brs-solid _bbs-solid _bls-solid _btc-white-14 _brc-white-14 _borderBottomColor-white-14 _borderLeftColor-white-14 _bg-color-mixin1333059374 _bxsh-inset01px00639578201" data-slot="action" href="https://docs.hanzo.ai/docs/guides/cookbook">View All Cookbook Pipelines</a><a class="is_Text _bg-0hover-color-mixin40471350 _btc-0hover-white-22 _brc-0hover-white-22 _borderBottomColor-0hover-white-22 _borderLeftColor-0hover-white-22 _col-0hover-pure-white _btc-_light_color-mixin1775990597 _brc-_light_color-mixin1775990597 _borderBottomColor-_light_color-mixin1775990597 _borderLeftColor-_light_color-mixin1775990597 _bg-_light_color-mixin1432854749 _col-_light_foreground _bxsh-_light_02px10px-4p401273020 _btc-_light_0hover-color-mixin2108231940 _brc-_light_0hover-color-mixin2108231940 _borderBottomColor-_light_0hover-color-mixin2108231940 _borderLeftColor-_light_0hover-color-mixin2108231940 _bg-_light_0hover-pure-white _col-_light_0hover-foreground _col-foreground _dsp-inline-flex _items-center _ws-inherit _td-none _fs-f-size-2 _lh-calc1--250--87537940352 _justify-center _gap-c-space-2 _minH-44px _pr-c-space-5 _pl-c-space-5 _btlr-9999px _btrr-9999px _bbrr-9999px _bblr-9999px _fw-500 _backdropFilter-chrome-blur _WebkitBackdropFilter-chrome-blur _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _bts-solid _brs-solid _bbs-solid _bls-solid _btc-white-14 _brc-white-14 _borderBottomColor-white-14 _borderLeftColor-white-14 _bg-color-mixin1333059374 _bxsh-inset01px00639578201" data-slot="action" href="https://github.com/hanzoai/kai/tree/main/recipes" rel="noopener noreferrer" target="_blank">Kai recipes on GitHub ↗</a></div></div></section><section class="is_View _ox-_platformweb_clip _oy-_platformweb_clip _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _pos-relative _pt-c-space-11 _pb-c-space-11 _pr-maxvar--pag1616741076 _pl-maxvar--pag1616741076 _btw-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _background-light-darkv807404606 _bts-solid"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _width-10037 _maxW-960px _mr-auto _ml-auto"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _width-10037" data-motion="rise"><div class="is_View _text-_platformweb_center _dsp-grid _gridTemplateColumns-repeat1minm577740846 _gap-16px _shrink-1 _minW-auto _minH-auto _width-10037 _maxW-760px _mr-auto _ml-auto _mb-56px" data-slot="grid" style="font-family:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit"><p class="is_Text _col-muted-foreg108704142 _dsp-revert-laye114 _ws-inherit _fs-f-size-2 _fw-500 _lh-calc1--250--87537940352 _ls-0--2em _tt-uppercase" data-slot="eyebrow" style="min-width:0px">Coming from Jev</p><h2 class="is_Text font_heading _col-foreground _dsp-revert-laye114 _ws-inherit _ff-f-family _fs-f-size-7 _fw-497 _lh-1--2 _ls--0--01em _textWrap-balance _mt-c-space-3--53" data-slot="title" style="min-width:0px">Change the URL, the key and the model</h2><p class="is_Text _col-muted-foreg108704142 _dsp-revert-laye114 _ws-inherit _fs-f-size-3 _lh-1--65 _ls-0px _textWrap-pretty _mt-c-space-3--53" data-slot="lede" style="min-width:0px">Kai takes the request body Jev takes. The same endpoint also serves typesafe/jev-1.13 with a Hanzo key, at Jev’s price.</p></div></div><div class="is_View _dsp-grid _gridTemplateColumns-repeatauto-222230951 _gap-20px _shrink-1 _minW-auto _minH-auto" data-slot="grid" style="font-family:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit"><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><pre class="is_Text font_mono _bg-_platformweb_light-darkv602359144 _col-codeInk _fs-f-size-2 _lh-leading-rel3008278 _dsp-block _mt-0px _mr-0px _mb-0px _ml-0px _pt-16px _pr-16px _pb-16px _pl-16px _ox-auto _ws-pre _ff-f-family" data-slot="text"><code><span><span data-code="comment" data-face="italic"># Jev on OpenRouter</span>
|
||
</span><span><span data-code="bright">curl</span><span data-code="ink"> </span><span data-code="key">https://openrouter.ai/api/alpha/decisions</span><span data-code="ink"> </span><span data-code="punctuation">\</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="bright">-H</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">Authorization: Bearer </span><span data-code="punctuation">$</span><span data-code="string">OPENROUTER_API_KEY</span><span data-code="punctuation">"</span><span data-code="ink"> </span><span data-code="punctuation">\</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="bright">-H</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">Content-Type: application/json</span><span data-code="punctuation">"</span><span data-code="ink"> </span><span data-code="punctuation">\</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="bright">-d</span><span data-code="ink"> </span><span data-code="punctuation">'</span><span data-code="string">{"model": "typesafe/jev-1.13", "state": "…", "questions": {…}}</span><span data-code="punctuation">'</span></span></code></pre></div><div class="is_View _fd-column _dsp-block _shrink-1 _minH-auto _minW-auto _btlr-radius-2xl _btrr-radius-2xl _bbrr-radius-2xl _bblr-radius-2xl _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _btc-border _brc-border _borderBottomColor-border _borderLeftColor-border _bg-panel _pt-c-space-5 _pr-c-space-5 _pb-c-space-5 _pl-c-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid" style="min-width:0px"><pre class="is_Text font_mono _bg-_platformweb_light-darkv602359144 _col-codeInk _fs-f-size-2 _lh-leading-rel3008278 _dsp-block _mt-0px _mr-0px _mb-0px _ml-0px _pt-16px _pr-16px _pb-16px _pl-16px _ox-auto _ws-pre _ff-f-family" data-slot="text"><code><span><span data-code="comment" data-face="italic"># Kai on Hanzo: the same body</span>
|
||
</span><span><span data-code="bright">curl</span><span data-code="ink"> </span><span data-code="key">https://api.hanzo.ai/v1/decisions</span><span data-code="ink"> </span><span data-code="punctuation">\</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="bright">-H</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">Authorization: Bearer </span><span data-code="punctuation">$</span><span data-code="string">HANZO_API_KEY</span><span data-code="punctuation">"</span><span data-code="ink"> </span><span data-code="punctuation">\</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="bright">-H</span><span data-code="ink"> </span><span data-code="punctuation">"</span><span data-code="string">Content-Type: application/json</span><span data-code="punctuation">"</span><span data-code="ink"> </span><span data-code="punctuation">\</span>
|
||
</span><span><span data-code="ink"> </span><span data-code="bright">-d</span><span data-code="ink"> </span><span data-code="punctuation">'</span><span data-code="string">{"model": "kai", "state": "…", "questions": {…}}</span><span data-code="punctuation">'</span></span></code></pre></div></div><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mt-c-space-6" data-slot="text">What differs: Kai answers at most <!-- -->100<!-- --> questions a request, refuses a state past <!-- -->32,768<!-- --> tokens with <!-- -->422<!-- -->, and kai-1.3, the default, ignores a noul’s criteria. OpenAI’s Decisions body (<span class="is_Text font_mono _col-color _ff-f-family" data-slot="text">input</span> and a list of questions) is refused.</span><span class="is_Text _col-muted-foreg108704142 _fs-f-size-2 _lh-f-lineHeigh112921 _mt-c-space-4" data-slot="text">On the frozen harness, kai-1.4 averaged 84.4% accuracy against Jev’s 76.6% across the 11 suites it leads, both models on the same questions.</span><div class="is_View _fd-row _mt-c-space-4"><a class="is_Text _col-0hover-pure-white _col-_light_muted-foreg108704142 _col-_light_0hover-foreground _col-neutral-300 _dsp-inline-flex _items-center _ws-inherit _td-none _fs-f-size-2 _lh-calc1--250--87537940352 _gap-c-space-2 _fw-500" data-slot="more" href="/kai#benchmarks">The runs →</a></div></div></section> |