# auth.md

You are an agent. Since.dev supports **agent sign-up**: register, **show the setup link and code to the person you work for**, they sign in or sign up and approve, you poll for an API key, then call the API.

Since.dev tracks every package, AI model, API and runtime as it changes, finds the exact lines a change breaks in your code and opens the pull request that fixes it. Use it from the dashboard, the HTTP API or your agent's MCP client. Nothing merges or deploys: people review every pull request.

## Service details

- **Service name:** Since.dev
- **HTTP API:** https://api.since.dev
- **MCP server:** https://api.since.dev/mcp (Streamable HTTP)
- **What you get:** a workspace API key, sent as `Authorization: Bearer <key>` on the API and on MCP
- **Contact:** support@since.dev
- **Pricing:** https://since.dev/#pricing. **Terms:** https://since.dev/terms. **Privacy:** https://since.dev/privacy

## Do you need this?

If you are an MCP client that can open a browser sign-in (Claude Code, Cursor, Codex, VS Code and others), you may not: add `https://api.since.dev/mcp` and sign in when your client asks. Use the steps below when you can't open a browser sign-in, or when you need an API key for code, CI or a script.

## Step 1: Register

```http
POST https://api.since.dev/v1/agent/register
Content-Type: application/json

{
  "email": "person@example.com",
  "key_name": "Acme repo checks",
  "client_name": "Claude Code"
}
```

- `email` (required): the email of the person you are setting this up for. If they have an account, they sign in with it; if not, they create one.
- `key_name` (optional, up to 60 characters): the name of the API key that gets created. Use the project or task it is for, so the person can tell it apart on their API keys page. Defaults to `Agent`.
- `client_name` (optional, up to 60 characters): your own name, such as `Claude Code`, `Codex` or `Cursor`. The person sees it when they approve.

The response:

```json
{
  "setup": {
    "verification_uri": "https://app.since.dev/agent",
    "verification_uri_complete": "https://app.since.dev/agent?user_code=ABCD2345",
    "user_code": "ABCD2345",
    "expires_in": 900,
    "interval": 5
  },
  "claim_token": "<keep this in memory only>",
  "key_name": "Acme repo checks"
}
```

Keep `claim_token` in memory. Don't write it to a file or show it to anyone.

Registration errors:

- `400 invalid_input`: fix the request body. The message names the field.
- `429 rate_limit_exceeded`: too many setups for this email or from this network. Stop and tell the person. Do not retry in a loop.

## Step 2: Show the person the link and code (required before polling)

Right after registering, send the person this message with the real values filled in. Show the **full** link and the **full** code, each on its own line so they can copy it. Since.dev never emails the code: if you don't show it, setup can't finish.

---

**Approve Since.dev for me**

1. Open this link:

```
{verification_uri_complete}
```

2. Check that the page shows this code:

```
{user_code}
```

3. Sign in or create an account, pick the workspace, and choose **Approve**.

The code expires in {expires_in / 60} minutes.

---

Don't skip this step, and don't replace the link and code with "check your email" or "approve it in the browser".

## Step 3: Poll for the key

```http
POST https://api.since.dev/v1/agent/token
Content-Type: application/json

{ "claim_token": "<from step 1>" }
```

Poll every `interval` seconds (5) until you get the key:

- `400 authorization_pending`: the person hasn't approved yet. Keep polling.
- `400 slow_down`: you polled too soon. Wait longer between polls.
- `400 expired_token`: the code expired. Start again from step 1 and show the person the new link and code.
- `400 access_denied`: the person declined. Stop, and don't retry unless they ask.
- `400 invalid_grant`: the claim token is unknown or was already used. Start again from step 1.
- `200`: the key, shown once:

```json
{
  "api_key": "sc_live_...",
  "key_name": "Acme repo checks",
  "key_prefix": "sc_live_1a2b3c4d5e6f"
}
```

## Step 4: Keep the key and use it

Save the key where the person keeps secrets: an environment variable such as `SINCE_DEV_KEY`, or your client's secret settings. Never commit it to a repository. Then call the API:

```http
GET https://api.since.dev/v1/changes?provider=openai&within=90d
Authorization: Bearer <api_key>
```

Or send it to the MCP server as `Authorization: Bearer <api_key>`. The key reaches only the workspace the person approved, and they can revoke it any time on their API keys page.

## Rules

- A person always approves. Never try to approve for them, and never ask for their password.
- Register once per setup. If something fails, tell the person what happened instead of looping.
- Each call costs credits from the workspace's monthly allowance. Prices: https://since.dev/#pricing.

Full reference: https://since.dev/docs
