1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[726],{188:(e,s,n)=>{Promise.resolve().then(n.bind(n,8993))},8993:(e,s,n)=>{"use strict";n.r(s),n.d(s,{default:()=>N});var a=n(7437),t=n(8185),r=n(2265),l=n(7239),i=n(9354);let d=l.fC,o=r.forwardRef((e,s)=>{let{className:n,...t}=e;return(0,a.jsx)(l.aV,{ref:s,className:(0,i.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...t})});o.displayName=l.aV.displayName;let c=r.forwardRef((e,s)=>{let{className:n,...t}=e;return(0,a.jsx)(l.xz,{ref:s,className:(0,i.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",n),...t})});c.displayName=l.xz.displayName;let m=r.forwardRef((e,s)=>{let{className:n,...t}=e;return(0,a.jsx)(l.VY,{ref:s,className:(0,i.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...t})});m.displayName=l.VY.displayName;var p=n(8992),u=n(9733),h=n(7931),x=n(8807),f=n(3274);let j={simple:{curl:"curl -X POST 'https://api.kannel.ai/v1/transcribe' \\\n -H 'Authorization: Bearer YOUR_API_KEY' \\\n -F '[email protected]' \\\n -F 'model=medium'",python:'import requests\n\nurl = "https://api.kannel.ai/v1/transcribe"\nheaders = {\n "Authorization": "Bearer YOUR_API_KEY"\n}\nfiles = {\n "file": open("audio.mp3", "rb")\n}\ndata = {\n "model": "medium"\n}\n\nresponse = requests.post(url, headers=headers, files=files, data=data)\nprint(response.json())',node:"const FormData = require('form-data');\nconst fs = require('fs');\n\nconst form = new FormData();\nform.append('file', fs.createReadStream('audio.mp3'));\nform.append('model', 'medium');\n\nconst response = await fetch('https://api.kannel.ai/v1/transcribe', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer YOUR_API_KEY'\n },\n body: form\n});\n\nconst data = await response.json();"},structured:{curl:"curl -X POST 'https://api.kannel.ai/v1/transcribe' \\\n -H 'Authorization: Bearer YOUR_API_KEY' \\\n -F '[email protected]' \\\n -F 'model=latte' \\\n -F 'format={\"conversation\":{\"speaker\":\"string\",\"text\":\"string\"}}'",python:'import requests\n\nurl = "https://api.kannel.ai/v1/transcribe"\nheaders = {\n "Authorization": "Bearer YOUR_API_KEY"\n}\nfiles = {\n "file": open("audio.mp3", "rb")\n}\ndata = {\n "model": "latte",\n "format": \'\'\'{"conversation":{"speaker":"string","text":"string"}}\'\'\'\n}\n\nresponse = requests.post(url, headers=headers, files=files, data=data)\nprint(response.json())',node:"const FormData = require('form-data');\nconst fs = require('fs');\n\nconst form = new FormData();\nform.append('file', fs.createReadStream('audio.mp3'));\nform.append('model', 'latte');\nform.append('format', '{\"conversation\":{\"speaker\":\"string\",\"text\":\"string\"}}');\n\nconst response = await fetch('https://api.kannel.ai/v1/transcribe', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer YOUR_API_KEY'\n },\n body: form\n});\n\nconst data = await response.json();"}},b=()=>(0,a.jsx)("div",{className:"flex justify-center py-8",children:(0,a.jsx)(f.Z,{className:"h-8 w-8 animate-spin text-primary"})});function N(){let[e,s]=(0,r.useState)(!1),[n,l]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{try{let e=await (0,x.d)();l(e)}catch(e){console.error("Failed to load pricing data:",e)}})()},[]);let i=[{name:"Transcribe Audio",method:"POST",path:"/transcribe",description:"Transcribe an audio file with optional JSON structure formatting",request:{type:"multipart/form-data",params:[{name:"file",type:"File",description:"Audio file to transcribe (.mp3, .mpeg, .webm)"},{name:"model",type:"string",description:(null==n?void 0:n.models.map(e=>"".concat(e.name.split(" ")[0].toLowerCase())).join(", "))||"espresso, latte, mocha, cappuccino"}
1,{name:"jsonStructure",type:"string?",description:"Optional JSON template for output formatting"}]},response:{type:"application/json",example:{text:"Transcribed text content",segments:[{text:"Hello world"}]}}}];return n?(0,a.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,a.jsx)(p.h,{}),(0,a.jsx)(h.M,{open:e,onOpenChange:s}),(0,a.jsx)("main",{className:"container mx-auto px-4 pt-24 pb-16",children:(0,a.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,a.jsx)("h1",{className:"text-4xl font-bold mb-8",children:"API Documentation"}),(0,a.jsxs)(t.Zb,{className:"mb-8",children:[(0,a.jsx)(t.Ol,{children:(0,a.jsx)(t.ll,{children:"Getting Started"})}),(0,a.jsx)(t.aY,{children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("p",{children:["To use the Kannel.AI API, you'll need an API key."," ",(0,a.jsx)(u.z,{variant:"link",className:"p-0 h-auto font-normal inline-flex",onClick:()=>s(!0),children:"Contact us"})," ","to get started."]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Base URL"}),(0,a.jsx)("code",{className:"bg-muted p-2 rounded block",children:"https://api.kannel.ai/v1"})]})]})})]}),(0,a.jsx)("h2",{className:"text-2xl font-bold mb-6",children:"Endpoints"}),i.map(e=>(0,a.jsxs)(t.Zb,{className:"mb-8",children:[(0,a.jsxs)(t.Ol,{children:[(0,a.jsxs)(t.ll,{className:"flex items-center gap-4",children:[(0,a.jsx)("span",{className:"text-sm font-mono bg-primary/10 text-primary px-2 py-1 rounded",children:e.method}),(0,a.jsx)("span",{className:"font-mono",children:e.path})]}),(0,a.jsx)("p",{className:"text-muted-foreground mt-2",children:e.description})]}),(0,a.jsx)(t.aY,{children:(0,a.jsxs)(d,{defaultValue:"request",children:[(0,a.jsxs)(o,{children:[(0,a.jsx)(c,{value:"request",children:"Request"}),(0,a.jsx)(c,{value:"response",children:"Response"})]}),(0,a.jsx)(m,{value:"request",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("p",{className:"font-semibold",children:["Content-Type: ",e.request.type]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold mb-2",children:"Parameters:"}),(0,a.jsx)("ul",{className:"space-y-2",children:e.request.params.map(e=>(0,a.jsxs)("li",{className:"flex gap-4",children:[(0,a.jsx)("code",{className:"font-mono",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground",children:e.type}),(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"}),(0,a.jsx)("span",{children:e.description})]},e.name))})]})]})}),(0,a.jsx)(m,{value:"response",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("p",{className:"font-semibold",children:["Content-Type: ",e.response.type]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold mb-2",children:"Example Response:"}),(0,a.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto",children:JSON.stringify(e.response.example,null,2)})]})]})})]})})]},e.path)),(0,a.jsxs)("div",{className:"space-y-6 mt-8",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold",children:"Models"}),(0,a.jsx)("h2",{className:"text-2xl font-semibold mb-6",children:"Flagship models"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-16",children:null==n?void 0:n.models.slice(0,3).map(e=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:e.name.split(" ")[0]}),(0,a.jsx)("p",{className:"text-muted-foreground",children:e.description}),(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsx)("p",{children:"Text input, text output"}),(0,a.jsxs)("p",{className:"text-muted-foreground",children:[e.price," per minute"]})]})]},e.id))}),(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold",children:"Models overview"}),(0,a.jsx)("p",{className:"text-muted-foreground",children:"The Kannel.AI API is powered by a diverse set of models with different capabilities and price points. Each model is optimized for specific types of audio transcription tasks."}),(0,a.jsx)("div",{className:"mt-6",children:n?(0,a.jsxs)("table",{className:"w-full",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b",children:[(0,a.jsx)("th",{className:"text-left py-2 font-semibold",children:"MODEL"}),(0,a.jsx)("th",{className:"text-left py-2 font-semibold",children:"DESCRIPTION"}),(0,a.jsx)("th",{className:"text-left py-2 font-semibold",children:"PRICE"}),(0,a.jsx)("th",{className:"text-left py-2 font-semibold",children:"MAX DURATION"})]})}),(0,a.jsx)("tbody",{children:null==n?void 0:n.models.map(e=>(0,a.jsxs)("tr",{className:"border-b",children:[(0,a.jsx)("td",{className:"py-4 pr-4 align-top",children:(0,a.jsx)("span",{className:"text-primary font-semibold",children:e.name.split(" ")[0]})}),(0,a.jsx)("td",{className:"py-4",children:(0,a.jsx)("p",{children:e.description})}),(0,a.jsx)("td",{className:"py-4",children:e.price}),(0,a.jsxs)("td",{className:"py-4",children:[e.max_duration," minutes"]})]},e.id))})]}):(0,a.jsx)(b,{})}),(0,a.jsx)("div",{className:"mt-8 p-4 bg-muted/30 rounded-lg",children:(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"For all models, the maximum audio duration refers to the length of the input file that can be processed in a single request. Longer files should be split into smaller segments."})})]})]}),(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold",children:"Code Examples"}),(0,a.jsxs)(t.Zb,{children:[(0,a.jsxs)(t.Ol,{children:[(0,a.jsx)(t.ll,{children:"Simple Transcription"}),(0,a.jsx)("p",{className:"text-muted-foreground",children:"Basic audio transcription without output formatting"})]}),(0,a.jsx)(t.aY,{children:(0,a.jsxs)(d,{defaultValue:"curl",children:[(0,a.jsxs)(o,{children:[(0,a.jsx)(c,{value:"curl",children:"cURL"}),(0,a.jsx)(c,{value:"python",children:"Python"}),(0,a.jsx)(c,{value:"node",children:"Node.js"})]}),(0,a.jsx)(m,{value:"curl",children:(0,a.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("code",{children:j.simple.curl})})}),(0,a.jsx)(m,{value:"python",children:(0,a.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("code",{children:j.simple.python})})}),(0,a.jsx)(m,{value:"node",children:(0,a.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("code",{children:j.simple.node})})})]})})]}),(0,a.jsxs)(t.Zb,{children:[(0,a.jsxs)(t.Ol,{children:[(0,a.jsx)(t.ll,{children:"Structured Transcription"}),(0,a.jsx)("p",{className:"text-muted-foreground",children:"Transcription with custom output format"})]}),(0,a.jsx)(t.aY,{children:(0,a.jsxs)(d,{defaultValue:"curl",children:[(0,a.jsxs)(o,{children:[(0,a.jsx)(c,{value:"curl",children:"cURL"}),(0,a.jsx)(c,{value:"python",children:"Python"}),(0,a.jsx)(c,{value:"node",children:"Node.js"})]}),(0,a.jsx)(m,{value:"curl",children:(0,a.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("code",{children:j.structured.curl})})}),(0,a.jsx)(m,{value:"python",children:(0,a.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("code",{children:j.structured.python})})}),(0,a.jsx)(m,{value:"node",children:(0,a.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("code",{children:j.structured.node})})})]})})]})]})]})})]}):(0,a.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,a.jsx)(p.h,{}),(0,a.jsx)("main",{className:"container mx-auto px-4 pt-24 pb-16",children:(0,a.jsx)(b,{})})]})}}},e=>{var s=s=>e(e.s=s);e.O(0,[310,229,736,590,291,130,215,744],()=>s(188)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.