weinc

WeInc AI website builder API client for Ruby. Zero dependencies (pure standard library, Net::HTTP only).

WeInc (we.inc) is an AI website builder: describe an app in natural language and get a live, deployable React + Vite + Tailwind site. This gem is a thin, honest client for the WeInc v1 REST API — it wraps the documented endpoints and adds nothing else.

Install

gem install weinc

Or in your Gemfile:

gem "weinc"

Requires Ruby 2.6+.

Quickstart

Get an API key (starts with wk_) from your WeInc agency dashboard.

require "weinc"

weinc = WeInc::Client.new(api_key: ENV["WEINC_API_KEY"])

# 1. List your projects
result = weinc.list_projects(limit: 10)
puts result["total"]

# 2. Fetch one project
project = weinc.get_project(result["projects"].first["id"])["project"]

# 3. Create a project for a client
created = weinc.create_project(
  "client_email" => "client@example.com",
  "name" => "New Site"
)

# 4. Where is it live?
preview = weinc.get_preview_urls(project["id"])
puts preview["published_url"] # nil if never published

# 5. Clients, templates, plans, analytics
clients   = weinc.list_clients
templates = weinc.list_templates
plans     = weinc.list_plans
analytics = weinc.get_analytics(days: 30)

API

All methods return parsed JSON (Hash/Array) and raise WeInc::Error on any failure (with #status and #body when the server responded).

Method Endpoint
list_projects(limit:, offset:, client_id:, status:) GET /projects
get_project(project_id) GET /projects/{id}
create_project(data) POST /projects (client_email, name required)
update_project(project_id, data) PATCH /projects/{id}
delete_project(project_id) DELETE /projects/{id}
get_preview_urls(project_id) GET /projects/{id}/preview
list_clients GET /clients
create_client(data) POST /clients (email required)
get_client(client_id) GET /clients/{id}
update_client(client_id, data) PATCH /clients/{id}
list_templates GET /templates
list_plans GET /plans
get_analytics(days:, project_id:) GET /analytics

An escape hatch is included for endpoints this client does not wrap:

webhooks = weinc.request("GET", "/webhooks")

Notes on accuracy

  • All wrapped endpoints match the published OpenAPI spec at https://my.we.inc/api/v1/docs, except get_preview_urls, which is implemented by the API but not yet listed in the OpenAPI document; its shape was verified against the WeInc server source on 2026-08-04. If the spec later documents it differently, the spec wins.
  • Authentication: Authorization: Bearer wk_... org API key.

Testing

ruby test/smoke.rb

The smoke test uses a mocked transport — no live API calls are made.

License

MIT