import{s as Rl,o as vl,n as $}from"../chunks/scheduler.ddeee2a5.js";import{S as Vl,i as Yl,e as g,s as j,c as y,h as Xl,a as b,d as p,b as I,f as Wl,g as r,j as q,k as hs,l as _l,m as T,n as i,t as c,o as u,p as U}from"../chunks/index.10b70568.js";import{C as Hl}from"../chunks/CopyLLMTxtMenu.68696f97.js";import{C as B}from"../chunks/CodeBlock.7ca4c11d.js";import{H as A,E as zl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d66d689f.js";import{H as Z,a as C}from"../chunks/HfOption.1e773499.js";function Fl(w){let l,e;return l=new B({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwb3BlbmFpJTIwaW1wb3J0JTIwT3BlbkFJJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5nZXRlbnYoJTIySEZfVE9LRU4lMjIpJTJDJTBBKSUwQSUwQXJlc3BvbnNlJTIwJTNEJTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0QlMjJvcGVuYWklMkZncHQtb3NzLTEyMGIlM0Fncm9xJTIyJTJDJTBBJTIwJTIwJTIwJTIwaW5zdHJ1Y3Rpb25zJTNEJTIyWW91JTIwYXJlJTIwYSUyMGhlbHBmdWwlMjBhc3Npc3RhbnQuJTIyJTJDJTBBJTIwJTIwJTIwJTIwaW5wdXQlM0QlMjJUZWxsJTIwbWUlMjBhJTIwdGhyZWUtc2VudGVuY2UlMjBiZWR0aW1lJTIwc3RvcnklMjBhYm91dCUyMGElMjB1bmljb3JuLiUyMiUyQyUwQSklMEElMEFwcmludChyZXNwb25zZS5vdXRwdXRfdGV4dCk=",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.getenv(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>),
)

response = client.responses.create(
    model=<span class="hljs-string">&quot;openai/gpt-oss-120b:groq&quot;</span>,
    instructions=<span class="hljs-string">&quot;You are a helpful assistant.&quot;</span>,
    <span class="hljs-built_in">input</span>=<span class="hljs-string">&quot;Tell me a three-sentence bedtime story about a unicorn.&quot;</span>,
)

<span class="hljs-built_in">print</span>(response.output_text)`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function Ll(w){let l,e;return l=new B({props:{code:"aW1wb3J0JTIwT3BlbkFJJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjByZXNwb25zZSUyMCUzRCUyMGF3YWl0JTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTdCJTBBJTIwJTIwbW9kZWwlM0ElMjAlMjJvcGVuYWklMkZncHQtb3NzLTEyMGIlM0Fncm9xJTIyJTJDJTBBJTIwJTIwaW5zdHJ1Y3Rpb25zJTNBJTIwJTIyWW91JTIwYXJlJTIwYSUyMGhlbHBmdWwlMjBhc3Npc3RhbnQuJTIyJTJDJTBBJTIwJTIwaW5wdXQlM0ElMjAlMjJUZWxsJTIwbWUlMjBhJTIwdGhyZWUtc2VudGVuY2UlMjBiZWR0aW1lJTIwc3RvcnklMjBhYm91dCUyMGElMjB1bmljb3JuLiUyMiUyQyUwQSU3RCklM0IlMEElMEFjb25zb2xlLmxvZyhyZXNwb25zZS5vdXRwdXRfdGV4dCklM0I=",highlighted:`<span class="hljs-keyword">import</span> <span class="hljs-title class_">OpenAI</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> client.<span class="hljs-property">responses</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;openai/gpt-oss-120b:groq&quot;</span>,
  <span class="hljs-attr">instructions</span>: <span class="hljs-string">&quot;You are a helpful assistant.&quot;</span>,
  <span class="hljs-attr">input</span>: <span class="hljs-string">&quot;Tell me a three-sentence bedtime story about a unicorn.&quot;</span>,
});

<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(response.<span class="hljs-property">output_text</span>);`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function xl(w){let l,e;return l=new B({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZyZXNwb25zZXMlMjAlNUMlMEElMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMC1IJTIwJTIyQ29udGVudC1UeXBlJTNBJTIwYXBwbGljYXRpb24lMkZqc29uJTIyJTIwJTVDJTBBJTIwJTIwLWQlMjAnJTdCJTBBJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJvcGVuYWklMkZncHQtb3NzLTEyMGIlM0Fncm9xJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyaW5zdHJ1Y3Rpb25zJTIyJTNBJTIwJTIyWW91JTIwYXJlJTIwYSUyMGhlbHBmdWwlMjBhc3Npc3RhbnQuJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyaW5wdXQlMjIlM0ElMjAlMjJUZWxsJTIwbWUlMjBhJTIwdGhyZWUtc2VudGVuY2UlMjBiZWR0aW1lJTIwc3RvcnklMjBhYm91dCUyMGElMjB1bmljb3JuLiUyMiUwQSUyMCUyMCU3RCc=",highlighted:`curl https://router.huggingface.co/v1/responses \\
  -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
  -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \\
  -d <span class="hljs-string">&#x27;{
    &quot;model&quot;: &quot;openai/gpt-oss-120b:groq&quot;,
    &quot;instructions&quot;: &quot;You are a helpful assistant.&quot;,
    &quot;input&quot;: &quot;Tell me a three-sentence bedtime story about a unicorn.&quot;
  }&#x27;</span>`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function Kl(w){let l,e,s,o,J,h;return l=new C({props:{id:"responses-first-call",option:"python",$$slots:{default:[Fl]},$$scope:{ctx:w}}}),s=new C({props:{id:"responses-first-call",option:"typescript",$$slots:{default:[Ll]},$$scope:{ctx:w}}}),J=new C({props:{id:"responses-first-call",option:"curl",$$slots:{default:[xl]},$$scope:{ctx:w}}}),{c(){y(l.$$.fragment),e=j(),y(s.$$.fragment),o=j(),y(J.$$.fragment)},l(n){r(l.$$.fragment,n),e=I(n),r(s.$$.fragment,n),o=I(n),r(J.$$.fragment,n)},m(n,a){i(l,n,a),T(n,e,a),i(s,n,a),T(n,o,a),i(J,n,a),h=!0},p(n,a){const d={};a&2&&(d.$$scope={dirty:a,ctx:n}),l.$set(d);const f={};a&2&&(f.$$scope={dirty:a,ctx:n}),s.$set(f);const m={};a&2&&(m.$$scope={dirty:a,ctx:n}),J.$set(m)},i(n){h||(c(l.$$.fragment,n),c(s.$$.fragment,n),c(J.$$.fragment,n),h=!0)},o(n){u(l.$$.fragment,n),u(s.$$.fragment,n),u(J.$$.fragment,n),h=!1},d(n){n&&(p(e),p(o)),U(l,n),U(s,n),U(J,n)}}}function Dl(w){let l,e;return l=new B({props:{code:"ZnJvbSUyMG9wZW5haSUyMGltcG9ydCUyME9wZW5BSSUwQWltcG9ydCUyMG9zJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5nZXRlbnYoJTIySEZfVE9LRU4lMjIpJTJDJTBBKSUwQSUwQXJlc3BvbnNlJTIwJTNEJTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0QlMjJtb29uc2hvdGFpJTJGS2ltaS1LMi1JbnN0cnVjdC0wOTA1JTNBZ3JvcSUyMiUyQyUwQSUyMCUyMCUyMCUyMGluc3RydWN0aW9ucyUzRCUyMllvdSUyMGFyZSUyMGElMjBoZWxwZnVsJTIwYXNzaXN0YW50LiUyMiUyQyUwQSUyMCUyMCUyMCUyMGlucHV0JTNEJTIyVGVsbCUyMG1lJTIwYSUyMHRocmVlJTIwc2VudGVuY2UlMjBiZWR0aW1lJTIwc3RvcnklMjBhYm91dCUyMGElMjB1bmljb3JuLiUyMiUyQyUwQSklMEElMEFwcmludChyZXNwb25zZS5vdXRwdXRfdGV4dCk=",highlighted:`<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI
<span class="hljs-keyword">import</span> os

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.getenv(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>),
)

response = client.responses.create(
    model=<span class="hljs-string">&quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;</span>,
    instructions=<span class="hljs-string">&quot;You are a helpful assistant.&quot;</span>,
    <span class="hljs-built_in">input</span>=<span class="hljs-string">&quot;Tell me a three sentence bedtime story about a unicorn.&quot;</span>,
)

<span class="hljs-built_in">print</span>(response.output_text)`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function Ol(w){let l,e;return l=new B({props:{code:"aW1wb3J0JTIwT3BlbkFJJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjByZXNwb25zZSUyMCUzRCUyMGF3YWl0JTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTdCJTBBJTIwJTIwbW9kZWwlM0ElMjAlMjJtb29uc2hvdGFpJTJGS2ltaS1LMi1JbnN0cnVjdC0wOTA1JTNBZ3JvcSUyMiUyQyUwQSUyMCUyMGluc3RydWN0aW9ucyUzQSUyMCUyMllvdSUyMGFyZSUyMGElMjBoZWxwZnVsJTIwYXNzaXN0YW50LiUyMiUyQyUwQSUyMCUyMGlucHV0JTNBJTIwJTIyVGVsbCUyMG1lJTIwYSUyMHRocmVlJTIwc2VudGVuY2UlMjBiZWR0aW1lJTIwc3RvcnklMjBhYm91dCUyMGElMjB1bmljb3JuLiUyMiUyQyUwQSU3RCklM0IlMEElMEFjb25zb2xlLmxvZyhyZXNwb25zZS5vdXRwdXRfdGV4dCklM0I=",highlighted:`<span class="hljs-keyword">import</span> <span class="hljs-title class_">OpenAI</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> client.<span class="hljs-property">responses</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;</span>,
  <span class="hljs-attr">instructions</span>: <span class="hljs-string">&quot;You are a helpful assistant.&quot;</span>,
  <span class="hljs-attr">input</span>: <span class="hljs-string">&quot;Tell me a three sentence bedtime story about a unicorn.&quot;</span>,
});

<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(response.<span class="hljs-property">output_text</span>);`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function Pl(w){let l,e;return l=new B({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZyZXNwb25zZXMlMjAlNUMlMEElMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMC1IJTIwJTIyQ29udGVudC1UeXBlJTNBJTIwYXBwbGljYXRpb24lMkZqc29uJTIyJTIwJTVDJTBBJTIwJTIwLWQlMjAnJTdCJTBBJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJtb29uc2hvdGFpJTJGS2ltaS1LMi1JbnN0cnVjdC0wOTA1JTNBZ3JvcSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMmluc3RydWN0aW9ucyUyMiUzQSUyMCUyMllvdSUyMGFyZSUyMGElMjBoZWxwZnVsJTIwYXNzaXN0YW50LiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMmlucHV0JTIyJTNBJTIwJTIyVGVsbCUyMG1lJTIwYSUyMHRocmVlJTIwc2VudGVuY2UlMjBiZWR0aW1lJTIwc3RvcnklMjBhYm91dCUyMGElMjB1bmljb3JuLiUyMiUwQSUyMCUyMCU3RCc=",highlighted:`curl https://router.huggingface.co/v1/responses \\
  -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
  -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \\
  -d <span class="hljs-string">&#x27;{
    &quot;model&quot;: &quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;,
    &quot;instructions&quot;: &quot;You are a helpful assistant.&quot;,
    &quot;input&quot;: &quot;Tell me a three sentence bedtime story about a unicorn.&quot;
  }&#x27;</span>`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function st(w){let l,e,s,o,J,h;return l=new C({props:{id:"responses-text",option:"python",$$slots:{default:[Dl]},$$scope:{ctx:w}}}),s=new C({props:{id:"responses-text",option:"typescript",$$slots:{default:[Ol]},$$scope:{ctx:w}}}),J=new C({props:{id:"responses-text",option:"curl",$$slots:{default:[Pl]},$$scope:{ctx:w}}}),{c(){y(l.$$.fragment),e=j(),y(s.$$.fragment),o=j(),y(J.$$.fragment)},l(n){r(l.$$.fragment,n),e=I(n),r(s.$$.fragment,n),o=I(n),r(J.$$.fragment,n)},m(n,a){i(l,n,a),T(n,e,a),i(s,n,a),T(n,o,a),i(J,n,a),h=!0},p(n,a){const d={};a&2&&(d.$$scope={dirty:a,ctx:n}),l.$set(d);const f={};a&2&&(f.$$scope={dirty:a,ctx:n}),s.$set(f);const m={};a&2&&(m.$$scope={dirty:a,ctx:n}),J.$set(m)},i(n){h||(c(l.$$.fragment,n),c(s.$$.fragment,n),c(J.$$.fragment,n),h=!0)},o(n){u(l.$$.fragment,n),u(s.$$.fragment,n),u(J.$$.fragment,n),h=!1},d(n){n&&(p(e),p(o)),U(l,n),U(s,n),U(J,n)}}}function lt(w){let l,e;return l=new B({props:{code:"ZnJvbSUyMG9wZW5haSUyMGltcG9ydCUyME9wZW5BSSUwQWltcG9ydCUyMG9zJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5nZXRlbnYoJTIySEZfVE9LRU4lMjIpJTJDJTBBKSUwQSUwQXJlc3BvbnNlJTIwJTNEJTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTBBJTIwJTIwJTIwJTIwb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5hdHVyZS1ib2FyZHdhbGsuanBnJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwJTVEJTJDJTBBKSUwQSUwQXByaW50KHJlc3BvbnNlLm91dHB1dF90ZXh0KQ==",highlighted:`<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI
<span class="hljs-keyword">import</span> os

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.getenv(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>),
)

response = client.responses.create(
    model=<span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>,
    <span class="hljs-built_in">input</span>=[
        {
            <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
            <span class="hljs-string">&quot;content&quot;</span>: [
                {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;input_text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;what is in this image?&quot;</span>},
                {
                    <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;input_image&quot;</span>,
                    <span class="hljs-string">&quot;image_url&quot;</span>: <span class="hljs-string">&quot;https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg&quot;</span>,
                },
            ],
        }
    ],
)

<span class="hljs-built_in">print</span>(response.output_text)`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,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lMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRnVwbG9hZC53aWtpbWVkaWEub3JnJTJGd2lraXBlZGlhJTJGY29tbW9ucyUyRnRodW1iJTJGZCUyRmRkJTJGR2ZwLXdpc2NvbnNpbi1tYWRpc29uLXRoZS1uYXR1cmUtYm9hcmR3YWxrLmpwZyUyRjI1NjBweC1HZnAtd2lzY29uc2luLW1hZGlzb24tdGhlLW5hdHVyZS1ib2FyZHdhbGsuanBnJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTVEJTJDJTBBJTdEKSUzQiUwQSUwQWNvbnNvbGUubG9nKHJlc3BvbnNlLm91dHB1dF90ZXh0KSUzQg==",highlighted:`<span class="hljs-keyword">import</span> <span class="hljs-title class_">OpenAI</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> client.<span class="hljs-property">responses</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>,
  <span class="hljs-attr">input</span>: [
    {
      <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>,
      <span class="hljs-attr">content</span>: [
        { <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;input_text&quot;</span>, <span class="hljs-attr">text</span>: <span class="hljs-string">&quot;what is in this image?&quot;</span> },
        {
          <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;input_image&quot;</span>,
          <span class="hljs-attr">image_url</span>:
            <span class="hljs-string">&quot;https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg&quot;</span>,
        },
      ],
    },
  ],
});

<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(response.<span class="hljs-property">output_text</span>);`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function nt(w){let l,e;return l=new B({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZyZXNwb25zZXMlMjAlNUMlMEElMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMC1IJTIwJTIyQ29udGVudC1UeXBlJTNBJTIwYXBwbGljYXRpb24lMkZqc29uJTIyJTIwJTVDJTBBJTIwJTIwLWQlMjAnJTdCJTBBJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJRd2VuJTJGUXdlbjIuNS1WTC03Qi1JbnN0cnVjdCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMmlucHV0JTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJjb250ZW50JTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIydHlwZSUyMiUzQSUyMCUyMmlucHV0X3RleHQlMjIlMkMlMjAlMjJ0ZXh0JTIyJTNBJTIwJTIyd2hhdCUyMGlzJTIwaW4lMjB0aGlzJTIwaW1hZ2UlM0YlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJ0eXBlJTIyJTNBJTIwJTIyaW5wdXRfaW1hZ2UlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJpbWFnZV91cmwlMjIlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnVwbG9hZC53aWtpbWVkaWEub3JnJTJGd2lraXBlZGlhJTJGY29tbW9ucyUyRnRodW1iJTJGZCUyRmRkJTJGR2ZwLXdpc2NvbnNpbi1tYWRpc29uLXRoZS1uYXR1cmUtYm9hcmR3YWxrLmpwZyUyRjI1NjBweC1HZnAtd2lzY29uc2luLW1hZGlzb24tdGhlLW5hdHVyZS1ib2FyZHdhbGsuanBnJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwJTVEJTBBJTIwJTIwJTdEJw==",highlighted:`curl https://router.huggingface.co/v1/responses \\
  -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
  -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \\
  -d <span class="hljs-string">&#x27;{
    &quot;model&quot;: &quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;,
    &quot;input&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: [
          {&quot;type&quot;: &quot;input_text&quot;, &quot;text&quot;: &quot;what is in this image?&quot;},
          {
            &quot;type&quot;: &quot;input_image&quot;,
            &quot;image_url&quot;: &quot;https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg&quot;
          }
        ]
      }
    ]
  }&#x27;</span>`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function et(w){let l,e,s,o,J,h;return l=new C({props:{id:"responses-multimodal",option:"python",$$slots:{default:[lt]},$$scope:{ctx:w}}}),s=new C({props:{id:"responses-multimodal",option:"typescript",$$slots:{default:[tt]},$$scope:{ctx:w}}}),J=new C({props:{id:"responses-multimodal",option:"curl",$$slots:{default:[nt]},$$scope:{ctx:w}}}),{c(){y(l.$$.fragment),e=j(),y(s.$$.fragment),o=j(),y(J.$$.fragment)},l(n){r(l.$$.fragment,n),e=I(n),r(s.$$.fragment,n),o=I(n),r(J.$$.fragment,n)},m(n,a){i(l,n,a),T(n,e,a),i(s,n,a),T(n,o,a),i(J,n,a),h=!0},p(n,a){const d={};a&2&&(d.$$scope={dirty:a,ctx:n}),l.$set(d);const f={};a&2&&(f.$$scope={dirty:a,ctx:n}),s.$set(f);const m={};a&2&&(m.$$scope={dirty:a,ctx:n}),J.$set(m)},i(n){h||(c(l.$$.fragment,n),c(s.$$.fragment,n),c(J.$$.fragment,n),h=!0)},o(n){u(l.$$.fragment,n),u(s.$$.fragment,n),u(J.$$.fragment,n),h=!1},d(n){n&&(p(e),p(o)),U(l,n),U(s,n),U(J,n)}}}function at(w){let l,e;return l=new B({props:{code:"ZnJvbSUyMG9wZW5haSUyMGltcG9ydCUyME9wZW5BSSUwQWltcG9ydCUyMG9zJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5nZXRlbnYoJTIySEZfVE9LRU4lMjIpJTJDJTBBKSUwQSUwQXJlc3BvbnNlJTIwJTNEJTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0QlMjJtb29uc2hvdGFpJTJGS2ltaS1LMi1JbnN0cnVjdC0wOTA1JTNBZ3JvcSUyMiUyQyUwQSUyMCUyMCUyMCUyMGlucHV0JTNEJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMmRldmVsb3BlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJUYWxrJTIwbGlrZSUyMGElMjBwaXJhdGUuJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyQXJlJTIwc2VtaWNvbG9ucyUyMG9wdGlvbmFsJTIwaW4lMjBKYXZhU2NyaXB0JTNGJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTVEJTJDJTBBKSUwQSUwQXByaW50KHJlc3BvbnNlLm91dHB1dF90ZXh0KQ==",highlighted:`<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI
<span class="hljs-keyword">import</span> os

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.getenv(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>),
)

response = client.responses.create(
    model=<span class="hljs-string">&quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;</span>,
    <span class="hljs-built_in">input</span>=[
        {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;developer&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Talk like a pirate.&quot;</span>},
        {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Are semicolons optional in JavaScript?&quot;</span>},
    ],
)

<span class="hljs-built_in">print</span>(response.output_text)`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function Mt(w){let l,e;return l=new B({props:{code:"aW1wb3J0JTIwT3BlbkFJJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjByZXNwb25zZSUyMCUzRCUyMGF3YWl0JTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTdCJTBBJTIwJTIwbW9kZWwlM0ElMjAlMjJtb29uc2hvdGFpJTJGS2ltaS1LMi1JbnN0cnVjdC0wOTA1JTNBZ3JvcSUyMiUyQyUwQSUyMCUyMGlucHV0JTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTdCJTIwcm9sZSUzQSUyMCUyMmRldmVsb3BlciUyMiUyQyUyMGNvbnRlbnQlM0ElMjAlMjJUYWxrJTIwbGlrZSUyMGElMjBwaXJhdGUuJTIyJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdCJTIwcm9sZSUzQSUyMCUyMnVzZXIlMjIlMkMlMjBjb250ZW50JTNBJTIwJTIyQXJlJTIwc2VtaWNvbG9ucyUyMG9wdGlvbmFsJTIwaW4lMjBKYXZhU2NyaXB0JTNGJTIyJTIwJTdEJTJDJTBBJTIwJTIwJTVEJTJDJTBBJTdEKSUzQiUwQSUwQWNvbnNvbGUubG9nKHJlc3BvbnNlLm91dHB1dF90ZXh0KSUzQg==",highlighted:`<span class="hljs-keyword">import</span> <span class="hljs-title class_">OpenAI</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> client.<span class="hljs-property">responses</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;</span>,
  <span class="hljs-attr">input</span>: [
    { <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;developer&quot;</span>, <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;Talk like a pirate.&quot;</span> },
    { <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;Are semicolons optional in JavaScript?&quot;</span> },
  ],
});

<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(response.<span class="hljs-property">output_text</span>);`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function ot(w){let l,e;return l=new B({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZyZXNwb25zZXMlMjAlNUMlMEElMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMC1IJTIwJTIyQ29udGVudC1UeXBlJTNBJTIwYXBwbGljYXRpb24lMkZqc29uJTIyJTIwJTVDJTBBJTIwJTIwLWQlMjAnJTdCJTBBJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJtb29uc2hvdGFpJTJGS2ltaS1LMi1JbnN0cnVjdC0wOTA1JTNBZ3JvcSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMmlucHV0JTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMmRldmVsb3BlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJUYWxrJTIwbGlrZSUyMGElMjBwaXJhdGUuJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyQXJlJTIwc2VtaWNvbG9ucyUyMG9wdGlvbmFsJTIwaW4lMjBKYXZhU2NyaXB0JTNGJTIyJTdEJTBBJTIwJTIwJTIwJTIwJTVEJTBBJTIwJTIwJTdEJw==",highlighted:`curl https://router.huggingface.co/v1/responses \\
  -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
  -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \\
  -d <span class="hljs-string">&#x27;{
    &quot;model&quot;: &quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;,
    &quot;input&quot;: [
      {&quot;role&quot;: &quot;developer&quot;, &quot;content&quot;: &quot;Talk like a pirate.&quot;},
      {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Are semicolons optional in JavaScript?&quot;}
    ]
  }&#x27;</span>`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function pt(w){let l,e,s,o,J,h;return l=new C({props:{id:"responses-multiturn",option:"python",$$slots:{default:[at]},$$scope:{ctx:w}}}),s=new C({props:{id:"responses-multiturn",option:"typescript",$$slots:{default:[Mt]},$$scope:{ctx:w}}}),J=new C({props:{id:"responses-multiturn",option:"curl",$$slots:{default:[ot]},$$scope:{ctx:w}}}),{c(){y(l.$$.fragment),e=j(),y(s.$$.fragment),o=j(),y(J.$$.fragment)},l(n){r(l.$$.fragment,n),e=I(n),r(s.$$.fragment,n),o=I(n),r(J.$$.fragment,n)},m(n,a){i(l,n,a),T(n,e,a),i(s,n,a),T(n,o,a),i(J,n,a),h=!0},p(n,a){const d={};a&2&&(d.$$scope={dirty:a,ctx:n}),l.$set(d);const f={};a&2&&(f.$$scope={dirty:a,ctx:n}),s.$set(f);const m={};a&2&&(m.$$scope={dirty:a,ctx:n}),J.$set(m)},i(n){h||(c(l.$$.fragment,n),c(s.$$.fragment,n),c(J.$$.fragment,n),h=!0)},o(n){u(l.$$.fragment,n),u(s.$$.fragment,n),u(J.$$.fragment,n),h=!1},d(n){n&&(p(e),p(o)),U(l,n),U(s,n),U(J,n)}}}function Jt(w){let l,e;return l=new B({props:{code:"ZnJvbSUyMG9wZW5haSUyMGltcG9ydCUyME9wZW5BSSUwQWltcG9ydCUyMG9zJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5nZXRlbnYoJTIySEZfVE9LRU4lMjIpJTJDJTBBKSUwQSUwQXN0cmVhbSUyMCUzRCUyMGNsaWVudC5yZXNwb25zZXMuY3JlYXRlKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEJTIybW9vbnNob3RhaSUyRktpbWktSzItSW5zdHJ1Y3QtMDkwNSUzQWdyb3ElMjIlMkMlMEElMjAlMjAlMjAlMjBpbnB1dCUzRCU1QiU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMlNheSUyMCdkb3VibGUlMjBidWJibGUlMjBiYXRoJyUyMHRlbiUyMHRpbWVzJTIwZmFzdC4lMjIlN0QlNUQlMkMlMEElMjAlMjAlMjAlMjBzdHJlYW0lM0RUcnVlJTJDJTBBKSUwQSUwQWZvciUyMGV2ZW50JTIwaW4lMjBzdHJlYW0lM0ElMEElMjAlMjAlMjAlMjBwcmludChldmVudCk=",highlighted:`<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI
<span class="hljs-keyword">import</span> os

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.getenv(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>),
)

stream = client.responses.create(
    model=<span class="hljs-string">&quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;</span>,
    <span class="hljs-built_in">input</span>=[{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Say &#x27;double bubble bath&#x27; ten times fast.&quot;</span>}],
    stream=<span class="hljs-literal">True</span>,
)

<span class="hljs-keyword">for</span> event <span class="hljs-keyword">in</span> stream:
    <span class="hljs-built_in">print</span>(event)`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function Tt(w){let l,e;return l=new B({props:{code:"aW1wb3J0JTIwT3BlbkFJJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjBzdHJlYW0lMjAlM0QlMjBhd2FpdCUyMGNsaWVudC5yZXNwb25zZXMuY3JlYXRlKCU3QiUwQSUyMCUyMG1vZGVsJTNBJTIwJTIybW9vbnNob3RhaSUyRktpbWktSzItSW5zdHJ1Y3QtMDkwNSUzQWdyb3ElMjIlMkMlMEElMjAlMjBpbnB1dCUzQSUyMCU1QiU3QiUyMHJvbGUlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwY29udGVudCUzQSUyMCUyMlNheSUyMCdkb3VibGUlMjBidWJibGUlMjBiYXRoJyUyMHRlbiUyMHRpbWVzJTIwZmFzdC4lMjIlMjAlN0QlNUQlMkMlMEElMjAlMjBzdHJlYW0lM0ElMjB0cnVlJTJDJTBBJTdEKSUzQiUwQSUwQWZvciUyMGF3YWl0JTIwKGNvbnN0JTIwZXZlbnQlMjBvZiUyMHN0cmVhbSklMjAlN0IlMEElMjAlMjBjb25zb2xlLmxvZyhldmVudCklM0IlMEElN0Q=",highlighted:`<span class="hljs-keyword">import</span> <span class="hljs-title class_">OpenAI</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> stream = <span class="hljs-keyword">await</span> client.<span class="hljs-property">responses</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;</span>,
  <span class="hljs-attr">input</span>: [{ <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;Say &#x27;double bubble bath&#x27; ten times fast.&quot;</span> }],
  <span class="hljs-attr">stream</span>: <span class="hljs-literal">true</span>,
});

<span class="hljs-keyword">for</span> <span class="hljs-keyword">await</span> (<span class="hljs-keyword">const</span> event <span class="hljs-keyword">of</span> stream) {
  <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(event);
}`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function yt(w){let l,e;return l=new B({props:{code:"Y3VybCUyMC1OJTIwaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyRnJlc3BvbnNlcyUyMCU1QyUwQSUyMCUyMC1IJTIwJTIyQXV0aG9yaXphdGlvbiUzQSUyMEJlYXJlciUyMCUyNEhGX1RPS0VOJTIyJTIwJTVDJTBBJTIwJTIwLUglMjAlMjJDb250ZW50LVR5cGUlM0ElMjBhcHBsaWNhdGlvbiUyRmpzb24lMjIlMjAlNUMlMEElMjAlMjAtZCUyMCclN0IlMEElMjAlMjAlMjAlMjAlMjJtb2RlbCUyMiUzQSUyMCUyMm1vb25zaG90YWklMkZLaW1pLUsyLUluc3RydWN0LTA5MDUlM0Fncm9xJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyaW5wdXQlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJTYXklMjAlNUMlMjJkb3VibGUlMjBidWJibGUlMjBiYXRoJTVDJTIyJTIwdGVuJTIwdGltZXMlMjBmYXN0LiUyMiU3RCUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMnN0cmVhbSUyMiUzQSUyMHRydWUlMEElMjAlMjAlN0Qn",highlighted:`curl -N https://router.huggingface.co/v1/responses \\
  -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
  -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \\
  -d <span class="hljs-string">&#x27;{
    &quot;model&quot;: &quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;,
    &quot;input&quot;: [
      {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Say \\&quot;double bubble bath\\&quot; ten times fast.&quot;}
    ],
    &quot;stream&quot;: true
  }&#x27;</span>`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function rt(w){let l,e,s,o,J,h;return l=new C({props:{id:"responses-streaming",option:"python",$$slots:{default:[Jt]},$$scope:{ctx:w}}}),s=new C({props:{id:"responses-streaming",option:"typescript",$$slots:{default:[Tt]},$$scope:{ctx:w}}}),J=new C({props:{id:"responses-streaming",option:"curl",$$slots:{default:[yt]},$$scope:{ctx:w}}}),{c(){y(l.$$.fragment),e=j(),y(s.$$.fragment),o=j(),y(J.$$.fragment)},l(n){r(l.$$.fragment,n),e=I(n),r(s.$$.fragment,n),o=I(n),r(J.$$.fragment,n)},m(n,a){i(l,n,a),T(n,e,a),i(s,n,a),T(n,o,a),i(J,n,a),h=!0},p(n,a){const d={};a&2&&(d.$$scope={dirty:a,ctx:n}),l.$set(d);const f={};a&2&&(f.$$scope={dirty:a,ctx:n}),s.$set(f);const m={};a&2&&(m.$$scope={dirty:a,ctx:n}),J.$set(m)},i(n){h||(c(l.$$.fragment,n),c(s.$$.fragment,n),c(J.$$.fragment,n),h=!0)},o(n){u(l.$$.fragment,n),u(s.$$.fragment,n),u(J.$$.fragment,n),h=!1},d(n){n&&(p(e),p(o)),U(l,n),U(s,n),U(J,n)}}}function it(w){let l,e;return l=new B({props:{code:"ZnJvbSUyMG9wZW5haSUyMGltcG9ydCUyME9wZW5BSSUwQWltcG9ydCUyMG9zJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5nZXRlbnYoJTIySEZfVE9LRU4lMjIpJTJDJTBBKSUwQSUwQXRvb2xzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIydHlwZSUyMiUzQSUyMCUyMmZ1bmN0aW9uJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybmFtZSUyMiUzQSUyMCUyMmdldF9jdXJyZW50X3dlYXRoZXIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJkZXNjcmlwdGlvbiUyMiUzQSUyMCUyMkdldCUyMHRoZSUyMGN1cnJlbnQlMj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yUwQSUyMCUyMCUyMCUyMCU3RCUwQSU1RCUwQSUwQXJlc3BvbnNlJTIwJTNEJTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0QlMjJtb29uc2hvdGFpJTJGS2ltaS1LMi1JbnN0cnVjdC0wOTA1JTNBZ3JvcSUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvb2xzJTNEdG9vbHMlMkMlMEElMjAlMjAlMjAlMjBpbnB1dCUzRCUyMldoYXQlMjBpcyUyMHRoZSUyMHdlYXRoZXIlMjBsaWtlJTIwaW4lMjBCb3N0b24lMjB0b2RheSUzRiUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvb2xfY2hvaWNlJTNEJTIyYXV0byUyMiUyQyUwQSklMEElMEFwcmludChyZXNwb25zZSk=",highlighted:`<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI
<span class="hljs-keyword">import</span> os

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.getenv(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>),
)

tools = [
    {
        <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;function&quot;</span>,
        <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;get_current_weather&quot;</span>,
        <span class="hljs-string">&quot;description&quot;</span>: <span class="hljs-string">&quot;Get the current weather in a given location&quot;</span>,
        <span class="hljs-string">&quot;parameters&quot;</span>: {
            <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;object&quot;</span>,
            <span class="hljs-string">&quot;properties&quot;</span>: {
                <span class="hljs-string">&quot;location&quot;</span>: {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>, <span class="hljs-string">&quot;description&quot;</span>: <span class="hljs-string">&quot;The city and state, e.g. San Francisco, CA&quot;</span>},
                <span class="hljs-string">&quot;unit&quot;</span>: {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>, <span class="hljs-string">&quot;enum&quot;</span>: [<span class="hljs-string">&quot;celsius&quot;</span>, <span class="hljs-string">&quot;fahrenheit&quot;</span>]},
            },
            <span class="hljs-string">&quot;required&quot;</span>: [<span class="hljs-string">&quot;location&quot;</span>, <span class="hljs-string">&quot;unit&quot;</span>],
        },
    }
]

response = client.responses.create(
    model=<span class="hljs-string">&quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;</span>,
    tools=tools,
    <span class="hljs-built_in">input</span>=<span class="hljs-string">&quot;What is the weather like in Boston today?&quot;</span>,
    tool_choice=<span class="hljs-string">&quot;auto&quot;</span>,
)

<span class="hljs-built_in">print</span>(response)`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function ct(w){let l,e;return l=new B({props:{code:"aW1wb3J0JTIwT3BlbkFJJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjB0b29scyUyMCUzRCUyMCU1QiUwQSUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMHR5cGUlM0ElMjAlMjJmdW5jdGlvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMG5hbWUlM0ElMjAlMjJnZXRfY3VycmVudF93ZWF0aGVyJTIyJTJDJTBBJTIwJTIwJTIwJTIwZGVzY3JpcHRpb24lM0El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lMEElMjAlMjBpbnB1dCUzQSUyMCUyMldoYXQlMjBpcyUyMHRoZSUyMHdlYXRoZXIlMjBsaWtlJTIwaW4lMjBCb3N0b24lMjB0b2RheSUzRiUyMiUyQyUwQSUyMCUyMHRvb2xfY2hvaWNlJTNBJTIwJTIyYXV0byUyMiUyQyUwQSU3RCklM0IlMEElMEFjb25zb2xlLmxvZyhyZXNwb25zZSklM0I=",highlighted:`<span class="hljs-keyword">import</span> <span class="hljs-title class_">OpenAI</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> tools = [
  {
    <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;function&quot;</span>,
    <span class="hljs-attr">name</span>: <span class="hljs-string">&quot;get_current_weather&quot;</span>,
    <span class="hljs-attr">description</span>: <span class="hljs-string">&quot;Get the current weather in a given location&quot;</span>,
    <span class="hljs-attr">parameters</span>: {
      <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;object&quot;</span>,
      <span class="hljs-attr">properties</span>: {
        <span class="hljs-attr">location</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;string&quot;</span>, <span class="hljs-attr">description</span>: <span class="hljs-string">&quot;The city and state, e.g. San Francisco, CA&quot;</span> },
        <span class="hljs-attr">unit</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;string&quot;</span>, <span class="hljs-attr">enum</span>: [<span class="hljs-string">&quot;celsius&quot;</span>, <span class="hljs-string">&quot;fahrenheit&quot;</span>] },
      },
      <span class="hljs-attr">required</span>: [<span class="hljs-string">&quot;location&quot;</span>, <span class="hljs-string">&quot;unit&quot;</span>],
    },
  },
];

<span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> client.<span class="hljs-property">responses</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;</span>,
  tools,
  <span class="hljs-attr">input</span>: <span class="hljs-string">&quot;What is the weather like in Boston today?&quot;</span>,
  <span class="hljs-attr">tool_choice</span>: <span class="hljs-string">&quot;auto&quot;</span>,
});

<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(response);`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function ut(w){let l,e;return l=new B({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZyZXNwb25zZXMlMjAlNUMlMEElMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMC1IJTIwJTIyQ29udGVudC1UeXBlJTNBJTIwYXBwbGljYXRpb24lMkZqc29uJTIyJTIwJTVDJTBBJTIwJTIwLWQlMjAnJTdCJTBBJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJtb29uc2hvdGFpJTJGS2ltaS1LMi1JbnN0cnVjdC0wOTA1JTNBZ3JvcSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMmlucHV0JTIyJTNBJTIwJTIyV2hhdCUyMGlzJTIwdGhlJTIwd2VhdGhlciUyMGxpa2UlMjBpbiUyMEJvc3RvbiUyMHRvZGF5JTNGJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIydG9vbF9jaG9pY2UlMjIlM0ElMjAlMjJhdXRvJTIyJTJDJTBBJTIwJTIwJ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zaXVzJTIyJTJDJTIwJTIyZmFocmVuaGVpdCUyMiU1RCU3RCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJlcXVpcmVkJTIyJTNBJTIwJTVCJTIybG9jYXRpb24lMjIlMkMlMjAlMjJ1bml0JTIyJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwJTVEJTBBJTIwJTIwJTdEJw==",highlighted:`curl https://router.huggingface.co/v1/responses \\
  -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
  -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \\
  -d <span class="hljs-string">&#x27;{
    &quot;model&quot;: &quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;,
    &quot;input&quot;: &quot;What is the weather like in Boston today?&quot;,
    &quot;tool_choice&quot;: &quot;auto&quot;,
    &quot;tools&quot;: [
      {
        &quot;type&quot;: &quot;function&quot;,
        &quot;name&quot;: &quot;get_current_weather&quot;,
        &quot;description&quot;: &quot;Get the current weather in a given location&quot;,
        &quot;parameters&quot;: {
          &quot;type&quot;: &quot;object&quot;,
          &quot;properties&quot;: {
            &quot;location&quot;: {&quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;The city and state, e.g. San Francisco, CA&quot;},
            &quot;unit&quot;: {&quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;celsius&quot;, &quot;fahrenheit&quot;]}
          },
          &quot;required&quot;: [&quot;location&quot;, &quot;unit&quot;]
        }
      }
    ]
  }&#x27;</span>`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function Ut(w){let l,e,s,o,J,h;return l=new C({props:{id:"responses-tools",option:"python",$$slots:{default:[it]},$$scope:{ctx:w}}}),s=new C({props:{id:"responses-tools",option:"typescript",$$slots:{default:[ct]},$$scope:{ctx:w}}}),J=new C({props:{id:"responses-tools",option:"curl",$$slots:{default:[ut]},$$scope:{ctx:w}}}),{c(){y(l.$$.fragment),e=j(),y(s.$$.fragment),o=j(),y(J.$$.fragment)},l(n){r(l.$$.fragment,n),e=I(n),r(s.$$.fragment,n),o=I(n),r(J.$$.fragment,n)},m(n,a){i(l,n,a),T(n,e,a),i(s,n,a),T(n,o,a),i(J,n,a),h=!0},p(n,a){const d={};a&2&&(d.$$scope={dirty:a,ctx:n}),l.$set(d);const f={};a&2&&(f.$$scope={dirty:a,ctx:n}),s.$set(f);const m={};a&2&&(m.$$scope={dirty:a,ctx:n}),J.$set(m)},i(n){h||(c(l.$$.fragment,n),c(s.$$.fragment,n),c(J.$$.fragment,n),h=!0)},o(n){u(l.$$.fragment,n),u(s.$$.fragment,n),u(J.$$.fragment,n),h=!1},d(n){n&&(p(e),p(o)),U(l,n),U(s,n),U(J,n)}}}function wt(w){let l,e;return l=new B({props:{code:"ZnJvbSUyMG9wZW5haSUyMGltcG9ydCUyME9wZW5BSSUwQWZyb20lMjBweWRhbnRpYyUyMGltcG9ydCUyMEJhc2VNb2RlbCUwQWltcG9ydCUyMG9zJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5nZXRlbnYoJTIySEZfVE9LRU4lMjIpJTJDJTBBKSUwQSUwQWNsYXNzJTIwQ2FsZW5kYXJFdmVudChCYXNlTW9kZWwpJTNBJTBBJTIwJTIwJTIwJTIwbmFtZSUzQSUyMHN0ciUwQSUyMCUyMCUyMCUyMGRhdGUlM0ElMjBzdHIlMEElMjAlMjAlMjAlMjBwYXJ0aWNpcGFudHMlM0ElMjBsaXN0JTVCc3RyJTVEJTBBJTBBcmVzcG9uc2UlMjAlM0QlMjBjbGllbnQucmVzcG9uc2VzLnBhcnNlKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEJTIyb3BlbmFpJTJGZ3B0LW9zcy0xMjBiJTNBZ3JvcSUyMiUyQyUwQSUyMCUyMCUyMCUyMGlucHV0JTNEJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnN5c3RlbSUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJFeHRyYWN0JTIwdGhlJTIwZXZlbnQlMjBpbmZvcm1hdGlvbi4lMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJBbGljZSUyMGFuZCUyMEJvYiUyMGFyZSUyMGdvaW5nJTIwdG8lMjBhJTIwc2NpZW5jZSUyMGZhaXIlMjBvbiUyMEZyaWRheS4lMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlNUQlMkMlMEElMjAlMjAlMjAlMjB0ZXh0X2Zvcm1hdCUzRENhbGVuZGFyRXZlbnQlMkMlMEEpJTBBJTBBcHJpbnQocmVzcG9uc2Uub3V0cHV0X3BhcnNlZCk=",highlighted:`<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI
<span class="hljs-keyword">from</span> pydantic <span class="hljs-keyword">import</span> BaseModel
<span class="hljs-keyword">import</span> os

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.getenv(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>),
)

<span class="hljs-keyword">class</span> <span class="hljs-title class_">CalendarEvent</span>(<span class="hljs-title class_ inherited__">BaseModel</span>):
    name: <span class="hljs-built_in">str</span>
    date: <span class="hljs-built_in">str</span>
    participants: <span class="hljs-built_in">list</span>[<span class="hljs-built_in">str</span>]

response = client.responses.parse(
    model=<span class="hljs-string">&quot;openai/gpt-oss-120b:groq&quot;</span>,
    <span class="hljs-built_in">input</span>=[
        {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Extract the event information.&quot;</span>},
        {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Alice and Bob are going to a science fair on Friday.&quot;</span>},
    ],
    text_format=CalendarEvent,
)

<span class="hljs-built_in">print</span>(response.output_parsed)`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function jt(w){let l,e;return l=new B({props:{code:"aW1wb3J0JTIwT3BlbkFJJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjByZXNwb25zZSUyMCUzRCUyMGF3YWl0JTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTdCJTBBJTIwJTIwbW9kZWwlM0ElMjAlMjJvcGV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I=",highlighted:`<span class="hljs-keyword">import</span> <span class="hljs-title class_">OpenAI</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> client.<span class="hljs-property">responses</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;openai/gpt-oss-120b:groq&quot;</span>,
  <span class="hljs-attr">instructions</span>: <span class="hljs-string">&quot;Return JSON that matches the CalendarEvent schema (fields name, date, participants).&quot;</span>,
  <span class="hljs-attr">input</span>: [
    { <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;system&quot;</span>, <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;Extract the event information.&quot;</span> },
    { <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;Alice and Bob are going to a science fair on Friday.&quot;</span> },
  ],
  <span class="hljs-attr">response_format</span>: {
    <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;json_schema&quot;</span>,
    <span class="hljs-attr">json_schema</span>: {
      <span class="hljs-attr">name</span>: <span class="hljs-string">&quot;CalendarEvent&quot;</span>,
      <span class="hljs-attr">schema</span>: {
        <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;object&quot;</span>,
        <span class="hljs-attr">properties</span>: {
          <span class="hljs-attr">name</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;string&quot;</span> },
          <span class="hljs-attr">date</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;string&quot;</span> },
          <span class="hljs-attr">participants</span>: {
            <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;array&quot;</span>,
            <span class="hljs-attr">items</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;string&quot;</span> },
          },
        },
        <span class="hljs-attr">required</span>: [<span class="hljs-string">&quot;name&quot;</span>, <span class="hljs-string">&quot;date&quot;</span>, <span class="hljs-string">&quot;participants&quot;</span>],
        <span class="hljs-attr">additionalProperties</span>: <span class="hljs-literal">false</span>,
      },
      <span class="hljs-attr">strict</span>: <span class="hljs-literal">true</span>,
    },
  },
});

<span class="hljs-keyword">const</span> parsed = <span class="hljs-title class_">JSON</span>.<span class="hljs-title function_">parse</span>(response.<span class="hljs-property">output_text</span>);
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(parsed);`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function It(w){let l,e;return l=new B({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZyZXNwb25zZXMlMjAlNUMlMEElMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMC1IJTIwJTIyQ29udGVudC1UeXBlJTNBJTIwYXBwbGljYXRpb24lMkZqc29uJTIyJTIwJTVDJTBBJTIwJTIwLWQlMjAnJTdCJTBBJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJvcGVuYWklMkZncHQtb3NzLTEyMGIlM0Fncm9xJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyaW5zdHJ1Y3Rpb25zJTIyJTNBJTIwJTIyUmV0dXJuJTIwSlNPTiUyMHRoYXQlMjBtYXRjaGVzJTIwdGhlJTIwQ2FsZW5kYXJFdmVudC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lMjAlMjAlN0QlMEElMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlN0Qn",highlighted:`curl https://router.huggingface.co/v1/responses \\
  -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
  -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \\
  -d <span class="hljs-string">&#x27;{
    &quot;model&quot;: &quot;openai/gpt-oss-120b:groq&quot;,
    &quot;instructions&quot;: &quot;Return JSON that matches the CalendarEvent schema (fields name, date, participants).&quot;,
    &quot;input&quot;: [
      {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;Extract the event information.&quot;},
      {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Alice and Bob are going to a science fair on Friday.&quot;}
    ],
    &quot;response_format&quot;: {
      &quot;type&quot;: &quot;json_schema&quot;,
      &quot;json_schema&quot;: {
        &quot;name&quot;: &quot;CalendarEvent&quot;,
        &quot;schema&quot;: {
          &quot;type&quot;: &quot;object&quot;,
          &quot;properties&quot;: {
            &quot;name&quot;: {&quot;type&quot;: &quot;string&quot;},
            &quot;date&quot;: {&quot;type&quot;: &quot;string&quot;},
            &quot;participants&quot;: {
              &quot;type&quot;: &quot;array&quot;,
              &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}
            }
          },
          &quot;required&quot;: [&quot;name&quot;, &quot;date&quot;, &quot;participants&quot;],
          &quot;additionalProperties&quot;: false
        },
        &quot;strict&quot;: true
      }
    }
  }&#x27;</span>`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function ht(w){let l,e,s,o,J,h;return l=new C({props:{id:"responses-structured",option:"python",$$slots:{default:[wt]},$$scope:{ctx:w}}}),s=new C({props:{id:"responses-structured",option:"typescript",$$slots:{default:[jt]},$$scope:{ctx:w}}}),J=new C({props:{id:"responses-structured",option:"curl",$$slots:{default:[It]},$$scope:{ctx:w}}}),{c(){y(l.$$.fragment),e=j(),y(s.$$.fragment),o=j(),y(J.$$.fragment)},l(n){r(l.$$.fragment,n),e=I(n),r(s.$$.fragment,n),o=I(n),r(J.$$.fragment,n)},m(n,a){i(l,n,a),T(n,e,a),i(s,n,a),T(n,o,a),i(J,n,a),h=!0},p(n,a){const d={};a&2&&(d.$$scope={dirty:a,ctx:n}),l.$set(d);const f={};a&2&&(f.$$scope={dirty:a,ctx:n}),s.$set(f);const m={};a&2&&(m.$$scope={dirty:a,ctx:n}),J.$set(m)},i(n){h||(c(l.$$.fragment,n),c(s.$$.fragment,n),c(J.$$.fragment,n),h=!0)},o(n){u(l.$$.fragment,n),u(s.$$.fragment,n),u(J.$$.fragment,n),h=!1},d(n){n&&(p(e),p(o)),U(l,n),U(s,n),U(J,n)}}}function dt(w){let l,e;return l=new B({props:{code:"ZnJvbSUyMG9wZW5haSUyMGltcG9ydCUyME9wZW5BSSUwQWltcG9ydCUyMG9zJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5nZXRlbnYoJTIySEZfVE9LRU4lMjIpJTJDJTBBKSUwQSUwQXJlc3BvbnNlJTIwJTNEJTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0QlMjJtb29uc2hvdGFpJTJGS2ltaS1LMi1JbnN0cnVjdC0wOTA1JTNBZ3JvcSUyMiUyQyUwQSUyMCUyMCUyMCUyMGlucHV0JTNEJTIyaG93JTIwZG9lcyUyMHRpa3Rva2VuJTIwd29yayUzRiUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvb2xzJTNEJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIydHlwZSUyMiUzQSUyMCUyMm1jcCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnNlcnZlcl9sYWJlbCUyMiUzQSUyMCUyMmdpdG1jcCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnNlcnZlcl91cmwlMjIlM0ElMjAlMjJodHRwcyUzQSUyRiUyRmdpdG1jcC5pbyUyRm9wZW5haSUyRnRpa3Rva2VuJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyYWxsb3dlZF90b29scyUyMiUzQSUyMCU1QiUyMnNlYXJjaF90aWt0b2tlbl9kb2N1bWVudGF0aW9uJTIyJTJDJTIwJTIyZmV0Y2hfdGlrdG9rZW5fZG9jdW1lbnRhdGlvbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJlcXVpcmVfYXBwcm92YWwlMjIlM0ElMjAlMjJuZXZlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSklMEElMEFmb3IlMjBvdXRwdXQlMjBpbiUyMHJlc3BvbnNlLm91dHB1dCUzQSUwQSUyMCUyMCUyMCUyMHByaW50KG91dHB1dCk=",highlighted:`<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI
<span class="hljs-keyword">import</span> os

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.getenv(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>),
)

response = client.responses.create(
    model=<span class="hljs-string">&quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;</span>,
    <span class="hljs-built_in">input</span>=<span class="hljs-string">&quot;how does tiktoken work?&quot;</span>,
    tools=[
        {
            <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;mcp&quot;</span>,
            <span class="hljs-string">&quot;server_label&quot;</span>: <span class="hljs-string">&quot;gitmcp&quot;</span>,
            <span class="hljs-string">&quot;server_url&quot;</span>: <span class="hljs-string">&quot;https://gitmcp.io/openai/tiktoken&quot;</span>,
            <span class="hljs-string">&quot;allowed_tools&quot;</span>: [<span class="hljs-string">&quot;search_tiktoken_documentation&quot;</span>, <span class="hljs-string">&quot;fetch_tiktoken_documentation&quot;</span>],
            <span class="hljs-string">&quot;require_approval&quot;</span>: <span class="hljs-string">&quot;never&quot;</span>,
        },
    ],
)

<span class="hljs-keyword">for</span> output <span class="hljs-keyword">in</span> response.output:
    <span class="hljs-built_in">print</span>(output)`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function mt(w){let l,e;return l=new B({props:{code:"aW1wb3J0JTIwT3BlbkFJJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjByZXNwb25zZSUyMCUzRCUyMGF3YWl0JTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTdCJTBBJTIwJTIwbW9kZWwlM0ElMjAlMjJtb29uc2hvdGFpJTJGS2ltaS1LMi1JbnN0cnVjdC0wOTA1JTNBZ3JvcSUyMiUyQyUwQSUyMCUyMGlucHV0JTNBJTIwJTIyaG93JTIwZG9lcyUyMHRpa3Rva2VuJTIwd29yayUzRiUyMiUyQyUwQSUyMCUyMHRvb2xzJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwdHlwZSUzQSUyMCUyMm1jcCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMHNlcnZlcl9sYWJlbCUzQSUyMCUyMmdpdG1jcCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMHNlcnZlcl91cmwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRmdpdG1jcC5pbyUyRm9wZW5haSUyRnRpa3Rva2VuJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwYWxsb3dlZF90b29scyUzQSUyMCU1QiUyMnNlYXJjaF90aWt0b2tlbl9kb2N1bWVudGF0aW9uJTIyJTJDJTIwJTIyZmV0Y2hfdGlrdG9rZW5fZG9jdW1lbnRhdGlvbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMHJlcXVpcmVfYXBwcm92YWwlM0ElMjAlMjJuZXZlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCU1RCUyQyUwQSU3RCklM0IlMEElMEFmb3IlMjAoY29uc3QlMjBvdXRwdXQlMjBvZiUyMHJlc3BvbnNlLm91dHB1dCklMjAlN0IlMEElMjAlMjBjb25zb2xlLmxvZyhvdXRwdXQpJTNCJTBBJTdE",highlighted:`<span class="hljs-keyword">import</span> <span class="hljs-title class_">OpenAI</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> client.<span class="hljs-property">responses</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;</span>,
  <span class="hljs-attr">input</span>: <span class="hljs-string">&quot;how does tiktoken work?&quot;</span>,
  <span class="hljs-attr">tools</span>: [
    {
      <span class="hljs-attr">type</span>: <span class="hljs-string">&quot;mcp&quot;</span>,
      <span class="hljs-attr">server_label</span>: <span class="hljs-string">&quot;gitmcp&quot;</span>,
      <span class="hljs-attr">server_url</span>: <span class="hljs-string">&quot;https://gitmcp.io/openai/tiktoken&quot;</span>,
      <span class="hljs-attr">allowed_tools</span>: [<span class="hljs-string">&quot;search_tiktoken_documentation&quot;</span>, <span class="hljs-string">&quot;fetch_tiktoken_documentation&quot;</span>],
      <span class="hljs-attr">require_approval</span>: <span class="hljs-string">&quot;never&quot;</span>,
    },
  ],
});

<span class="hljs-keyword">for</span> (<span class="hljs-keyword">const</span> output <span class="hljs-keyword">of</span> response.<span class="hljs-property">output</span>) {
  <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(output);
}`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function ft(w){let l,e;return l=new B({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZyZXNwb25zZXMlMjAlNUMlMEElMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFT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highlighted:`curl https://router.huggingface.co/v1/responses \\
  -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
  -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \\
  -d <span class="hljs-string">&#x27;{
    &quot;model&quot;: &quot;moonshotai/Kimi-K2-Instruct-0905:groq&quot;,
    &quot;input&quot;: &quot;how does tiktoken work?&quot;,
    &quot;tools&quot;: [
      {
        &quot;type&quot;: &quot;mcp&quot;,
        &quot;server_label&quot;: &quot;gitmcp&quot;,
        &quot;server_url&quot;: &quot;https://gitmcp.io/openai/tiktoken&quot;,
        &quot;allowed_tools&quot;: [&quot;search_tiktoken_documentation&quot;, &quot;fetch_tiktoken_documentation&quot;],
        &quot;require_approval&quot;: &quot;never&quot;
      }
    ]
  }&#x27;</span>`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function Ct(w){let l,e,s,o,J,h;return l=new C({props:{id:"responses-mcp",option:"python",$$slots:{default:[dt]},$$scope:{ctx:w}}}),s=new C({props:{id:"responses-mcp",option:"typescript",$$slots:{default:[mt]},$$scope:{ctx:w}}}),J=new C({props:{id:"responses-mcp",option:"curl",$$slots:{default:[ft]},$$scope:{ctx:w}}}),{c(){y(l.$$.fragment),e=j(),y(s.$$.fragment),o=j(),y(J.$$.fragment)},l(n){r(l.$$.fragment,n),e=I(n),r(s.$$.fragment,n),o=I(n),r(J.$$.fragment,n)},m(n,a){i(l,n,a),T(n,e,a),i(s,n,a),T(n,o,a),i(J,n,a),h=!0},p(n,a){const d={};a&2&&(d.$$scope={dirty:a,ctx:n}),l.$set(d);const f={};a&2&&(f.$$scope={dirty:a,ctx:n}),s.$set(f);const m={};a&2&&(m.$$scope={dirty:a,ctx:n}),J.$set(m)},i(n){h||(c(l.$$.fragment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class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI
<span class="hljs-keyword">import</span> os

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.getenv(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>),
)

response = client.responses.create(
    model=<span class="hljs-string">&quot;openai/gpt-oss-120b:groq&quot;</span>,
    instructions=<span class="hljs-string">&quot;You are a helpful assistant.&quot;</span>,
    <span class="hljs-built_in">input</span>=<span class="hljs-string">&quot;Say hello to the world.&quot;</span>,
    reasoning={<span class="hljs-string">&quot;effort&quot;</span>: <span class="hljs-string">&quot;low&quot;</span>},
)

<span class="hljs-keyword">for</span> i, item <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(response.output):
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Output #<span class="hljs-subst">{i}</span>: <span class="hljs-subst">{item.<span class="hljs-built_in">type</span>}</span>&quot;</span>, item.content)`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function Bt(w){let l,e;return l=new B({props:{code:"aW1wb3J0JTIwT3BlbkFJJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjByZXNwb25zZSUyMCUzRCUyMGF3YWl0JTIwY2xpZW50LnJlc3BvbnNlcy5jcmVhdGUoJTdCJTBBJTIwJTIwbW9kZWwlM0ElMjAlMjJvcGVuYWklMkZncHQtb3NzLTEyMGIlM0Fncm9xJTIyJTJDJTBBJTIwJTIwaW5zdHJ1Y3Rpb25zJTNBJTIwJTIyWW91JTIwYXJlJTIwYSUyMGhlbHBmdWwlMjBhc3Npc3RhbnQuJTIyJTJDJTBBJTIwJTIwaW5wdXQlM0ElMjAlMjJTYXklMjBoZWxsbyUyMHRvJTIwdGhlJTIwd29ybGQuJTIyJTJDJTBBJTIwJTIwcmVhc29uaW5nJTNBJTIwJTdCJTIwZWZmb3J0JTNBJTIwJTIybG93JTIyJTIwJTdEJTJDJTBBJTdEKSUzQiUwQSUwQXJlc3BvbnNlLm91dHB1dC5mb3JFYWNoKChpdGVtJTJDJTIwaW5kZXgpJTIwJTNEJTNFJTIwJTdCJTBBJTIwJTIwY29uc29sZS5sb2coJTYwT3V0cHV0JTIwJTIzJTI0JTdCaW5kZXglN0QlM0ElMjAlMjQlN0JpdGVtLnR5cGUlN0QlNjAlMkMlMjBpdGVtLmNvbnRlbnQpJTNCJTBBJTdEKSUzQg==",highlighted:`<span class="hljs-keyword">import</span> <span class="hljs-title class_">OpenAI</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> client.<span class="hljs-property">responses</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;openai/gpt-oss-120b:groq&quot;</span>,
  <span class="hljs-attr">instructions</span>: <span class="hljs-string">&quot;You are a helpful assistant.&quot;</span>,
  <span class="hljs-attr">input</span>: <span class="hljs-string">&quot;Say hello to the world.&quot;</span>,
  <span class="hljs-attr">reasoning</span>: { <span class="hljs-attr">effort</span>: <span class="hljs-string">&quot;low&quot;</span> },
});

response.<span class="hljs-property">output</span>.<span class="hljs-title function_">forEach</span>(<span class="hljs-function">(<span class="hljs-params">item, index</span>) =&gt;</span> {
  <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">\`Output #<span class="hljs-subst">\${index}</span>: <span class="hljs-subst">\${item.<span class="hljs-keyword">type</span>}</span>\`</span>, item.<span class="hljs-property">content</span>);
});`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function gt(w){let l,e;return l=new B({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZyZXNwb25zZXMlMjAlNUMlMEElMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMC1IJTIwJTIyQ29udGVudC1UeXBlJTNBJTIwYXBwbGljYXRpb24lMkZqc29uJTIyJTIwJTVDJTBBJTIwJTIwLWQlMjAnJTdCJTBBJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJvcGVuYWklMkZncHQtb3NzLTEyMGIlM0Fncm9xJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyaW5zdHJ1Y3Rpb25zJTIyJTNBJTIwJTIyWW91JTIwYXJlJTIwYSUyMGhlbHBmdWwlMjBhc3Npc3RhbnQuJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyaW5wdXQlMjIlM0ElMjAlMjJTYXklMjBoZWxsbyUyMHRvJTIwdGhlJTIwd29ybGQuJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIycmVhc29uaW5nJTIyJTNBJTIwJTdCJTIyZWZmb3J0JTIyJTNBJTIwJTIybG93JTIyJTdEJTBBJTIwJTIwJTdEJw==",highlighted:`curl https://router.huggingface.co/v1/responses \\
  -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
  -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \\
  -d <span class="hljs-string">&#x27;{
    &quot;model&quot;: &quot;openai/gpt-oss-120b:groq&quot;,
    &quot;instructions&quot;: &quot;You are a helpful assistant.&quot;,
    &quot;input&quot;: &quot;Say hello to the world.&quot;,
    &quot;reasoning&quot;: {&quot;effort&quot;: &quot;low&quot;}
  }&#x27;</span>`,wrap:!1}}),{c(){y(l.$$.fragment)},l(s){r(l.$$.fragment,s)},m(s,o){i(l,s,o),e=!0},p:$,i(s){e||(c(l.$$.fragment,s),e=!0)},o(s){u(l.$$.fragment,s),e=!1},d(s){U(l,s)}}}function bt(w){let l,e,s,o,J,h;return l=new C({props:{id:"responses-reasoning",option:"python",$$slots:{default:[$t]},$$scope:{ctx:w}}}),s=new C({props:{id:"responses-reasoning",option:"typescript",$$slots:{default:[Bt]},$$scope:{ctx:w}}}),J=new C({props:{id:"responses-reasoning",option:"curl",$$slots:{default:[gt]},$$scope:{ctx:w}}}),{c(){y(l.$$.fragment),e=j(),y(s.$$.fragment),o=j(),y(J.$$.fragment)},l(n){r(l.$$.fragment,n),e=I(n),r(s.$$.fragment,n),o=I(n),r(J.$$.fragment,n)},m(n,a){i(l,n,a),T(n,e,a),i(s,n,a),T(n,o,a),i(J,n,a),h=!0},p(n,a){const d={};a&2&&(d.$$scope={dirty:a,ctx:n}),l.$set(d);const f={};a&2&&(f.$$scope={dirty:a,ctx:n}),s.$set(f);const m={};a&2&&(m.$$scope={dirty:a,ctx:n}),J.$set(m)},i(n){h||(c(l.$$.fragment,n),c(s.$$.fragment,n),c(J.$$.fragment,n),h=!0)},o(n){u(l.$$.fragment,n),u(s.$$.fragment,n),u(J.$$.fragment,n),h=!1},d(n){n&&(p(e),p(o)),U(l,n),U(s,n),U(J,n)}}}function qt(w){let l,e,s,o,J,h,n,a,d,f="The Responses API (from OpenAI) provides a unified interface for model interactions with Hugging Face Inference Providers. Use your existing OpenAI SDKs to access features like multi-provider routing, event streaming, structured outputs, and Remote MCP tools.",m,Q,yl='<p>This guide assumes you have a Hugging Face account and access token. You can create a free account at <a href="https://huggingface.co" rel="nofollow">huggingface.co</a> and get your token from your <a href="https://huggingface.co/settings/tokens" rel="nofollow">settings page</a>.</p>',ms,H,fs,z,rl="The Responses API provides a unified interface built for agentic apps. With it, you get:",Cs,F,il="<li><strong>Built-in tool orchestration.</strong> Invoke functions, server-side MCP tools, and schema-validated outputs without changing endpoints.</li> <li><strong>Event-driven streaming.</strong> Receive semantic events such as <code>response.created</code>, <code>output_text.delta</code>, and <code>response.completed</code> to power incremental UIs.</li> <li><strong>Reasoning controls and structured outputs.</strong> Dial up or down reasoning effort and require models to return schema-compliant JSON every time.</li>",$s,L,Bs,x,cl='<li>A Hugging Face account with remaining Inference Providers credits (free tier available).</li> <li>A fine-grained <a href="https://huggingface.co/settings/tokens" rel="nofollow">Hugging Face token</a> with “Make calls to Inference Providers” permission stored in <code>HF_TOKEN</code>.</li>',gs,E,ul='<p>All Inference Providers chat completion models should be compatible with the Responses API. You can browse available models on the <a href="https://huggingface.co/inference/models" rel="nofollow">Inference Models page</a>.</p>',bs,K,qs,D,Ul="Install the OpenAI SDK for your language of choice before running the snippets below (<code>pip install openai</code> for Python or <code>npm install openai</code> for Node.js). If you prefer issuing raw HTTP calls, any standard tool such as <code>curl</code> will work as well.",As,N,Zs,S,wl="<p>If you plan to use a specific provider, append it to the model id as <code>&lt;repo&gt;:&lt;provider&gt;</code> (for example <code>moonshotai/Kimi-K2-Instruct-0905:groq</code>). Otherwise, omit the suffix and let routing fall back to the default provider.</p>",Qs,O,Es,P,Ns,ss,jl="For a single response message, pass a string as input. The Responses API returns both the full <code>response</code> object and a convenience <code>output_text</code> helper.",Ss,G,Gs,ls,ks,ts,Il="Mix text and vision content by passing a list of content parts. The Responses API unifies text and images into a single <code>input</code> array.",Ws,k,Rs,ns,vs,es,hl="Responses requests accept conversation history. Add <code>developer</code>, <code>system</code>, and <code>user</code> messages to control the assistant’s behavior without managing chat state yourself.",Vs,W,Ys,as,Xs,Ms,dl="Advanced features use the same request format.",_s,os,Hs,ps,ml="Set <code>stream=True</code> to receive incremental <code>response.*</code> events. Each event arrives as JSON, so you can render words as they stream in or monitor tool execution in real time.",zs,R,Fs,Js,Ls,Ts,fl="Add a <code>tools</code> array to let the model call your functions. The router handles the function calls and returns tool events.",xs,v,Ks,ys,Ds,rs,Cl="Force the model to return JSON matching a schema by supplying a <code>response_format</code>. The Python SDK exposes a <code>.parse</code> helper that converts the response directly into your target type.",Os,V,$l="<p>When calling <code>openai/gpt-oss-120b:groq</code> from JavaScript or raw HTTP, include a brief instruction to return JSON. Without it the model may emit markdown even when a schema is provided.</p>",Ps,Y,sl,is,ll,cs,Bl="Remote MCP lets you call server-hosted tools that implement the Model Context Protocol. Provide the MCP server URL and allowed tools, and the Responses API handles the calls for you.",tl,X,nl,us,el,Us,gl="Some open-source reasoning models expose effort tiers. Pass <code>reasoning={&quot;effort&quot;: &quot;low&quot; | &quot;medium&quot; | &quot;high&quot;}</code> to trade off latency and depth.",al,_,Ml,ws,ol,js,bl='Read the official <a href="https://platform.openai.com/docs/api-reference/responses" rel="nofollow">OpenAI Responses reference</a>.',pl,Is,Jl,ds,Tl;return J=new Hl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),n=new A({props:{title:"Responses API (beta)",local:"responses-api-beta",headingTag:"h1"}}),H=new A({props:{title:"Why build with the Responses API?",local:"why-build-with-the-responses-api",headingTag:"h2"}}),L=new A({props:{title:"Prerequisites",local:"prerequisites",headingTag:"h2"}}),K=new A({props:{title:"Configure your Responses client",local:"configure-your-responses-client",headingTag:"h2"}}),N=new Z({props:{id:"responses-first-call",options:["python","typescript","curl"],$$slots:{default:[Kl]},$$scope:{ctx:w}}}),O=new A({props:{title:"Core Response patterns",local:"core-response-patterns",headingTag:"h2"}}),P=new A({props:{title:"Plain text output",local:"plain-text-output",headingTag:"h3"}}),G=new Z({props:{id:"responses-text",options:["python","typescript","curl"],$$slots:{default:[st]},$$scope:{ctx:w}}}),ls=new A({props:{title:"Multimodal inputs",local:"multimodal-inputs",headingTag:"h3"}}),k=new Z({props:{id:"responses-multimodal",options:["python","typescript","curl"],$$slots:{default:[et]},$$scope:{ctx:w}}}),ns=new A({props:{title:"Multi-turn conversations",local:"multi-turn-conversations",headingTag:"h3"}}),W=new Z({props:{id:"responses-multiturn",options:["python","typescript","curl"],$$slots:{default:[pt]},$$scope:{ctx:w}}}),as=new A({props:{title:"Advanced features",local:"advanced-features",headingTag:"h2"}}),os=new A({props:{title:"Event-based streaming",local:"event-based-streaming",headingTag:"h3"}}),R=new Z({props:{id:"responses-streaming",options:["python","typescript","curl"],$$slots:{default:[rt]},$$scope:{ctx:w}}}),Js=new A({props:{title:"Tool calling and routing",local:"tool-calling-and-routing",headingTag:"h3"}}),v=new Z({props:{id:"responses-tools",options:["python","typescript","curl"],$$slots:{default:[Ut]},$$scope:{ctx:w}}}),ys=new A({props:{title:"Structured outputs",local:"structured-outputs",headingTag:"h3"}}),Y=new Z({props:{id:"responses-structured",options:["python","typescript","curl"],$$slots:{default:[ht]},$$scope:{ctx:w}}}),is=new A({props:{title:"Remote MCP execution",local:"remote-mcp-execution",headingTag:"h3"}}),X=new Z({props:{id:"responses-mcp",options:["python","typescript","curl"],$$slots:{default:[Ct]},$$scope:{ctx:w}}}),us=new A({props:{title:"Reasoning effort controls",local:"reasoning-effort-controls",headingTag:"h3"}}),_=new Z({props:{id:"responses-reasoning",options:["python","typescript","curl"],$$slots:{default:[bt]},$$scope:{ctx:w}}}),ws=new A({props:{title:"API reference",local:"api-reference",headingTag:"h2"}}),Is=new zl({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/inference-providers/guides/responses-api.md"}}),{c(){l=g("meta"),e=j(),s=g("p"),o=j(),y(J.$$.fragment),h=j(),y(n.$$.fragment),a=j(),d=g("p"),d.textContent=f,m=j(),Q=g("blockquote"),Q.innerHTML=yl,ms=j(),y(H.$$.fragment),fs=j(),z=g("p"),z.textContent=rl,Cs=j(),F=g("ul"),F.innerHTML=il,$s=j(),y(L.$$.fragment),Bs=j(),x=g("ul"),x.innerHTML=cl,gs=j(),E=g("blockquote"),E.innerHTML=ul,bs=j(),y(K.$$.fragment),qs=j(),D=g("p"),D.innerHTML=Ul,As=j(),y(N.$$.fragment),Zs=j(),S=g("blockquote"),S.innerHTML=wl,Qs=j(),y(O.$$.fragment),Es=j(),y(P.$$.fragment),Ns=j(),ss=g("p"),ss.innerHTML=jl,Ss=j(),y(G.$$.fragment),Gs=j(),y(ls.$$.fragment),ks=j(),ts=g("p"),ts.innerHTML=Il,Ws=j(),y(k.$$.fragment),Rs=j(),y(ns.$$.fragment),vs=j(),es=g("p"),es.innerHTML=hl,Vs=j(),y(W.$$.fragment),Ys=j(),y(as.$$.fragment),Xs=j(),Ms=g("p"),Ms.textContent=dl,_s=j(),y(os.$$.fragment),Hs=j(),ps=g("p"),ps.innerHTML=ml,zs=j(),y(R.$$.fragment),Fs=j(),y(Js.$$.fragment),Ls=j(),Ts=g("p"),Ts.innerHTML=fl,xs=j(),y(v.$$.fragment),Ks=j(),y(ys.$$.fragment),Ds=j(),rs=g("p"),rs.innerHTML=Cl,Os=j(),V=g("blockquote"),V.innerHTML=$l,Ps=j(),y(Y.$$.fragment),sl=j(),y(is.$$.fragment),ll=j(),cs=g("p"),cs.textContent=Bl,tl=j(),y(X.$$.fragment),nl=j(),y(us.$$.fragment),el=j(),Us=g("p"),Us.innerHTML=gl,al=j(),y(_.$$.fragment),Ml=j(),y(ws.$$.fragment),ol=j(),js=g("p"),js.innerHTML=bl,pl=j(),y(Is.$$.fragment),Jl=j(),ds=g("p"),this.h()},l(t){const M=Xl("svelte-u9bgzb",document.head);l=b(M,"META",{name:!0,content:!0}),M.forEach(p),e=I(t),s=b(t,"P",{}),Wl(s).forEach(p),o=I(t),r(J.$$.fragment,t),h=I(t),r(n.$$.fragment,t),a=I(t),d=b(t,"P",{"data-svelte-h":!0}),q(d)!=="svelte-lw6c1f"&&(d.textContent=f),m=I(t),Q=b(t,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),q(Q)!=="svelte-1evt5ic"&&(Q.innerHTML=yl),ms=I(t),r(H.$$.fragment,t),fs=I(t),z=b(t,"P",{"data-svelte-h":!0}),q(z)!=="svelte-1foojup"&&(z.textContent=rl),Cs=I(t),F=b(t,"UL",{"data-svelte-h":!0}),q(F)!=="svelte-opqm7p"&&(F.innerHTML=il),$s=I(t),r(L.$$.fragment,t),Bs=I(t),x=b(t,"UL",{"data-svelte-h":!0}),q(x)!=="svelte-jbvyx5"&&(x.innerHTML=cl),gs=I(t),E=b(t,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),q(E)!=="svelte-l10c5b"&&(E.innerHTML=ul),bs=I(t),r(K.$$.fragment,t),qs=I(t),D=b(t,"P",{"data-svelte-h":!0}),q(D)!=="svelte-jxllwk"&&(D.innerHTML=Ul),As=I(t),r(N.$$.fragment,t),Zs=I(t),S=b(t,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),q(S)!=="svelte-1vu4874"&&(S.innerHTML=wl),Qs=I(t),r(O.$$.fragment,t),Es=I(t),r(P.$$.fragment,t),Ns=I(t),ss=b(t,"P",{"data-svelte-h":!0}),q(ss)!=="svelte-fnv0zw"&&(ss.innerHTML=jl),Ss=I(t),r(G.$$.fragment,t),Gs=I(t),r(ls.$$.fragment,t),ks=I(t),ts=b(t,"P",{"data-svelte-h":!0}),q(ts)!=="svelte-jiebsx"&&(ts.innerHTML=Il),Ws=I(t),r(k.$$.fragment,t),Rs=I(t),r(ns.$$.fragment,t),vs=I(t),es=b(t,"P",{"data-svelte-h":!0}),q(es)!=="svelte-ms31xx"&&(es.innerHTML=hl),Vs=I(t),r(W.$$.fragment,t),Ys=I(t),r(as.$$.fragment,t),Xs=I(t),Ms=b(t,"P",{"data-svelte-h":!0}),q(Ms)!=="svelte-3pln6h"&&(Ms.textContent=dl),_s=I(t),r(os.$$.fragment,t),Hs=I(t),ps=b(t,"P",{"data-svelte-h":!0}),q(ps)!=="svelte-1xtr3uq"&&(ps.innerHTML=ml),zs=I(t),r(R.$$.fragment,t),Fs=I(t),r(Js.$$.fragment,t),Ls=I(t),Ts=b(t,"P",{"data-svelte-h":!0}),q(Ts)!=="svelte-lvpduh"&&(Ts.innerHTML=fl),xs=I(t),r(v.$$.fragment,t),Ks=I(t),r(ys.$$.fragment,t),Ds=I(t),rs=b(t,"P",{"data-svelte-h":!0}),q(rs)!=="svelte-1yn1mxy"&&(rs.innerHTML=Cl),Os=I(t),V=b(t,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),q(V)!=="svelte-1rkq0jp"&&(V.innerHTML=$l),Ps=I(t),r(Y.$$.fragment,t),sl=I(t),r(is.$$.fragment,t),ll=I(t),cs=b(t,"P",{"data-svelte-h":!0}),q(cs)!=="svelte-cswzn5"&&(cs.textContent=Bl),tl=I(t),r(X.$$.fragment,t),nl=I(t),r(us.$$.fragment,t),el=I(t),Us=b(t,"P",{"data-svelte-h":!0}),q(Us)!=="svelte-bznsrx"&&(Us.innerHTML=gl),al=I(t),r(_.$$.fragment,t),Ml=I(t),r(ws.$$.fragment,t),ol=I(t),js=b(t,"P",{"data-svelte-h":!0}),q(js)!=="svelte-12pcaed"&&(js.innerHTML=bl),pl=I(t),r(Is.$$.fragment,t),Jl=I(t),ds=b(t,"P",{}),Wl(ds).forEach(p),this.h()},h(){hs(l,"name","hf:doc:metadata"),hs(l,"content",At),hs(Q,"class","tip"),hs(E,"class","tip"),hs(S,"class","tip"),hs(V,"class","note")},m(t,M){_l(document.head,l),T(t,e,M),T(t,s,M),T(t,o,M),i(J,t,M),T(t,h,M),i(n,t,M),T(t,a,M),T(t,d,M),T(t,m,M),T(t,Q,M),T(t,ms,M),i(H,t,M),T(t,fs,M),T(t,z,M),T(t,Cs,M),T(t,F,M),T(t,$s,M),i(L,t,M),T(t,Bs,M),T(t,x,M),T(t,gs,M),T(t,E,M),T(t,bs,M),i(K,t,M),T(t,qs,M),T(t,D,M),T(t,As,M),i(N,t,M),T(t,Zs,M),T(t,S,M),T(t,Qs,M),i(O,t,M),T(t,Es,M),i(P,t,M),T(t,Ns,M),T(t,ss,M),T(t,Ss,M),i(G,t,M),T(t,Gs,M),i(ls,t,M),T(t,ks,M),T(t,ts,M),T(t,Ws,M),i(k,t,M),T(t,Rs,M),i(ns,t,M),T(t,vs,M),T(t,es,M),T(t,Vs,M),i(W,t,M),T(t,Ys,M),i(as,t,M),T(t,Xs,M),T(t,Ms,M),T(t,_s,M),i(os,t,M),T(t,Hs,M),T(t,ps,M),T(t,zs,M),i(R,t,M),T(t,Fs,M),i(Js,t,M),T(t,Ls,M),T(t,Ts,M),T(t,xs,M),i(v,t,M),T(t,Ks,M),i(ys,t,M),T(t,Ds,M),T(t,rs,M),T(t,Os,M),T(t,V,M),T(t,Ps,M),i(Y,t,M),T(t,sl,M),i(is,t,M),T(t,ll,M),T(t,cs,M),T(t,tl,M),i(X,t,M),T(t,nl,M),i(us,t,M),T(t,el,M),T(t,Us,M),T(t,al,M),i(_,t,M),T(t,Ml,M),i(ws,t,M),T(t,ol,M),T(t,js,M),T(t,pl,M),i(Is,t,M),T(t,Jl,M),T(t,ds,M),Tl=!0},p(t,[M]){const ql={};M&2&&(ql.$$scope={dirty:M,ctx:t}),N.$set(ql);const Al={};M&2&&(Al.$$scope={dirty:M,ctx:t}),G.$set(Al);const Zl={};M&2&&(Zl.$$scope={dirty:M,ctx:t}),k.$set(Zl);const Ql={};M&2&&(Ql.$$scope={dirty:M,ctx:t}),W.$set(Ql);const El={};M&2&&(El.$$scope={dirty:M,ctx:t}),R.$set(El);const Nl={};M&2&&(Nl.$$scope={dirty:M,ctx:t}),v.$set(Nl);const Sl={};M&2&&(Sl.$$scope={dirty:M,ctx:t}),Y.$set(Sl);const Gl={};M&2&&(Gl.$$scope={dirty:M,ctx:t}),X.$set(Gl);const kl={};M&2&&(kl.$$scope={dirty:M,ctx:t}),_.$set(kl)},i(t){Tl||(c(J.$$.fragment,t),c(n.$$.fragment,t),c(H.$$.fragment,t),c(L.$$.fragment,t),c(K.$$.fragment,t),c(N.$$.fragment,t),c(O.$$.fragment,t),c(P.$$.fragment,t),c(G.$$.fragment,t),c(ls.$$.fragment,t),c(k.$$.fragment,t),c(ns.$$.fragment,t),c(W.$$.fragment,t),c(as.$$.fragment,t),c(os.$$.fragment,t),c(R.$$.fragment,t),c(Js.$$.fragment,t),c(v.$$.fragment,t),c(ys.$$.fragment,t),c(Y.$$.fragment,t),c(is.$$.fragment,t),c(X.$$.fragment,t),c(us.$$.fragment,t),c(_.$$.fragment,t),c(ws.$$.fragment,t),c(Is.$$.fragment,t),Tl=!0)},o(t){u(J.$$.fragment,t),u(n.$$.fragment,t),u(H.$$.fragment,t),u(L.$$.fragment,t),u(K.$$.fragment,t),u(N.$$.fragment,t),u(O.$$.fragment,t),u(P.$$.fragment,t),u(G.$$.fragment,t),u(ls.$$.fragment,t),u(k.$$.fragment,t),u(ns.$$.fragment,t),u(W.$$.fragment,t),u(as.$$.fragment,t),u(os.$$.fragment,t),u(R.$$.fragment,t),u(Js.$$.fragment,t),u(v.$$.fragment,t),u(ys.$$.fragment,t),u(Y.$$.fragment,t),u(is.$$.fragment,t),u(X.$$.fragment,t),u(us.$$.fragment,t),u(_.$$.fragment,t),u(ws.$$.fragment,t),u(Is.$$.fragment,t),Tl=!1},d(t){t&&(p(e),p(s),p(o),p(h),p(a),p(d),p(m),p(Q),p(ms),p(fs),p(z),p(Cs),p(F),p($s),p(Bs),p(x),p(gs),p(E),p(bs),p(qs),p(D),p(As),p(Zs),p(S),p(Qs),p(Es),p(Ns),p(ss),p(Ss),p(Gs),p(ks),p(ts),p(Ws),p(Rs),p(vs),p(es),p(Vs),p(Ys),p(Xs),p(Ms),p(_s),p(Hs),p(ps),p(zs),p(Fs),p(Ls),p(Ts),p(xs),p(Ks),p(Ds),p(rs),p(Os),p(V),p(Ps),p(sl),p(ll),p(cs),p(tl),p(nl),p(el),p(Us),p(al),p(Ml),p(ol),p(js),p(pl),p(Jl),p(ds)),p(l),U(J,t),U(n,t),U(H,t),U(L,t),U(K,t),U(N,t),U(O,t),U(P,t),U(G,t),U(ls,t),U(k,t),U(ns,t),U(W,t),U(as,t),U(os,t),U(R,t),U(Js,t),U(v,t),U(ys,t),U(Y,t),U(is,t),U(X,t),U(us,t),U(_,t),U(ws,t),U(Is,t)}}}const At='{"title":"Responses API (beta)","local":"responses-api-beta","sections":[{"title":"Why build with the Responses API?","local":"why-build-with-the-responses-api","sections":[],"depth":2},{"title":"Prerequisites","local":"prerequisites","sections":[],"depth":2},{"title":"Configure your Responses client","local":"configure-your-responses-client","sections":[],"depth":2},{"title":"Core Response patterns","local":"core-response-patterns","sections":[{"title":"Plain text output","local":"plain-text-output","sections":[],"depth":3},{"title":"Multimodal inputs","local":"multimodal-inputs","sections":[],"depth":3},{"title":"Multi-turn conversations","local":"multi-turn-conversations","sections":[],"depth":3}],"depth":2},{"title":"Advanced features","local":"advanced-features","sections":[{"title":"Event-based streaming","local":"event-based-streaming","sections":[],"depth":3},{"title":"Tool calling and routing","local":"tool-calling-and-routing","sections":[],"depth":3},{"title":"Structured outputs","local":"structured-outputs","sections":[],"depth":3},{"title":"Remote MCP execution","local":"remote-mcp-execution","sections":[],"depth":3},{"title":"Reasoning effort controls","local":"reasoning-effort-controls","sections":[],"depth":3}],"depth":2},{"title":"API reference","local":"api-reference","sections":[],"depth":2}],"depth":1}';function Zt(w){return vl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wt extends Vl{constructor(l){super(),Yl(this,l,Zt,qt,Rl,{})}}export{Wt as component};
