Programmatic “Create App from Prompt” API (Agent + Workspace)

Hi Replit team :waving_hand:

I’m building an external service that would provision Replit workspaces from user prompts (e.g., for an app-builder / studio workflow). Right now, the Agent inside the Replit UI can already do something amazing:

“Create a new app and scaffold the project structure from a natural language description.”

However, there doesn’t seem to be a publicly documented API that lets us do the equivalent from our own backend:

  1. Create a new Replit project/workspace (Repl) programmatically, and

  2. Pass a natural-language prompt to Replit Agent to scaffold the app structure inside that new workspace.

This is exactly the flow I’d like to implement:

  1. My app collects requirements from a user (via a multi-step prompt/quiz).

  2. My backend calls a Replit API like CreateReplFromPrompt.

  3. Replit Agent sets up the file structure, dependencies, and starter code based on the prompt.

  4. I receive a repl_url that I can show to the user (“Your app is ready in Replit – click here to edit and deploy”).


Proposed API Design

1. REST Example

POST /v1/repls/from-prompt
Authorization: Bearer YOUR_REPLIT_API_TOKEN
Content-Type: application/json

{
  "prompt": "Create a full-stack TypeScript app with a React front-end and an Express backend. Include a /api/health endpoint and a basic login page using dummy users.",
  "template": "nodejs",              // or "python", "nextjs", etc.
  "visibility": "private",           // "public" | "private"
  "title": "customer-portal-demo",
  "description": "Generated via external app builder",
  "env": {
    "NODE_VERSION": "20.x"
  }
}

Response:

{
  "id": "some-repl-id",
  "url": "https://replit.com/@username/customer-portal-demo",
  "slug": "customer-portal-demo",
  "language": "nodejs",
  "visibility": "private",
  "agent_run_id": "agent-run-12345",
  "status": "scaffolding" // or "ready"
}

2. Follow-up: Agent Status & Logs

It would also be useful to query the Agent’s progress/logs, for example:

GET /v1/agent/runs/agent-run-12345
Authorization: Bearer YOUR_REPLIT_API_TOKEN

Response:

{
  "id": "agent-run-12345",
  "repl_id": "some-repl-id",
  "status": "completed", // "queued" | "running" | "failed" | "completed"
  "summary": "Created React front-end, Express backend, /api/health endpoint, and sample login page.",
  "logs": [
    "Created package.json",
    "Installed dependencies: react, react-dom, express, typescript",
    "Created src/App.tsx",
    "Created server/index.ts",
    "Configured DevContainer and run command"
  ]
}


Possible GraphQL Shape

If this is better aligned with Replit’s existing architecture, a GraphQL mutation could work too:

mutation CreateReplFromPrompt($input: CreateReplFromPromptInput!) {
  createReplFromPrompt(input: $input) {
    repl {
      id
      url
      slug
      language
      visibility
    }
    agentRun {
      id
      status
    }
  }
}

With variables:

{
  "input": {
    "prompt": "Create a Flask app with /health and /users endpoints, using an in-memory store.",
    "template": "python",
    "visibility": "private",
    "title": "flask-demo-app"
  }
}


Why this would be powerful

This API would unlock use cases like:

  • White-label app builders that spin up ready-to-edit Repls from business requirements.

  • Education platforms that auto-generate Replit workspaces per student, based on lesson templates and prompts.

  • Internal tools that generate boilerplate apps for teams (following company standards) and hand developers a Repl link.

Right now, we can sort of approximate the flow with:

  • Our own LLM to generate code structure locally,

  • Push to GitHub, and

  • Ask users to import into Replit manually.

But that loses the tight Replit Agent integration and adds extra friction. A first-class “Create Repl from Prompt” API would make Replit an even better backend for AI-native dev tools.


Minimum viable version

Even a minimal version would be hugely useful:

  • Only supports a subset of languages/templates (nodejs, python, react, etc.).

  • Only returns repl_url and a simple status.

  • No advanced logs at first.

Something like:

POST /v1/repls/from-prompt
{
  "prompt": "Create a simple Next.js app with a landing page and /api/ping endpoint.",
  "template": "nextjs"
}

Response:

{
  "url": "https://replit.com/@username/nextjs-app-123"
}


If there is an existing or experimental way to do something like this (even if undocumented or beta), I’d love pointers. Otherwise, I hope this makes a good case for a Replit Agent + Repl provisioning API for external tools and platforms. :folded_hands:

Thanks for considering it!