1import{r as b}from"./rolldown-runtime.C1f3BsDW.js";import{t as T}from"./inertia.BE4YqsTM.js";import"./http.DWpeO7Ui.js";import{Bt as q,Jt as v,Mr as S,Qr as P,S as E,i as k,ln as N,r as A,rr as I,wr as O,xr as C,yn as D}from"./icons.ChOq_Y4q.js";import{t as G}from"./react-core.CAMe6Z4j.js";import"./utils.CgzVjNgC.js";import"./state.L8kQliOB.js";import{j as w,jt as f}from"./entry-client.DX3aUoe5.js";import"./dist.CoNAZqlp.js";import"./dist.DxccqHSW.js";import"./dist.D4237Rk6.js";import"./dist.BhzTvz6X.js";import"./es2015.Cr2X04_P.js";import"./dist.C1cc-Zbw.js";import"./badge.CK53iWwP.js";import"./dropdown-menu.D1MnQ7U0.js";import{t as R}from"./SEO.gPDL2mFy.js";import{t as L}from"./useRoute.D5WEuP_a.js";import"./useStartCreatingHref.BVwqKiRT.js";import"./logo.7ZVhR9ER.js";import{t as U}from"./Footer.Ccp81B1O.js";import{t as M}from"./Header.C54sFzrK.js";import{t as y}from"./nav-item.DcPkzsLn.js";var p=b(P(),1);const l="https://mstudio.ai/api/v1",j={apiKey:"60 requests / minute per key",bearerToken:"120 requests / minute per user"},B=[{code:200,meaning:"OK",description:"Request succeeded."},{code:201,meaning:"Created",description:"Resource created successfully."},{code:401,meaning:"Unauthorized",description:"Missing or invalid API key / token."},{code:402,meaning:"Payment Required",description:"Subscription or wallet balance needed."},{code:403,meaning:"Forbidden",description:"Missing required scope or endpoint not available via API key."},{code:404,meaning:"Not Found",description:"Resource does not exist."},{code:422,meaning:"Validation Error",description:"Request body failed validation."},{code:429,meaning:"Rate Limited",description:"Too many requests: wait and retry. With error_code quota_exceeded it is a plan limit instead, and waiting does not help."}],F=[{name:"projects",description:"Projects CRUD, script generation, sharing"},{name:"frames",description:"Frames CRUD, versions, comments, reviews, generation job polling"},{name:"image_generation",description:"AI image generation, editing, multi-shot"},{name:"video_generation",description:"AI video generation, extend, lip-sync"},{name:"audio",description:"Audio tracks CRUD, voice / SFX generation"},{name:"jobs",description:"Generation job polling, cancellation, and retry"},{name:"export",description:"Project exports and video rendering"},{name:"teams",description:"Team CRUD, invites, members"},{name:"assets",description:"Asset uploads, library management"},{name:"voices",description:"Voice library management"}],_=[{id:"projects",title:"Projects",description:"Create and manage storyboard projects.",endpoints:[{method:"GET",path:"/projects",description:"List all your projects. Supports pagination and filtering.",scope:"projects",params:[{name:"status",type:"string",required:!1,description:"Filter by status (e.g. active, archived)"},{name:"search",type:"string",required:!1,description:"Search by name"},{name:"page",type:"integer",required:!1,description:"Page number"}],responseExample:`{ 2 "success": true, 3 "data": [ 4 { 5 "id": 1, 6 "uuid": "abc-123", 7 "name": "My Storyboard", 8 "description": null, 9 "story_description": "A hero embarks on a journey...", 10 "total_frames": 12, 11 "created_at": "2026-01-15T10:30:00Z" 12 } 13 ] 14}`},{method:"POST",path:"/projects",description:"Create a new storyboard project.",scope:"projects",params:[{name:"name",type:"string",required:!0,description:"Project name"},{name:"story_description",type:"string",required:!0,description:"Narrative description for the storyboard"},{name:"duration_minutes",type:"integer",required:!0,description:"Target duration in minutes"},{name:"resolution",type:"string",required:!0,description:"Resolution (e.g. 1920x1080, 1080x1920)"},{name:"description",type:"string",required:!1,description:"Optional short description"},{name:"main_character_name",type:"string",required:!1,description:"Main character name for script generation"}]},{method:"GET",path:"/projects/{uuid}",description:"Get a single project by UUID.",scope:"projects"},{method:"PUT",path:"/projects/{uuid}",description:"Update a project.",scope:"projects",params:[{name:"name",type:"string",required:!1,description:"Project name"},{name:"story_description",type:"string",required:!1,description:"Story description"},{name:"film_instructions",type:"string",required:!1,description:"Your standing instructions for the film (up to 1,000 characters). The script writer and the AI Director follow them; they are not added to picture or clip prompts. If the AI Director's input check refuses them, only the script writer reads them. Send an empty value to clear them."}]},{method:"DELETE",path:"/projects/{uuid}",description:"Delete a project and all associated data.",scope:"projects"},{method:"POST",path:"/projects/{uuid}/generate-script",description:"Generate an AI script with frames from the story description. With replace, the film there now is saved as a script version first and can be restored; pass story_description (and story_source: brief or screenplay) to write it from a new story.",scope:"projects"},{method:"POST",path:"/projects/{uuid}/duplicate",description:"Duplicate a project including all frames.",scope:"projects"}]},{id:"frames",title:"Frames",description:"Manage frames (shots) within a project. Each frame has a script, image, and optional video.",endpoints:[{method:"GET",path:"/projects/{uuid}/frames",description:"List all frames for a project, ordered by sequence.",scope:"frames"},{method:"POST",path:"/projects/{uuid}/frames",description:"Create a new frame in a project.",scope:"frames",params:[{name:"sequence_order",type:"integer",required:!1,description:"Position in sequence (appended if omitted)"}]},{method:"GET",path:"/frames/{id}",description:"Get a single frame with its active version data.",scope:"frames"},{method:"PUT",path:"/frames/{id}",description:"Update frame data (script, prompts, duration, etc.).",scope:"frames",params:[{name:"data",type:"object",required:!1,description:"Frame version data (script, image_prompt, motion_prompt, etc.)"},{name:"duration_seconds",type:"number",required:!1,description:"Frame duration"},{name:"change_summary",type:"string",required:!1,description:"Description of this version change"}]},{method:"DELETE",path:"/frames/{id}",description:"Delete a frame.",scope:"frames"},{method:"PUT",path:"/projects/{uuid}/frames/reorder",description:"Reorder frames within a project.",scope:"frames",params:[{name:"frames",type:"array",required:!0,description:"Array of { id, sequence_order } objects"}]},{method:"GET",path:"/frames/{id}/history",description:"Get version history for a frame.",scope:"frames"},{method:"POST",path:"/frames/{id}/revert",description:"Revert a frame to a previous version.",scope:"frames",params:[{name:"version_id",type:"integer",required:!0,description:"Version ID to revert to"}]}]},{id:"image-generation",title:"Image Generation",description:"Generate AI images for frames. Requires an active subscription or wallet balance.",endpoints:[{method:"POST",path:"/frames/{id}/generate-image",description:"Generate an image from the frame's saved image_prompt, exactly as saved. Sending prompt text here is refused with preparation_required: save it first, or use generate-image-with-references.",scope:"image_generation",paidOnly:!0,params:[{name:"provider",type:"string",required:!1,description:"AI provider slug (e.g. google-imagen). Uses default if omitted."}
14],responseExample:`{ 15 "success": true, 16 "data": { 17 "job_id": 456, 18 "status": "processing", 19 "message": "Image generation started" 20 } 21}`},{method:"POST",path:"/frames/{id}/generate-image-with-references",description:"Generate an image using reference images for style/character consistency.",scope:"image_generation",paidOnly:!0,params:[{name:"prompt",type:"string",required:!0,description:"Image generation prompt, sent as written. Attach reference images by mentioning them in it (@img_â¦, @char_â¦)."},{name:"provider",type:"string",required:!1,description:"AI provider slug"}]},{method:"POST",path:"/frames/{id}/generate-multi-shot",description:"Generate one image holding a grid of shots, then split it into cells.",scope:"image_generation",paidOnly:!0,params:[{name:"base_prompt",type:"string",required:!0,description:"The saved prompt, sent as written. It describes the grid, cells and all."},{name:"grid_layout",type:"string",required:!0,description:"Grid layout, e.g. 2x2 or 1x3"},{name:"provider",type:"string",required:!1,description:"AI provider slug"}]},{method:"POST",path:"/frames/{id}/edit-image",description:"Edit an existing frame image with a text instruction (inpainting). The whole instruction is sent as written and recorded on a generation job.",scope:"image_generation",paidOnly:!0,params:[{name:"prompt",type:"string",required:!0,description:"Edit instruction"},{name:"mask_data_url",type:"string",required:!1,description:"Base64 mask for targeted editing"}]}]},{id:"video-generation",title:"Video Generation",description:"Generate AI videos from frame images. Videos are generated asynchronously â poll the generation job for status.",endpoints:[{method:"POST",path:"/frames/{id}/generate-video",description:"Generate a video from the frame's image using the motion_prompt.",scope:"video_generation",paidOnly:!0,params:[{name:"provider",type:"string",required:!1,description:"AI provider slug (e.g. kling, runway)"},{name:"duration",type:"integer",required:!1,description:"Target video duration in seconds"},{name:"dialogue",type:"string",required:!1,description:"The words spoken in the clip, saved as the shot's line with the prompt. Two or more speakers as Name: words, one a line."}],responseExample:`{ 22 "success": true, 23 "data": { 24 "job_id": 789, 25 "status": "pending", 26 "message": "Video generation queued" 27 } 28}`},{method:"POST",path:"/frames/{id}/extend-video",description:"Extend an existing video with additional content.",scope:"video_generation",paidOnly:!0,params:[{name:"prompt",type:"string",required:!0,description:"Prompt for the video extension"},{name:"provider",type:"string",required:!1,description:"AI provider slug"}]},{method:"POST",path:"/frames/{id}/lip-sync",description:"Generate a MiniMax lip-synced video from a project audio asset and an image. This endpoint is MiniMax-only and does not accept dialogue text directly. To sync an exact line, first generate or upload it as a project audio asset, then pass that asset's ID as audio_asset_id.",scope:"video_generation",paidOnly:!0,params:[{name:"audio_asset_id",type:"integer",required:!0,description:"ID of an MP3 or WAV audio asset in the frame's project; audio must be 4â15 seconds and no larger than 15 MB"},{name:"image_asset_id",type:"integer",required:!1,description:"ID of an image asset in the project; defaults to the frame's active library image"},{name:"motion_instructions",type:"string",required:!1,description:"Usually left out: who says each line is read from the audio's measured transcript. Sent as written only when no transcript can be made"}],responseExample:`{ 29 "success": true, 30 "job_id": 789, 31 "message": "Lip sync started", 32 "provider": "minimax_video" 33}`}]},{id:"generation-jobs",title:"Generation Jobs",description:"Poll the status of async AI generation jobs (image, video, voice, SFX).",endpoints:[{method:"GET",path:"/generation-jobs/{id}",description:"Get the status and result of a generation job.",scope:"frames",responseExample:`{ 34 "success": true, 35 "data": { 36 "id": 789, 37 "type": "video", 38 "status": "completed", 39 "result_url": "https://cdn.example.com/video.mp4", 40 "metadata": { "provider": "kling", "duration": 5 }, 41 "created_at": "2026-01-15T10:30:00Z", 42 "completed_at": "2026-01-15T10:32:00Z" 43 } 44}`},{method:"POST",path:"/generation-jobs/{id}/cancel",description:"Cancel a pending or processing generation job.",scope:"frames"},{method:"POST",path:"/generation-jobs/{id}/retry",description:"Retry a failed generation job.",scope:"frames"}]},{id:"audio",title:"Audio",description:"Manage audio tracks (voiceover, music, SFX) on a project timeline. AI voice and SFX generation require paid access.",endpoints:[{method:"GET",path:"/projects/{uuid}
44/audio-tracks",description:"List all audio tracks for a project.",scope:"audio"},{method:"POST",path:"/projects/{uuid}/audio-tracks",description:"Create an audio track on the timeline.",scope:"audio",params:[{name:"track_type",type:"string",required:!0,description:"Type: voiceover, music, or sfx"},{name:"name",type:"string",required:!0,description:"Track name"},{name:"start_time_ms",type:"integer",required:!0,description:"Start position in milliseconds"},{name:"duration_ms",type:"integer",required:!0,description:"Duration in milliseconds"},{name:"asset_id",type:"integer",required:!1,description:"Link to an uploaded audio asset"}]},{method:"POST",path:"/audio/generate-voice",description:"Generate an AI voiceover from text.",scope:"audio",paidOnly:!0,params:[{name:"project_id",type:"integer",required:!0,description:"Project ID"},{name:"text",type:"string",required:!0,description:"Text to synthesize"},{name:"voice_id",type:"string",required:!0,description:"external_voice_id or id of a voice from GET /projects/{project}/voices, or a voice id from the default provider's library. An id of a voice with no external_voice_id or provider returns 422 unknown_voice."},{name:"provider_slug",type:"string",required:!1,description:"Provider that issued voice_id. Omit it to route by the voice's own provider, or the default provider when no voice matches."}]},{method:"POST",path:"/audio/generate-sfx",description:"Generate an AI sound effect from a text description.",scope:"audio",paidOnly:!0,params:[{name:"project_id",type:"integer",required:!0,description:"Project ID"},{name:"description",type:"string",required:!0,description:"Description of the sound effect"},{name:"duration_seconds",type:"number",required:!1,description:"Target duration"}]}]},{id:"assets",title:"Assets",description:"Upload and manage project assets (images, audio, video files).",endpoints:[{method:"GET",path:"/projects/{uuid}/assets",description:"List assets for a project.",scope:"assets",params:[{name:"category",type:"string",required:!1,description:"Filter: image, audio, video"},{name:"page",type:"integer",required:!1,description:"Page number"}]},{method:"POST",path:"/projects/{uuid}/assets",description:"Upload an asset file (multipart/form-data).",scope:"assets",params:[{name:"file",type:"file",required:!0,description:"The file to upload"},{name:"category",type:"string",required:!1,description:"Category: image, audio, video"}]},{method:"DELETE",path:"/assets/{id}",description:"Delete an asset.",scope:"assets"}]},{id:"export",title:"Export",description:"Export storyboard projects as video files. Requires paid access.",endpoints:[{method:"POST",path:"/projects/{uuid}/export",description:"Start a project export job.",scope:"export",paidOnly:!0,params:[{name:"format",type:"string",required:!1,description:"Output format: mp4, webm, mov (default: mp4)"},{name:"resolution",type:"string",required:!1,description:"Resolution: 720p, 1080p, 4k"},{name:"fps",type:"integer",required:!1,description:"Frame rate: 24, 30, 60"},{name:"include_audio",type:"boolean",required:!1,description:"Include audio tracks (default: true)"}]},{method:"GET",path:"/exports/{id}",description:"Get the status of an export job.",scope:"export",paidOnly:!0},{method:"GET",path:"/exports/{id}/download",description:"Get a download URL for a completed export.",scope:"export",paidOnly:!0}]},{id:"teams",title:"Teams",description:"Create teams and manage members for collaboration.",endpoints:[{method:"GET",path:"/teams",description:"List teams you belong to.",scope:"teams"},{method:"POST",path:"/teams",description:"Create a new team.",scope:"teams",params:[{name:"name",type:"string",required:!0,description:"Team name"}]},{method:"POST",path:"/teams/{id}/invite",description:"Invite a user to the team by email.",scope:"teams",params:[{name:"email",type:"string",required:!0,description:"Email address to invite"},{name:"role",type:"string",required:!1,description:"Role: member or admin"}]},{method:"DELETE",path:"/teams/{id}/members/{userId}",description:"Remove a member from the team.",scope:"teams"}]},{id:"voices",title:"Voices",description:"Manage your voice library for AI voiceover generation.",endpoints:[{method:"GET",path:"/projects/{uuid}/voices",description:"List available voices for a project.",scope:"voices",params:[{name:"filter",type:"string",required:!1,description:"Filter: all, project, system, public, mine"},{name:"gender",type:"string",required:!1,description:"Filter by gender: male, female, neutral"}]},{method:"POST",path:"/projects/{uuid}/voices",description:"Upload a voice sample for cloning (multipart/form-data).",scope:"voices",params:[{name:"file",type:"file",required:!0,description:"Audio file of the voice sample"},{name:"name",type:"string",required:!0,description:"Voice name"},{name:"gender",type:"string",required:!0,description:"Gender: male, female, neutral"}]}
44,{method:"DELETE",path:"/voices/{id}",description:"Delete a voice from your library.",scope:"voices"}]}];var e=b(G(),1),u=typeof window<"u",$={GET:"bg-emerald-500/15 text-emerald-600 border-emerald-500/20",POST:"bg-blue-500/15 text-blue-600 border-blue-500/20",PUT:"bg-primary/15 text-primary border-amber-500/20",PATCH:"bg-orange-500/15 text-orange-600 border-orange-500/20",DELETE:"bg-red-500/15 text-red-600 border-red-500/20"},H=({text:r,className:a})=>{const[s,i]=(0,p.useState)(!1),d=()=>{u&&navigator.clipboard.writeText(r).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)},()=>{})};return(0,e.jsx)(w,{onClick:d,size:"icon-sm",className:a,"aria-label":"Copy to clipboard",icon:s?(0,e.jsx)(O,{className:"h-3.5 w-3.5 text-emerald-400","aria-hidden":"true"}):(0,e.jsx)(I,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"})})},m=({code:r,language:a="bash"})=>(0,e.jsxs)("div",{className:"relative group rounded-lg bg-[#1a1a2e] border border-white/5 overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-white/5",children:[(0,e.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:a}),(0,e.jsx)(H,{text:r})]}),(0,e.jsx)("pre",{className:"p-3 overflow-x-auto text-sm leading-relaxed",children:(0,e.jsx)("code",{className:"text-gray-300 font-mono text-[13px]",children:r})})]}),X=({endpoint:r})=>{const[a,s]=(0,p.useState)(!1),i=K(r),d=J(r);return(0,e.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,e.jsxs)("button",{onClick:()=>s(!a),className:"w-full flex items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-surface-hover outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-ring/50",children:[(0,e.jsx)("span",{className:f("text-[11px] font-bold px-2 py-0.5 rounded border shrink-0 font-mono",$[r.method]||"bg-secondary text-foreground"),children:r.method}),(0,e.jsxs)("code",{className:"text-sm font-mono text-foreground truncate",children:[l,r.path]}),r.paidOnly&&(0,e.jsx)("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-amber-500/20 shrink-0",children:"Paid"}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground ml-auto mr-2 hidden sm:block truncate max-w-[200px]",children:r.description}),(0,e.jsx)(C,{className:f("h-4 w-4 text-muted-foreground shrink-0 transition-transform",a&&"rotate-90"),"aria-hidden":"true"})]}),a&&(0,e.jsxs)("div",{className:"border-t border-border px-4 py-4 space-y-4 bg-card/50",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:r.description}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(v,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Scope:"," ",(0,e.jsx)("code",{className:"text-primary font-mono",children:r.scope})]})]}),r.params&&r.params.length>0&&(0,e.jsxs)("div",{children:[(0,e.jsx)("h4",{className:"text-xs font-semibold text-foreground uppercase tracking-wider mb-2",children:"Parameters"}),(0,e.jsx)("div",{className:"rounded-lg border border-border overflow-hidden",children:(0,e.jsxs)("table",{className:"w-full text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"bg-secondary/50",children:[(0,e.jsx)("th",{className:"text-left px-3 py-2 text-xs font-medium text-muted-foreground",children:"Name"}),(0,e.jsx)("th",{className:"text-left px-3 py-2 text-xs font-medium text-muted-foreground",children:"Type"}),(0,e.jsx)("th",{className:"text-left px-3 py-2 text-xs font-medium text-muted-foreground hidden sm:table-cell",children:"Required"}),(0,e.jsx)("th",{className:"text-left px-3 py-2 text-xs font-medium text-muted-foreground",children:"Description"})]})}),(0,e.jsx)("tbody",{className:"divide-y divide-border",children:r.params.map(o=>(0,e.jsxs)("tr",{children:[(0,e.jsx)("td",{className:"px-3 py-2",children:(0,e.jsx)("code",{className:"text-xs font-mono text-primary",children:o.name})}),(0,e.jsx)("td",{className:"px-3 py-2 text-xs text-muted-foreground font-mono",children:o.type}),(0,e.jsx)("td",{className:"px-3 py-2 text-xs hidden sm:table-cell",children:o.required?(0,e.jsx)("span",{className:"text-primary",children:"required"}):(0,e.jsx)("span",{className:"text-muted-foreground",children:"optional"})}),(0,e.jsx)("td",{className:"px-3 py-2 text-xs text-muted-foreground",children:o.description})]},o.name))})]})})]}
44),r.responseExample&&(0,e.jsxs)("div",{children:[(0,e.jsx)("h4",{className:"text-xs font-semibold text-foreground uppercase tracking-wider mb-2",children:"Response"}),(0,e.jsx)(m,{code:r.responseExample,language:"json"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h4",{className:"text-xs font-semibold text-foreground uppercase tracking-wider mb-2",children:"Examples"}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)(m,{code:i,language:"cURL"}),(0,e.jsx)(m,{code:d,language:"JavaScript"})]})]})]})]})};function K(r){const a=`${l}${r.path}`,s=[`curl -X ${r.method} "${a}"`];if(s.push(' -H "X-API-Key: sk_live_your_key_here"'),s.push(' -H "Accept: application/json"'),["POST","PUT","PATCH"].includes(r.method)&&(s.push(' -H "Content-Type: application/json"'),r.params?.some(i=>i.required))){const i={};for(const d of r.params.filter(o=>o.required&&o.type!=="file"))i[d.name]=`<${d.type}>`;Object.keys(i).length>0&&s.push(` -d '${JSON.stringify(i,null,2).split(` 45`).join(` 46 `)}'`)}return s.join(` \\ 47`)}function J(r){const a=`${l}${r.path}`,s=[];if(s.push(`const response = await fetch("${a}", {`),s.push(` method: "${r.method}",`),s.push(" headers: {"),s.push(' "X-API-Key": "sk_live_your_key_here",'),s.push(' "Accept": "application/json",'),["POST","PUT","PATCH"].includes(r.method)&&s.push(' "Content-Type": "application/json",'),s.push(" },"),["POST","PUT","PATCH"].includes(r.method)&&r.params?.some(i=>i.required&&i.type!=="file")){const i={};for(const d of r.params.filter(o=>o.required&&o.type!=="file"))i[d.name]=`<${d.type}>`;Object.keys(i).length>0&&s.push(` body: JSON.stringify(${JSON.stringify(i,null,4).split(` 48`).join(` 49 `)}),`)}return s.push("});"),s.push(""),s.push("const data = await response.json();"),s.push("console.log(data);"),s.join(` 50`)}var x=[{id:"authentication",label:"Authentication",icon:N},{id:"rate-limits",label:"Rate limits",icon:A},..._.map(r=>({id:r.id,label:r.title,icon:D})),{id:"errors",label:"Error codes",icon:E}],g=80;const V=()=>{const r=L(),[a,s]=(0,p.useState)("authentication"),[i,d]=(0,p.useState)(!1);(0,p.useEffect)(()=>{if(!u)return;const t=window.location.hash.replace("#","");t&&requestAnimationFrame(()=>{const n=document.getElementById(t);if(n){const c=n.getBoundingClientRect().top+window.scrollY-g;window.scrollTo({top:c,behavior:"smooth"}),s(t)}})},[]),(0,p.useEffect)(()=>{if(!u)return;const t=()=>{const n=x.map(c=>document.getElementById(c.id)).filter(Boolean);for(let c=n.length-1;c>=0;c--)if(n[c].getBoundingClientRect().top<=g+40){const h=n[c].id;s(h),window.location.hash!==`#${h}`&&window.history.replaceState(null,"",`#${h}`);break}};return window.addEventListener("scroll",t,{passive:!0}),()=>window.removeEventListener("scroll",t)},[]);const o=t=>{if(!u)return;const n=document.getElementById(t);if(n){const c=n.getBoundingClientRect().top+window.scrollY-g;window.scrollTo({top:c,behavior:"smooth"}),window.history.replaceState(null,"",`#${t}`),d(!1)}};return(0,e.jsxs)("div",{className:"min-h-screen bg-background flex flex-col",children:[(0,e.jsx)(R,{title:"API Documentation",description:"Complete reference for the M Studio public API. Authenticate with API keys, manage projects, generate AI images and videos, and more.",keywords:"api documentation, api reference, storyboard api, ai video api",ogImage:"https://assets.modelslab.ai/generations/6e5eb3a6-cc24-435f-bc76-ed8df1cee89d.webp"}),(0,e.jsx)(M,{variant:"blur"}),(0,e.jsx)("main",{id:"main-content",className:"flex-1 pt-28 pb-16",children:(0,e.jsxs)("div",{className:"container mx-auto px-4 max-w-7xl",children:[(0,e.jsxs)("div",{className:"mb-8",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-primary mb-2",children:[(0,e.jsx)(S,{className:"h-5 w-5","aria-hidden":"true"}),(0,e.jsx)("span",{className:"text-sm font-medium uppercase tracking-wider",children:"API reference"})]}),(0,e.jsx)("h1",{className:"text-3xl font-bold text-foreground",children:"M Studio API documentation"}),(0,e.jsx)("p",{className:"text-muted-foreground mt-2 max-w-2xl",children:"Build integrations with M Studio's public API. Create projects, generate AI images and videos, manage audio, and export â all from your own code."})]}),(0,e.jsxs)("div",{className:"lg:hidden fixed bottom-4 right-4 z-50",children:[(0,e.jsx)(w,{onClick:()=>d(!i),variant:"default",size:"icon-lg",className:"h-12 w-12 rounded-full shadow-lg","aria-label":"Toggle section navigation",icon:i?(0,e.jsx)(k,{className:"h-5 w-5","aria-hidden":"true"}):(0,e.jsx)(q,{className:"h-5 w-5","aria-hidden":"true"})}),i&&(0,e.jsx)("nav",{className:"absolute bottom-14 right-0 w-56 max-h-[60vh] overflow-y-auto rounded-xl bg-card border border-border shadow-xl p-2 space-y-0.5",children:x.map(t=>(0,e.jsxs)("button",{type:"button",onClick:()=>o(t.id),"aria-current":a===t.id?"true":void 0,className:y(a===t.id),children:[(0,e.jsx)(t.icon,{"aria-hidden":"true"}),(0,e.jsx)("span",{className:"truncate",children:t.label})]},t.id))})]}),(0,e.jsxs)("div",{className:"flex gap-8",children:[(0,e.jsx)("aside",{className:"hidden lg:block w-52 shrink-0",children:(0,e.jsx)("nav",{className:"sticky top-24 space-y-0.5",children:x.map(t=>(0,e.jsxs)("button",{type:"button",onClick:()=>o(t.id),"aria-current":a===t.id?"true":void 0,className:y(a===t.id),children:[(0,e.jsx)(t.icon,{"aria-hidden":"true"}),(0,e.jsx)("span",{className:"truncate",children:t.label})]},t.id))})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0 space-y-12",children:[(0,e.jsxs)("section",{id:"authentication",children:[(0,e.jsx)("h2",{className:"text-xl font-bold text-foreground mb-4",children:"Authentication"}),(0,e.jsxs)("div",{className:"prose-sm space-y-4",children:[(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Authenticate by passing your API key in the"," ",(0,e.jsx)("code",{className:"text-primary bg-primary/10 px-1.5 py-0.5 rounded text-xs font-mono",children:"X-API-Key"})," ","header with every request."]}),(0,e.jsxs)("div",{className:"p-4 rounded-lg border border-primary/20 bg-primary/5",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Qu
50ick start"}),(0,e.jsxs)("ol",{className:"list-decimal list-inside space-y-1.5 text-sm text-muted-foreground",children:[(0,e.jsxs)("li",{children:["Go to"," ",(0,e.jsx)(T,{href:r("settings"),className:"text-primary hover:underline",children:"Settings â Developer"})," ","and create an API key."]}),(0,e.jsx)("li",{children:"Copy the key (it is only shown once)."}),(0,e.jsxs)("li",{children:["Add"," ",(0,e.jsx)("code",{className:"text-primary bg-primary/10 px-1 py-0.5 rounded text-xs font-mono",children:"X-API-Key: sk_live_..."})," ","to your requests."]})]})]}),(0,e.jsx)(m,{code:`curl -H "X-API-Key: sk_live_your_key_here" \\ 51 -H "Accept: application/json" \\ 52 ${l}/projects`,language:"cURL"}),(0,e.jsx)(m,{code:`const response = await fetch("${l}/projects", { 53 headers: { 54 "X-API-Key": "sk_live_your_key_here", 55 "Accept": "application/json", 56 }, 57}); 58 59const { data } = await response.json(); 60console.log(data); // your projects`,language:"JavaScript"}),(0,e.jsxs)("div",{className:"mt-6",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-3",children:"Scopes"}),(0,e.jsxs)("p",{className:"text-sm text-muted-foreground mb-3",children:["Each API key can be restricted to specific scopes. Use"," ",(0,e.jsx)("code",{className:"text-primary bg-primary/10 px-1 py-0.5 rounded text-xs font-mono",children:"*"})," ","for full access."]}),(0,e.jsx)("div",{className:"rounded-lg border border-border overflow-hidden",children:(0,e.jsxs)("table",{className:"w-full text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"bg-secondary/50",children:[(0,e.jsx)("th",{className:"text-left px-3 py-2 text-xs font-medium text-muted-foreground",children:"Scope"}),(0,e.jsx)("th",{className:"text-left px-3 py-2 text-xs font-medium text-muted-foreground",children:"Access"})]})}),(0,e.jsx)("tbody",{className:"divide-y divide-border",children:F.map(t=>(0,e.jsxs)("tr",{children:[(0,e.jsx)("td",{className:"px-3 py-2",children:(0,e.jsx)("code",{className:"text-xs font-mono text-primary",children:t.name})}),(0,e.jsx)("td",{className:"px-3 py-2 text-xs text-muted-foreground",children:t.description})]},t.name))})]})})]})]})]}),(0,e.jsxs)("section",{id:"rate-limits",children:[(0,e.jsx)("h2",{className:"text-xl font-bold text-foreground mb-4",children:"Rate limits"}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Requests are rate-limited per API key or per user (for Bearer token auth)."}),(0,e.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,e.jsxs)("div",{className:"p-4 rounded-lg border border-border bg-card",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,e.jsx)(N,{className:"h-4 w-4 text-primary","aria-hidden":"true"}),(0,e.jsx)("span",{className:"text-sm font-medium text-foreground",children:"API key"})]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:j.apiKey})]}),(0,e.jsxs)("div",{className:"p-4 rounded-lg border border-border bg-card",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,e.jsx)(v,{className:"h-4 w-4 text-primary","aria-hidden":"true"}),(0,e.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Bearer token"})]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:j.bearerToken})]})]}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["When rate limited you'll receive a"," ",(0,e.jsx)("code",{className:"text-primary bg-primary/10 px-1 py-0.5 rounded text-xs font-mono",children:"429"})," ","response. Wait and retry with exponential backoff."]})]})]}),_.map(t=>(0,e.jsxs)("section",{id:t.id,children:[(0,e.jsx)("h2",{className:"text-xl font-bold text-foreground mb-1",children:t.title}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:t.description}),(0,e.jsx)("div",{className:"space-y-2",children:t.endpoints.map((n,c)=>(0,e.jsx)(X,{endpoint:n},`${n.method}-${n.path}-${c}`))})]},t.id)),(0,e.jsxs)("section",{id:"errors",children:[(0,e.jsx)("h2",{className:"text-xl font-bold text-foreground mb-4",children:"Error codes"}),(0,e.jsxs)("p",{className:"text-sm text-muted-foreground mb-4",children:["All responses use standard HTTP status codes. Error responses include a JSON body with"," ",(0,e.jsx)("code",{className:"text-primary bg-primary/10 px-1 py-0.5 rounded text-xs font-mono",children:"success: false"})," ","and a human-readable"," ",(0,e.jsx)("code",{className:"text-primary bg-primary/10 px-1 py-0.5 rounded text-xs font-mono",children:"message"}),"."]}),(0,e.jsx)("div",{className:"rounded-lg border border-border overflow-hidden",children:(0,e.jsxs)("table",{className:"w-full text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"bg-secondary/50",children:[(0,e.jsx)("th",{className:"text-left px-3 py-2 text-xs font-medium text-muted-foreground w-20",children:"Code"}),(0,e.jsx)("th",{className:"text-left px-3 py-2 text-xs font-medium text-muted-foreground w-36",children:"Status"}),(0,e.jsx)("th",{className:"text-left px-3 py-2 text-xs font-medium text-muted-foreground",children:"Description"})]})}),(0,e.jsx)("tbody",{className:"divide-y divide-border",children:B.map(t=>(0,e.jsxs)("tr",{children:[(0,e.jsx)("td",{className:"px-3 py-2",children:(0,e.jsx)("code",{className:"text-xs font-mono font-bold text-foreground",children:t.code})}),(0,e.jsx)("td",{className:"px-3 py-2 text-xs font-medium text-foreground",children:t.meaning}),(0,e.jsx)("td",{className:"px-3 py-2 text-xs text-muted-foreground",children:t.description})]},t.code))})]})}),(0,e.jsxs)("div",{className:"mt-4",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Error response format"}),(0,e.jsx)(m,{code:`{ 61 "success": false, 62 "message": "API key missing required scope: video_generation" 63}`,language:"json"})]})]})]})]})]})}),(0,e.jsx)(U,{})]})};var ye=V;export{V as DocsPage,ye as default};
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.