---
title: "Your first paid job"
url: https://services.dev/docs
---
# Your first paid job

URL: https://services.dev/docs

> One command writes a Service, serves it on every surface, and has an agent buy a job that AI delivers. No account, key or card.

You need Node 22.18 or later.

## Run it

```txt
$ mkdir lingua && cd lingua
$ npx services.dev
  wrote   package.json · services/translation.ts · services/translation.md · AGENTS.md
lingua · AI delivers every job.
  site    http://localhost:8787/translation
  api     POST http://localhost:8787/jobs {"service":"translation"}
  key     sk_test_7Hq2 · a call with no key uses it, on localhost only
  mcp     http://localhost:8787/mcp · stdio: npx services.dev mcp
  cli     npx services.dev translation k=v …
  sdk     connect({ origin: 'http://localhost:8787' }).translation.order(input)
  docs    http://localhost:8787/llms.txt
  buyers  http://localhost:8787/portal
  you     http://localhost:8787/console
  AI and money are simulated until you wire them. $0.42 a call is an example.

an agent ordered Translation at $49
job_7Hq2 · delivered · document.fr-CA.pdf · $49.00 charged
  record  draft · ai | review · ai · pass
  ledger  +$49.00 · AI $0.84 · you $48.16
  next    npx services.dev accept job_7Hq2
```

Nobody touched it. An agent ordered a job, AI translated the document, a second AI pass attacked the draft, and the job was charged on delivery. The folder's name, lingua, is the brand on every surface.

Leave it running. It reloads each Service you save.

## Read the Service

This is `services/translation.ts`:

```ts
import { Service } from 'services.dev'

export default Service({
  name: 'Translation',
  input: { document: 'file', to: 'language: a BCP 47 tag, such as fr-CA' },
  output: { document: 'file' },
  price: 49,
})
```

What comes in, what goes out, and the price. With no `deliver`, AI does the work, briefed by `services/translation.md`. With no `human`, AI delivers every job alone.

## Buy one yourself

In a second terminal, order a job the way your buyers and their agents will. Pick a surface; every call answers the same on all four.

**CLI**

```txt
$ npx services.dev translation document=https://example.com/lease.pdf to=fr-CA --max 49 --key lease
job_7Hq3 · working · $49.00 held
job_7Hq3 · delivered · lease.fr-CA.pdf · $49.00 charged
  record  draft · ai | review · ai · pass
  ledger  +$49.00 · AI $0.84 · you $48.16
  next    npx services.dev accept job_7Hq3
```

**API**

```txt
$ curl -X POST http://localhost:8787/jobs -H 'content-type: application/json' -d '{"service":"translation","document":{"url":"https://example.com/lease.pdf","name":"lease.pdf"},"to":"fr-CA","max_usd":49,"key":"lease"}'
← 202 · job_7Hq3 · working · $49.00 held
  next    get_job {"id":"job_7Hq3"}
```

**MCP**

```txt
→ tools/call order_translation {"document":{"url":"https://example.com/lease.pdf","name":"lease.pdf"},"to":"fr-CA","max_usd":49,"key":"lease"}
← job_7Hq3 · working · $49.00 held
  next    get_job {"id":"job_7Hq3"}
```

**SDK**

```txt
await lingua.translation.order({"document":{"url":"https://example.com/lease.pdf","name":"lease.pdf"},"to":"fr-CA","max_usd":49,"key":"lease"})
← job_7Hq3 · working · $49.00 held
  next    get_job {"id":"job_7Hq3"}
```

`max_usd` is the most you'll pay; leave it out and the answer is an offer with the price and the exact call to send. The same `key` returns the same job, so a retry never buys twice.

Wait for it:

**CLI**

```txt
$ npx services.dev jobs wait job_7Hq3
job_7Hq3 · delivered · lease.fr-CA.pdf · $49.00 charged
  record  draft · ai | review · ai · pass
  ledger  +$49.00 · AI $0.84 · you $48.16
  next    npx services.dev accept job_7Hq3
```

**API**

```txt
$ curl http://localhost:8787/jobs/job_7Hq3?wait=50
← 200 · job_7Hq3 · delivered · lease.fr-CA.pdf · $49.00 charged
  next    accept_job {"id":"job_7Hq3"}
```

**MCP**

```txt
→ resources/read job://job_7Hq3?wait=50
← job_7Hq3 · delivered · lease.fr-CA.pdf · $49.00 charged
  next    accept_job {"id":"job_7Hq3"}
```

**SDK**

```txt
await lingua.jobs.wait("job_7Hq3")
← job_7Hq3 · delivered · lease.fr-CA.pdf · $49.00 charged
  next    accept_job {"id":"job_7Hq3"}
```

Accept it:

**CLI**

```txt
$ npx services.dev jobs accept job_7Hq3
job_7Hq3 · accepted · lease.fr-CA.pdf · $49.00 final
```

**API**

```txt
$ curl -X POST http://localhost:8787/jobs/job_7Hq3/accept -H 'content-type: application/json' -d '{}'
← 200 · job_7Hq3 · accepted · lease.fr-CA.pdf · $49.00 final
```

**MCP**

```txt
→ tools/call accept_job {"id":"job_7Hq3"}
← job_7Hq3 · accepted · lease.fr-CA.pdf · $49.00 final
```

**SDK**

```txt
await lingua.jobs.accept("job_7Hq3")
← job_7Hq3 · accepted · lease.fr-CA.pdf · $49.00 final
```

A buyer who wants changes sends the job back with a note instead, and the AI redoes it.

## Check it

```txt
$ npx services.dev check
services/translation.ts · 4 lines · $49 per job, within 48 hours, charged on delivery.
  who     AI delivers every job.
  steps   draft · ai → review · ai · adversarial
  agent   order_translation · 24 of 30 words · bought job_7Hq2 · $49.00 · no person
  ledger  +$49.00 · AI $0.84 (example) · you $48.16
  margin  at least $39.20 a job (80%) · a job that stops costs you at most $9.80
  apps    customer portal · owner console

mcp     13 buyer tools · 4,486 of 8,000 tokens · 9 more with ?toolset=sandbox
✓ ready to sell · 1 Service · AI delivers it alone · it keeps at least 80% of every job
```

`check` reads the whole business back: who does the work, what each job earns, and the apps it serves. It exits 1 when something needs fixing, and says what to do.

## Break it

Run `npm install` once, then delete the `price` line. Your editor refuses the Service, because how it earns is never optional:

```txt
  ✗ Property 'price' is missing.
```

## Change the price

Put it back as `price: 59` and save. The first terminal reprices, and every surface sells at it. Set it back to 49 before you go on.

```txt
reloaded services/translation.ts · $59 per job, within 48 hours, charged on delivery.

$ npx services.dev translation document=lease.pdf to=fr-CA
OFFER · $59 per job, within 48 hours, charged on delivery.
  next    npx services.dev translation document=lease.pdf to=fr-CA --max 59
```

## What localhost simulates

| | On localhost |
|---|---|
| Real | the Service, its API, CLI, MCP server, SDK, site, docs and apps, `check`, and what TypeScript says |
| Your code | a `deliver` function or URL, so your own model can do the work |
| Simulated | the `'ai'` step, at $0.42 a call (an example), and money, recorded but never moved, until you wire them |

## What are you building?

You wrote four lines, and an agent bought a job AI delivered. The same file grows into the business you know: AI alone like lingua, legal effect like api.lawyer, years like apis.tax, or paid on the close like api.forsale.

**[The whole system](https://services.dev/docs/start/system.md)**: the objects your file creates, and how it earns. Or [choose your shape](https://services.dev/docs/start/shapes.md).

---

- Next: [The whole system](https://services.dev/docs/start/system.md)
