Skip to main content

Get started in 4 steps

Setup Workser API to use in your platform

Step 1: Set up API Key

Create your first Workser API Key

  1. Open Dashboard
  2. Navigate to API Keys tab in sidebar Screenshot 2568-10-01 at 20.40.05.png
  3. Click Create New API Key button
  4. Select All scope to enable all API endpoints, Select Admin Permissions to all all endpoints, then click Create API Key button Screenshot 2568-10-01 at 20.42.40.png
  5. Save API Key (it will not show again due to security reason)
You can create new API key ot Delete API Key anytime

Step 2: Create Software Product

Create software product to be vibe coding tempalte to use with Workser API in your platform to help your user get expected web app effortlessly with preset environment variables and api specs context to use web app with your existing backend.
Build reusable vibe coding template to use in your platform at scale
  1. Open   dashboard
  2. Click Products  tab in sidebar Screenshot 2568-10-01 at 20.48.28.png
  3. Click Add Product  button
  4. Input your product name and description then click Add Product
  5. Click new product you just added Screenshot 2568-10-01 at 20.48.52.png
 Setup Environment Variables, API Specs, and Knowledge Base in Product pageScreenshot 2568-10-01 at 20.48.52.png
  1. Select Environment Variable tab
  2. Add static environment variable (dynamic environement variable for dynamic user data coming soon !) that will reuse every time you create new project under this software product  Screenshot 2568-10-01 at 20.49.00.png
  3. Select API Specs tab
  4. Add  api specs that will use in project by Coding AI Agent to call your existing backend services Screenshot 2568-10-01 at 20.49.40.png
  5. Select Knowledge Base tab
  6. Add Knowledge Base so Coding AI Agent can use as reference for crieria about tech stack, business logic, library, and etc. Those important for this software product to be reuse such as langchain code knowledge to use to be chatbot in NextJS server action. Screenshot 2568-10-01 at 20.49.48.png
You can change these context anytime. The more precise you set context, the more Coding AI Agent can deliver more precision of code for your software product use case.
Build custom branding so your Vibe coding prebuilt UI will show your branding information to your user to percieve your brand like use in your product
  1. Select Brandingtab Screenshot 2568-10-01 at 21.06.47.png
  2. Upload your brand Logo
  3. Setup your Brand Primary Color with hexadecimal
  4. Select Background Mode
  5. Setup AI Agent Name  to appear to your user in prebuilt UI
  6. Click Save Changes  on the bottom right to save yourcustom branding
Example of Prebuilt UI with Custom BrandingScreenshot 2568-10-01 at 12.26.41.png

Step 3: Call your first Workser API

  1. Copy Software Product Id in product page Screenshot 2568-10-01 at 21.35.51.png
  2. Call Workser API on your code NextJS server action example
    'use server'
    
    interface Task {
      id: string
      project_id: string
      name: string
      description: string
      status: 'in_progress' | 'completed' | 'failed' | 'pending'
      text_requirement: string
      files_requirement: string | null
      metadata: Record<string, any> | null
      created_at: string
      updated_at: string
    }
    
    interface CreateProjectResponse {
      id: string
      software_product_id: string
      name: string
      description: string
      sandbox_id: string | null
      project_type: 'web' | 'mobile' | 'api'
      project_template_type: string
      created_at: string
      updated_at: string
      return_url: string
      ref_id: string
      task: Task
      prebuilt_url: string
    }
    
    interface CreateProjectRequest {
      software_product_id: string
      name: string
      description: string
      text_requirement: string
      project_type: string
      return_url: string
      ref_id: string
    }
    
    export async function createWorkserProject() {
      const apiKey = process.env.WORKSER_API_KEY
    
      if (!apiKey) {
        throw new Error('WORKSER_API_KEY is not configured')
      }
    
      const body: CreateProjectRequest = {
        software_product_id: "{your-own-software-product-id}",
        name: "Phuket 3 stars Airbnb: Urus Chill House",
        description: "Phuket 3 stars Airbnb is web site to represent my hueshoust in Phuket with futuristic design, informative aout hotel needs, and functionality to booking.",
        text_requirement: "Create Hotel website for Phuket 3 stars Airbnb (Urus Chill House) is web site to represent my hueshoust in Phuket with futuristic design, informative aout hotel needs, and functionality to booking.",
        project_type: "web",
        return_url: "https://{your-domain}/{your-return-path}",
        ref_id: "{your-user-project-reference-id}"
      }
    
      try {
        const response = await fetch('https://api.workser.ai/v1/projects', {
          method: 'POST',
          headers: {
            'Authorization': `Bearer ${apiKey}`,
            'Content-Type': 'application/json',
          },
          body: JSON.stringify(body),
        })
    
        if (!response.ok) {
          const errorData = await response.json().catch(() => ({}))
          throw new Error(
            `API request failed: ${response.status} ${response.statusText}. ${JSON.stringify(errorData)}`
          )
        }
    
        const data: CreateProjectResponse = await response.json()
        return { success: true, data }
      } catch (error) {
        console.error('Error creating Workser project:', error)
        return { 
          success: false, 
          error: error instanceof Error ? error.message : 'Unknown error' 
        }
      }
    }
    
    'use client'
    
    import { useState } from 'react'
    import { useRouter } from 'next/navigation'
    import { createWorkserProject } from '@/app/actions/workser'
    
    export default function MyComponent() {
      const router = useRouter()
      const [isLoading, setIsLoading] = useState(false)
    
      const handleCreateProject = async () => {
        setIsLoading(true)
        
        try {
          const result = await createWorkserProject()
          
          if (result.success) {
            console.log('Project created:', result.data)
            // Redirect to the prebuilt URL
            router.push(result.data.prebuilt_url)
          } else {
            console.error('Failed to create project:', result.error)
            alert('Failed to create project: ' + result.error)
          }
        } finally {
          setIsLoading(false)
        }
      }
    
      return (
        <button 
          onClick={handleCreateProject}
          disabled={isLoading}
        >
          {isLoading ? 'Creating Project...' : 'Create Project'}
        </button>
      )
    }
    
[Optional] Redirect user to Prebuilt UIScreenshot 2568-10-01 at 12.29.10.pngCongrats ! You got your first vibe coding project  on Workser using Vibe Coding API

Next steps

Now that you have your docs running, explore these key features: