# Quickstart

> Build an API for a website, test it, and call it from code or your AI assistant in about ten minutes.

Source: https://usewrit.app/docs/quickstart/

You tell Writ what you need from a website. It builds an API for that site, tests it, and gives you
a URL your code can call and a tool your AI assistant can use. This page takes you from nothing to
a working call.

## Make a call right now

You don't need an account to see what Writ returns. This call reads a page the same way a signed-in read
does and answers with its main text as Markdown. Any stable id works as `X-Writ-Client-Id`; it counts your free daily credits.

```bash
curl -X POST https://api.usewrit.app/v1/keyless/scrape \
  -H "Content-Type: application/json" \
  -H "X-Writ-Client-Id: 6f1d2c4e-0b7a-4c1e-9f3a-2d5e8b9c0a11" \
  -d '{"url": "https://news.ycombinator.com"}'
```

```python
import requests

res = requests.post(
    "https://api.usewrit.app/v1/keyless/scrape",
    headers={"X-Writ-Client-Id": "6f1d2c4e-0b7a-4c1e-9f3a-2d5e8b9c0a11"},
    json={"url": "https://news.ycombinator.com"},
)
print(res.json()["markdown"][:500])
```

```typescript
const res = await fetch("https://api.usewrit.app/v1/keyless/scrape", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Writ-Client-Id": "6f1d2c4e-0b7a-4c1e-9f3a-2d5e8b9c0a11",
  },
  body: JSON.stringify({ url: "https://news.ycombinator.com" }),
});
console.log((await res.json()).markdown.slice(0, 500));
```

```json
{
  "verb": "scrape",
  "url": "https://news.ycombinator.com",
  "title": "Hacker News",
  "format": "markdown",
  "markdown": "Hacker News\nnew\n|\npast\n…\n5.\nCasio Watches of the 1980s\n(\ncasio.com\n)\n73 points\nby\nkaragenit\n1 hour ago\n|\nhide\n|\n25 comments\n…",
  "counts": { "chars": 4050, "raw_tokens_est": 8660, "clean_tokens_est": 1012 },
  "quota": {
    "tier": "keyless",
    "credits_remaining": 8,
    "credits_per_day": 10,
    "reset_at": "2026-11-01T00:00:00Z"
  }
}
```

> **limit:** Without an account you get 10 free credits a day per device. A page read costs 2, so that is 5 reads a day; credits_remaining in each answer shows what is left until midnight UTC. Building your own API, signing in to sites and calling from your assistant need a free account or Writ Desktop.

A tool that can only open a URL can send the same read as a GET: `https://api.usewrit.app/v1/keyless/scrape?url=https://news.ycombinator.com`

## Build your first API

-

1. **Pick where it runs**

Create a free account at [app.usewrit.app](https://app.usewrit.app/register?lang=en). The Free plan starts with 1,000 credits at signup and adds 500 every month. Signup credits last 90 days. Plain API calls spend free credits right away; cloud browser runs, sign-ins and a few high-risk sites unlock after one check: a Google sign-in, a run on Writ Desktop, a top-up, or a GitHub account older than 90 days. Calls run on Writ’s servers, so they work while your computer is off.

Download [Writ Desktop](https://usewrit.app/docs/desktop) and choose **Continue in local-only mode**, or sign in. Add your own AI key in **Settings → AI Provider** so Scribe can build. Everything runs on your
computer, over your own connection, and costs nothing.

-

2. **Open the Website to API form**

Go to **Create** and pick **Turn a website into an API**, then **Open in Scribe**. Scribe is the assistant inside Writ; this form is its way in.

-

3. **Say what the API should do**

Fill in **Website** and **What the API should do**, in plain words.
For example: *“Top stories from news.ycombinator.com with title, points, comment count and link. Let me ask for how many.”* If the data sits behind a login, pick a persona in **Sign in as**. Then click **Build the API**.

-

4. **Let Scribe build and test it**

Scribe opens a real browser, finds how the site serves the data, and writes one function per
thing you asked for. It runs each function on two inputs before it hands the API over. If it
needs you (a sign-in, a CAPTCHA, a choice) it asks in the panel.

-

5. **Try a function**

Open the new API under **APIs**. On the **Functions** tab, pick a
function and click **Run just this function**. You see the inputs it takes, the
data it returns, and what one call costs.

> **tip:** Check the ready-made APIs first. If someone already built one for the site, installing it takes one click and it has passed live tests.

## Call it from your code

-

6. **Create an API key**

In **Developers → API Keys**, create a key and copy it. It starts with `wt_` and is shown once. Keep it in an environment variable such as `WRIT_API_KEY`.

-

7. **Publish the REST endpoint**

On the API’s **Call** tab, turn on **Publish REST endpoint**. Writ
gives the API a stable URL and shows a ready-to-paste request for each function.

-

8. **Send a request**

The body is the function’s inputs. The call waits for the run and returns the data.

```bash
curl -X POST https://api.usewrit.app/v1/your-org/top-stories \
  -H "Authorization: Bearer $WRIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit": 3}'
```

```python
import os, requests

res = requests.post(
    "https://api.usewrit.app/v1/your-org/top-stories",
    headers={"Authorization": f"Bearer {os.environ['WRIT_API_KEY']}"},
    json={"limit": 3},
    timeout=130,
)
res.raise_for_status()
print(res.json()["data"])
```

```typescript
const res = await fetch("https://api.usewrit.app/v1/your-org/top-stories", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WRIT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ limit: 3 }),
});
const { success, data } = await res.json();
console.log(success, data);
```

```json
{
  "success": true,
  "data": {
    "stories": [
      { "rank": 1, "title": "...", "points": 412, "comments": 96, "url": "https://..." },
      { "rank": 2, "title": "...", "points": 288, "comments": 51, "url": "https://..." },
      { "rank": 3, "title": "...", "points": 175, "comments": 33, "url": "https://..." }
    ]
  }
}
```

Long runs, cached answers and error handling are covered in [Call your API](https://usewrit.app/docs/call).

## Call it from your AI assistant

Add Writ Cloud as an MCP server and your assistant can run your APIs, read pages, and build new
APIs itself. Your client signs you in to Writ the first time; no key to paste.

```bash
claude mcp add --transport http writ-cloud https://api.usewrit.app/mcp
```

~/.cursor/mcp.json

```json
{
  "mcpServers": {
    "writ-cloud": { "url": "https://api.usewrit.app/mcp" }
  }
}
```

```
Settings → Connectors → Add custom connector
URL: https://api.usewrit.app/mcp
Then sign in to Writ when Claude asks.
```

Every client, the Desktop server and the full tool list are on [Connect an AI assistant](https://usewrit.app/docs/mcp).

## What it costs

- A call that needs no browser costs **2 credits**; one that needs a browser costs **20**.
- On Pro and up, and during the 14-day Pro trial, a CAPTCHA that a paid solver passes adds **10 credits**. On other plans the run hands the CAPTCHA to you.
- A call that fails because of the site or Writ costs nothing.
- Everything that runs on Writ Desktop is free.
- Builds by Writ’s AI: each plan includes a number per month (5 on Free); past it a build is a flat credit price, charged in full only when it delivers a working API; a build you stop pays what it used, never more than its price.

Plans, limits and what happens at zero: [Credits and plans](https://usewrit.app/docs/billing-wallet).

## Next

-
- [Choose how to start](https://usewrit.app/docs/choosing-a-method): When to build an API, record a workflow, harvest a site or monitor a page.
-
- [Sign-ins and secrets](https://usewrit.app/docs/personas): Let Writ act as you on sites behind a login.
-
- [Call your API](https://usewrit.app/docs/call): Waiting, async runs, caching, responses and errors.
-
- [Writ Desktop](https://usewrit.app/docs/desktop): Run everything on your own computer, free.
