> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneshotagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Build

> Build and deploy production websites, landing pages, portfolios, and more

## Overview

The Build API creates fully-functional, production-ready websites from product descriptions. From SaaS landing pages to portfolios, restaurant sites to event pages — OneShot analyzes your requirements, generates professional content, and deploys to live URLs with real hosting infrastructure.

**Coming soon:** Full-stack applications with databases, authentication, and backend logic.

## Authentication

Requires x402 payment. First call returns a quote (402), second call with payment executes.

## Request Body

<ParamField body="product" type="object" required>
  Product information for the website.

  <Expandable title="product properties">
    <ParamField body="product.name" type="string" required>
      Product or business name
    </ParamField>

    <ParamField body="product.description" type="string" required>
      Description of the product/service (minimum 10 characters)
    </ParamField>

    <ParamField body="product.industry" type="string">
      Industry category (e.g., "SaaS", "E-commerce", "Consulting")
    </ParamField>

    <ParamField body="product.pricing" type="string">
      Pricing information to display (e.g., "Free tier, Pro \$12/mo")
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="type" type="string" default="saas">
  Build type. Options: `saas`, `portfolio`, `agency`, `personal`, `product`, `funnel`, `restaurant`, `event`, `app`, `social`
</ParamField>

<ParamField body="source_url" type="string">
  URL to analyze for content/inspiration. Adds \$10 to quote.
</ParamField>

<ParamField body="sections" type="string[]">
  Specific sections to include (e.g., `["hero", "features", "pricing", "testimonials"]`)
</ParamField>

<ParamField body="lead_capture" type="object">
  Lead capture form configuration.

  <Expandable title="lead_capture properties">
    <ParamField body="lead_capture.enabled" type="boolean">
      Enable lead capture form. Adds \$15 to quote.
    </ParamField>

    <ParamField body="lead_capture.inbox_email" type="string">
      Email to receive leads (defaults to agent inbox)
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="brand" type="object">
  Brand customization options.

  <Expandable title="brand properties">
    <ParamField body="brand.primary_color" type="string">
      Primary brand color in hex format (e.g., `#4F46E5`)
    </ParamField>

    <ParamField body="brand.font" type="string">
      Font family preference
    </ParamField>

    <ParamField body="brand.tone" type="string">
      Brand tone: `professional`, `playful`, `bold`, or `minimal`
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="images" type="object">
  Image URLs to use.

  <Expandable title="images properties">
    <ParamField body="images.hero" type="string">
      Hero image URL
    </ParamField>

    <ParamField body="images.logo" type="string">
      Logo image URL
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="domain" type="string">
  Custom domain (e.g., `mysite.com`). Adds the registrar price (typically \~\$10–15) to quote.
</ParamField>

<ParamField body="build_id" type="string">
  Existing build ID to update (for iterations). Use `/update` endpoint instead.
</ParamField>

<Snippet file="audit-context-params.mdx" />

## Quote Response (402)

The first request returns pricing and analysis:

<ResponseField name="context.quote_id" type="string">
  Quote ID to include in payment request
</ResponseField>

<ResponseField name="context.type" type="string">
  Inferred website type
</ResponseField>

<ResponseField name="context.product_name" type="string">
  Product name from request
</ResponseField>

<ResponseField name="context.analysis" type="object">
  AI analysis of the build request
</ResponseField>

<ResponseField name="context.pricing" type="object">
  Detailed pricing breakdown
</ResponseField>

<ResponseField name="context.expires_at" type="string">
  Quote expiration timestamp (1 hour)
</ResponseField>

## Execution Response (202)

After payment, the build is initiated:

<ResponseField name="request_id" type="string">
  Job ID for tracking build status
</ResponseField>

<ResponseField name="status" type="string">
  `processing` - build is in progress
</ResponseField>

<ResponseField name="build.lead_capture_email" type="string">
  Email address for lead capture (if enabled)
</ResponseField>

<ResponseField name="build.total_price" type="string">
  Total amount charged
</ResponseField>

## Completed Job Result

Poll `/v1/requests/{request_id}` for the result:

<ResponseField name="result.url" type="string">
  Live URL (e.g., `https://taskflow.oneshotagent.com`)
</ResponseField>

<ResponseField name="result.preview_url" type="string">
  Preview URL before DNS propagation
</ResponseField>

<ResponseField name="result.lead_capture_email" type="string">
  Email address receiving lead submissions
</ResponseField>

<ResponseField name="result.design_score" type="number">
  AI-evaluated quality score (1-10)
</ResponseField>

<RequestExample>
  ```bash cURL (Get Quote) theme={null}
  curl -X POST https://win.oneshotagent.com/v1/tools/build \
    -H "Content-Type: application/json" \
    -H "X-Agent-ID: 0xYourWalletAddress" \
    -d '{
      "type": "saas",
      "product": {
        "name": "TaskFlow",
        "description": "AI-powered task management for remote teams. Automate workflows, track progress, and collaborate seamlessly.",
        "industry": "Productivity",
        "pricing": "Free tier, Pro $12/mo, Team $29/mo"
      },
      "lead_capture": {
        "enabled": true
      },
      "brand": {
        "primary_color": "#4F46E5",
        "tone": "professional"
      }
    }'
  ```

  ```typescript SDK theme={null}
  import { OneShot } from "@oneshot-agent/sdk";

  const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });

  const result = await agent.build({
    type: "saas",
    product: {
      name: "TaskFlow",
      description: "AI-powered task management for remote teams. Automate workflows, track progress, and collaborate seamlessly.",
      industry: "Productivity",
      pricing: "Free tier, Pro $12/mo, Team $29/mo"
    },
    lead_capture: { enabled: true },
    brand: {
      primary_color: "#4F46E5",
      tone: "professional"
    }
  });

  console.log("Website URL:", result.url);
  console.log("Lead capture:", result.lead_capture_email);
  ```
</RequestExample>

<ResponseExample>
  ```json Quote Response (402) theme={null}
  {
    "error": "payment_required",
    "message": "Payment required for website build.",
    "payment_request": {
      "chain_id": 8453,
      "token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "25.00",
      "recipient": "0x..."
    },
    "context": {
      "tool": "build",
      "quote_id": "quote_abc123",
      "type": "saas",
      "product_name": "TaskFlow",
      "analysis": {
        "inferred_type": "saas",
        "estimated_sections": 5,
        "needs_lead_capture": true,
        "complexity_score": 0.7,
        "reasoning": "SaaS product with pricing tiers and team features"
      },
      "pricing": {
        "base_price": "10.00",
        "extra_sections_fee": "10.00",
        "lead_capture_fee": "5.00",
        "source_analysis_fee": "0.00",
        "custom_domain_fee": "0.00",
        "total": "25.00"
      },
      "expires_at": "2024-01-15T12:00:00Z"
    }
  }
  ```

  ```json Execution Response (202) theme={null}
  {
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "processing",
    "tool": "build",
    "message": "Build initiated. Results available at /v1/requests/{id}.",
    "build": {
      "type": "saas",
      "product_name": "TaskFlow",
      "lead_capture_email": "leads@agent123.inbox.oneshot.build",
      "total_price": "25.00"
    }
  }
  ```

  ```json Completed Result theme={null}
  {
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "completed",
    "result": {
      "status": "deployed",
      "url": "https://taskflow.oneshotagent.com",
      "preview_url": "https://taskflow-abc123.vercel.app",
      "lead_capture_email": "leads@agent123.inbox.oneshot.build",
      "design_score": 8.5
    }
  }
  ```
</ResponseExample>

<Info>See [Pricing](/pricing) for build costs. All builds include high-quality stock images from Unsplash at no extra cost. Updates to existing builds are discounted — use the Update Build endpoint with your `build_id`.</Info>
