# Quickstart

Ylalo is a **trading API for AI agents**. **www.ylalo.com is MAINNET (real funds)**. Demo sandbox is https://sandbox.ylalo.com (play money). Agents can trade; agents cannot withdraw.

## Copy-paste prompt for your agent

```
Set me up to trade on Ylalo.
1. Read https://www.ylalo.com/llms.txt and GET /v1/start. Note environment (mainnet vs sandbox) and X-Ylalo-Environment — www is MAINNET real funds.
2. Connect MCP at https://www.ylalo.com/mcp (or REST /v1, OpenAPI /v1/openapi.json).
3. Auth on www/mainnet: phone OTP then POST /v1/keys. Store as YLALO_API_KEY, never in chat. For phone-free play money use the demo host https://sandbox.ylalo.com → POST /v1/sandbox/accounts (never call sandbox on www).
4. Show balance and limits (GET /v1/account). Attach a dead-man or stop guardian if you may sleep. Tell me plainly: leveraged products, environment, liquidation risk.
5. Propose ONE small trade with a stop-loss and take-profit; only place it after I say yes.
6. Prefer ylalo_suggest_order / POST /v1/orders/suggest, then place with POST /v1/orders or ylalo_place_order (brackets/guardians when possible). Do not use /v1/perps/*.
7. Use stocks/bonds/portfolio/NAV language with users. Prefer clear risk language; you may name the execution venue when helpful.
```

## curl (mainnet / www — OTP + key)

```bash
curl -s -X POST https://www.ylalo.com/v1/keys -H "authorization: Bearer $YLALO_SESSION" \
  -H 'content-type: application/json' -d '{"name":"my-bot"}' | tee ylalo.json
export YLALO_API_KEY=$(jq -r .apiKey ylalo.json)

curl -s https://www.ylalo.com/v1/account -H "authorization: Bearer $YLALO_API_KEY"

curl -s -X POST https://www.ylalo.com/v1/orders/suggest -H "authorization: Bearer $YLALO_API_KEY" \
  -H 'content-type: application/json' \
  -d '{"market":"BTC","side":"long","usdAmount":25,"leverage":5}'
```

Confirm the suggest plan with the user, then `POST /v1/orders` (or dryRun → confirm) with brackets/guardians and an `Idempotency-Key` header.

## Sandbox (https://sandbox.ylalo.com only)

`POST https://sandbox.ylalo.com/v1/sandbox/accounts` — phone-free play money. Not available on www.

## MCP

- Endpoint: `https://www.ylalo.com/mcp`
- Install: [MCP install guide](./mcp.md)
- Bootstrap: `GET /v1/start` or tool `ylalo_start`

## Next

- [Auth](./auth.md) · [Orders](./orders.md) · [Errors](./errors.md) · [llms.txt](/llms.txt)
