# Quickstart: Sypnia Cloud

> Sign in, give a task its route, try it, and call it from your server under a use case.

Applies to: Sypnia Cloud (paid service).  
Source: https://ai.docs.sypnia.com/start/quickstart-cloud/

For agents: AI Cloud quickstart: npx @sypnia/app login (shared Sypnia login, device flow); npx @sypnia/ai link --project la-espiga; write [ai.tasks.write] in sypnia.toml (model default, instructions, params) and npx @sypnia/ai routes apply; npx @sypnia/ai try write "…" --case publish-bread-of-the-day; npx @sypnia/ai keys create la-espiga-server --scope call → SYPNIA_SECRET_KEY on the server; createAI({apiKey}).chat({task, case, messages}); npx @sypnia/ai usage --by case. Same in App: project → AI.

At the end you will have a task, `write`, that La Espiga's server uses every morning to write the bread of the day, with its usage shown under the use case.

### 1. Sign in and link your project

```bash
npx @sypnia/app login
npx @sypnia/ai link --project la-espiga
```

The first command is the one sign-in every Sypnia command line shares: it opens your browser to approve a code. The second writes `project = "la-espiga"` to `sypnia.toml`, the project's one configuration file, at the root of your repository.

**You should see:**`Linked to la-espiga (organization: La Espiga).`

### 2. Give the task a route

Add the task to `sypnia.toml`:

`sypnia.toml`

```toml
[ai.tasks.write]
model = "default"        # the model Sypnia AI picks for writing
instructions = """
You write for La Espiga, a neighbourhood bakery. Warm, short, in Spanish.
Never invent prices or ingredients.
"""
params = { max_output_tokens = 300 }
```

```bash
npx @sypnia/ai routes apply
```

**You should see:**A diff of the project's routes, a confirmation, then `1 route applied (write).`

### 3. Try it

```bash
npx @sypnia/ai try write "Today: rye loaf and almond croissants." --case publish-bread-of-the-day
```

**You should see:**The message, then a line like `model: … · 182 tokens in · 64 out · 0.4 s · charged to publish-bread-of-the-day`.

### 4. Call it from your server

```bash
npx @sypnia/ai keys create la-espiga-server --scope call
```

Put the key it prints in your server's environment as `SYPNIA_SECRET_KEY`; it is shown once. Then:

`bread-of-the-day.ts`

```ts
import { createAI } from '@sypnia/ai/server';

const ai = createAI({ apiKey: process.env.SYPNIA_SECRET_KEY! });

const { text } = await ai.chat({
  task: 'write',
  case: 'publish-bread-of-the-day',
  messages: [{ role: 'user', content: 'Today: rye loaf and almond croissants.' }],
});
```

### 5. See what it spent

```bash
npx @sypnia/ai usage --by case --since 7d
```

**You should see:**A table with `publish-bread-of-the-day`, its calls, tokens and credits.

> **In plain words**
>
> You can do all of this from the chat in [App](https://app.docs.sypnia.com/): say «write the bread of the day every morning» and the agent proposes the use case, the route and the key, and shows you a test message before anything is applied.
