# auth.md: try Vibber as an AI assistant, then help the person sign up

You are an AI assistant. Vibber lets you register without an account, get a trial that lasts three hours, and answer the person's question from Norwegian open data through Vibber's tools. If it helps them, you then help them create a free Vibber account. This file gives every request to send, as curl.

## Which path is yours

Check one thing first: can you send an HTTP POST with a JSON body and an `Authorization` header from where you run, to `https://gateway.vibber.ai`?

- **Yes.** Claude with code execution, Claude Code, Codex, Cursor and ChatGPT in Work mode can, if their network reaches `gateway.vibber.ai`. Follow this file from Step 1.
- **No.** Do not pretend to call Vibber or invent an answer. Tell the person, in their language: "I can't fetch data from Vibber in this chat. Open https://vibber.ai/free-manual to add Vibber to your assistant for free, then ask me again."

## What a trial is

- It lasts **three hours** from registration. Then it stops answering, and Vibber deletes the trial's workspace in the background. Claiming the trial (Step 6) does not make it longer.
- It has the Free plan's open-data connectors that need no sign-in: Brønnøysundregistrene (companies, roles, annual accounts), Norwegian laws (laws and central regulations), State budget (since 2014) and SSB (statistics), as the Free plan grants them. Take every tool name from the `tools/list` answer (Step 4b), never from this file.
- It has the Free plan's limits, by default 3,000 tool calls a day and up to 120 requests a minute, tool calls, listings and `initialize` together.
- It reaches nothing else: no person's workspace, no company's private data, no connector that needs a sign-in.

| What                                        | Address                                                                    |
| ------------------------------------------- | -------------------------------------------------------------------------- |
| Trial MCP entrance (the protected resource) | `https://gateway.vibber.ai/agent/mcp`                                      |
| Its protected-resource metadata             | `https://gateway.vibber.ai/.well-known/oauth-protected-resource/agent/mcp` |
| Issuer metadata                             | `https://gateway.vibber.ai/agent/.well-known/oauth-authorization-server`   |
| Register                                    | `POST https://gateway.vibber.ai/agent/identity`                            |
| Token                                       | `POST https://gateway.vibber.ai/agent/oauth2/token`                        |
| Start a claim                               | `POST https://gateway.vibber.ai/agent/identity/claim`                      |
| Revoke (ends the trial)                     | `POST https://gateway.vibber.ai/agent/oauth2/revoke`                       |

## How to behave

- Tell the person you are using Vibber to look the data up, and that it is a trial without an account.
- Say where the data comes from. Brønnøysundregistrene's data is open under the Norwegian licence for open government data (NLOD): "Contains data under the Norwegian licence for Open Government data (NLOD) made available by Brønnøysundregistrene." Answers from Norwegian laws, State budget and SSB carry their own attribution; pass it on.
- Register once per conversation. Keep the `identity_assertion`, the `claim_token` and the access token in memory for this conversation only, and never show them to the person.
- After a 429 or 503, do not send the request again before its `Retry-After` has passed. The limits are Vibber's defaults and can change: go by each answer's `Retry-After`.
- Never ask the person for a password, a sign-in code or any other secret. The only code you show them is the six-digit claim code (Step 6), and it goes into the Vibber page, not back to you.
- Every tool call in a trial must include `intent` in its `arguments`: the person's goal in one sentence, in plain language, with no personal data, passwords or other secrets. Send it on every call, not only the first. A call without it does not run: its answer is `result.isError: true` with a text that starts `INTENT_REQUIRED`, and you send the same call again with `intent`. A tool whose own arguments already include `intent` takes the goal as `call_intent` instead; each tool's `inputSchema` lists the one it takes under `required`.
- If a tool answer says `isError: true`, or an answer is not what you expected, say so. Do not fill the gap with a guess.

## Step 1: Discover (optional)

The addresses above are all you need. Asked without a token, the trial entrance answers 401 with `www-authenticate: Bearer resource_metadata="https://gateway.vibber.ai/.well-known/oauth-protected-resource/agent/mcp"`. If you get that 401, you can send the requests.

```sh
curl -si -X POST https://gateway.vibber.ai/agent/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"ping"}'
```

## Step 2: Register

Register as `anonymous`. This creates the trial. Do it once per conversation.

<!-- example: register -->

```sh
curl -s -X POST https://gateway.vibber.ai/agent/identity \
  -H 'Content-Type: application/json' \
  -d '{"type":"anonymous"}'
```

If the page or the prompt that sent you here named a `ref` (for example `ref=selskap`), add it to the body: `{"type":"anonymous","ref":"selskap"}`. It only tells Vibber which page you came from. Leave it out otherwise.

The answer (200), shortened. Setting up the trial takes a few seconds.

```json
{
  "identity_assertion": "eyJ0eXAiOiJvYXV0aC1pZC1qYWcrand0Ii...",
  "assertion_expires": "2026-11-21T14:03:27.481920Z",
  "claim_url": "https://gateway.vibber.ai/agent/identity/claim",
  "claim_token": "clm_q3Vt8kQ2xY0bN1rJ5mW7pZcA9eF4hL6sD2gK8uT0vXo"
}
```

- `identity_assertion` is your credential for this trial, until `assertion_expires`. You exchange it for access tokens in Step 3, as often as you need.
- `claim_token` starts the claim in Step 6. It is given only in this answer.

A refused registration answers 429 `rate_limited` with `Retry-After`, and its `error_description` says Vibber is experiencing high demand and when to try again. `Retry-After` and the sentence give the same wait, for example `Retry-After: 2520` and `"Vibber cannot register more agents from this address right now: we are experiencing high demand. Try again in 42 minutes."` With `Retry-After` up to 60, wait that long and send it once more. With a longer one, do not wait: tell the person when they can try again and give them the `/free-manual` link from "Which path is yours".

## Step 3: Get an access token

Exchange the `identity_assertion` with the JWT-bearer grant. The body is a form, not JSON.

<!-- example: exchange -->

```sh
curl -s -X POST https://gateway.vibber.ai/agent/oauth2/token \
  --data-urlencode 'grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer' \
  --data-urlencode "assertion=$IDENTITY_ASSERTION" \
  --data-urlencode 'resource=https://gateway.vibber.ai/agent/mcp'
```

The answer (200):

```json
{
  "access_token": "eyJ0eXAiOiJhdCtqd3QiLCJhbGciOiJFZERTQSJ9...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "agent-trial"
}
```

The access token lasts an hour, or until the trial ends if that is sooner. There is no refresh token: when it runs out, or the trial entrance answers 401, exchange the same `identity_assertion` again.

## Step 4: Call MCP by hand

The trial entrance speaks MCP over HTTP: one JSON-RPC message per POST, answered with one JSON body. Every request carries:

```http
POST /agent/mcp
Host: gateway.vibber.ai
Authorization: Bearer <access_token>
Content-Type: application/json
Accept: application/json, text/event-stream
```

After `initialize`, also send `Mcp-Session-Id` (a header of the `initialize` answer) and `MCP-Protocol-Version` (`result.protocolVersion` in its body, such as `2025-06-18`). Send the whole body at once: a body that has not arrived within 10 seconds is refused with 408.

### 4a. initialize

<!-- example: initialize -->

```sh
curl -si -X POST https://gateway.vibber.ai/agent/mcp \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"my-assistant","version":"1.0"}}}'
```

The answer (200) carries the header `mcp-session-id`. Read `result.instructions`: it says how the tools are named and used. Then send the notification `{"jsonrpc":"2.0","method":"notifications/initialized"}` with the headers of 4b, `Mcp-Session-Id` and `MCP-Protocol-Version` included; it answers 202 with no body.

### 4b. tools/list

<!-- example: tools-list -->

```sh
curl -s -X POST https://gateway.vibber.ai/agent/mcp \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Mcp-Session-Id: $MCP_SESSION_ID" \
  -H 'MCP-Protocol-Version: 2025-06-18' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
```

Tool names are `<connector>__<tool>`, and each tool's `inputSchema` gives its arguments. Take the tool names from this answer, not from this file. The company search is the tool whose name ends with `__search_companies`, and the company profile the one whose name ends with `__company_profile`, such as `br-nn-ysundregistrene__company_profile`.

If no tool name ends with `__search_companies` or `__company_profile`, the trial has no Brønnøysundregistrene tools right now. Do not send a name from this file. Use whichever listed tool fits the person's question; if none fits, tell the person: "Vibber's trial does not include company data right now." Then offer the free account (Step 5).

### 4c. tools/call

Before any other tool, call `company__get_context` once, with `intent` set to the person's goal in one sentence. Its answer says which connector covers what. <!-- example: context -->

```sh
curl -s -X POST https://gateway.vibber.ai/agent/mcp \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Mcp-Session-Id: $MCP_SESSION_ID" \
  -H 'MCP-Protocol-Version: 2025-06-18' \
  -d '{"jsonrpc":"2.0","id":"context","method":"tools/call","params":{"name":"company__get_context","arguments":{"intent":"<what the person wants, in one sentence>"}}}'
```

Its answer is text inside `result.content[0].text`, not JSON. In the curl command, write the sentence without `'` or `"`.

Then the tool that answers the question, with `intent` again, as on every call. With a company name, search first. With a 9-digit organisation number, go straight to the company profile tool.

<!-- example: tools-call -->

```sh
curl -s -X POST https://gateway.vibber.ai/agent/mcp \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Mcp-Session-Id: $MCP_SESSION_ID" \
  -H 'MCP-Protocol-Version: 2025-06-18' \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"br-nn-ysundregistrene__search_companies","arguments":{"name":"Equinor","limit":3,"intent":"<what the person wants, in one sentence>"}}}'
```

The tool's result is JSON inside `result.content[0].text`; parse it. Give the person the answer in plain words, with the source line. Amounts are in the currency the accounts give (`currency`), not always NOK.

### 4d. Laws, statistics and the state budget

The request is the one in 4c with other `params`. A trial answered each of these:

```text
{"name": "lovdata__read_section", "arguments": {"law": "arbeidsmiljøloven", "section": "15-3", "intent": "<the person's goal>"}}
{"name": "ssb__get_data", "arguments": {"table_id": "01222", "selection": {"Region": "0", "ContentsCode": "Folketallet11", "Tid": "top(1)"}, "intent": "<the person's goal>"}}
{"name": "statsbudsjett__aggregate", "arguments": {"table": "appropriations", "years": {"from": 2026, "to": 2026}, "filters": [{"column": "chapter", "op": "eq", "value": 285}], "group_by": ["chapter_name"], "measures": [{"fn": "sum", "column": "appropriated"}], "intent": "<the person's goal>"}}
```

- Laws: `lovdata__search_law` finds the section when you do not know its number.
- Statistics: `ssb__find_tables` finds the table and `ssb__describe_table` lists its dimensions and their values. When a table has several measures, `ssb__get_data` needs one chosen in `ContentsCode`.
- State budget: `statsbudsjett__find_posts` finds the chapter and the post. In `statsbudsjett__aggregate` every measure needs `fn`, a filter's `op` is `eq` or `in` (text and numbers), `between` (numbers) or `prefix` or `contains` (text), and `years` is an object. One recipient can have posts under several ministries, so say which chapter your figure covers.

Send one tool call at a time. Calls sent at the same moment can be answered "Too many dataset queries at once; try again in a moment."; wait a moment and send that call again.

## Step 5: Offer the person a free account

When the trial has answered the person's question, or they ask how to keep using Vibber, offer once: "I can set you up with a free Vibber account so you can keep using this from your own assistant. Shall I?" Do not start the claim without a yes.

What to tell them: they sign up, or sign in, at a Vibber page with the email address they give you, and type the six-digit code you show them. Signing up creates their free account on the Free plan; if the Free plan has no room at that moment, the account waits for room and the claim still completes. It gives you no access to their account. Vibber sends no email: the person learns the code from you.

## Step 6: The claim

### 6a. Start it with the person's email

<!-- example: claim-start -->

```sh
curl -s -X POST https://gateway.vibber.ai/agent/identity/claim \
  -H 'Content-Type: application/json' \
  -d "{\"claim_token\":\"$CLAIM_TOKEN\",\"email\":\"kari@example.no\"}"
```

The answer (200), shortened:

```json
{
  "claim_attempt": {
    "user_code": "482913",
    "expires_in": 600,
    "verification_uri": "https://app.vibber.ai/claim?attempt=cla_8e2b7c1d4f6a49b0a3c5e7f9d1b2a4c6#email=kari%40example.no",
    "interval": 5
  }
}
```

### 6b. Show the person the link and the code

> Open this link and sign up (or sign in) with kari@example.no. On the page, enter this code: **482913**
> https://app.vibber.ai/claim?attempt=cla_8e2b7c1d4f6a49b0a3c5e7f9d1b2a4c6#email=kari%40example.no
>
> The code works for 10 minutes. Type it into that page, not here. Confirming gives me no access to your account.

### 6c. Poll until it completes

Poll no faster than every `interval` seconds (5). The body is a form.

<!-- example: claim-poll -->

```sh
curl -s -X POST https://gateway.vibber.ai/agent/oauth2/token \
  --data-urlencode 'grant_type=urn:workos:agent-auth:grant-type:claim' \
  --data-urlencode "claim_token=$CLAIM_TOKEN"
```

While the person has not entered the code, the answer is 400 `authorization_pending`. The 200 answer carries a new `access_token` and `identity_assertion`: use them from now on, because the ones from before the claim stop working. They are for the same trial, with the same end. If your environment limits how long a command may run, poll in rounds of about a minute.

Then tell the person: to keep using Vibber after this trial, add `https://gateway.vibber.ai/mcp` as a connector in their assistant's settings and sign in with the address they gave. Give the trial's end time in their time zone; `assertion_expires` is in UTC. If you do not know their time zone, say how long is left.

## Errors

| Where          | Answer                                    | What to do                                                                                                                                                                                      |
| -------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Any request    | 429 with `Retry-After`                    | Wait `Retry-After` seconds before you send that request again. At the day's 3,000 tool calls, stop and tell the person.                                                                         |
| Register       | 429 `rate_limited`, a long `Retry-After`  | The address's hour or the day's total. Tell the person when they can try again (the `error_description` says it) and give them the `/free-manual` link.                                         |
| Register       | 503 `temporarily_unavailable`             | A trial cannot be set up now. It is not final: wait a minute and send it once more.                                                                                                             |
| Register       | 400 `invalid_request`                     | The body was not `{"type":"anonymous"}`. Fix it.                                                                                                                                                |
| Token          | 400 `invalid_grant`                       | The trial has ended, or a claim replaced the assertion (`error_description` says so; use the one the claim gave you).                                                                           |
| Trial entrance | 401                                       | The access token has run out, or a claim replaced it. Exchange the assertion again (Step 3) and send the request once more.                                                                     |
| Trial entrance | 403, "This trial has ended."              | Tell the person. A trial that has ended cannot be claimed; offer the connector or signing up at https://app.vibber.ai.                                                                          |
| Trial entrance | 200 with a JSON-RPC `error`               | If it says the tool was not found, send `tools/list` again and use a name from its answer. Otherwise read `error.message` and fix the request.                                                  |
| Trial entrance | `result.isError: true`, `INTENT_REQUIRED` | The call carried no `intent` and did not run. Send the same call again with `intent` set to the person's goal in one sentence (`call_intent` where the tool's `inputSchema` requires that one). |
| Trial entrance | `result.isError: true`                    | The data source refused or failed. Tell the person what the text says.                                                                                                                          |
| Claim start    | 400 `invalid_request`                     | The email is not an email address. Ask the person again.                                                                                                                                        |
| Claim start    | 409 `claimed_or_in_flight`                | This trial has been claimed already. Nothing more to do.                                                                                                                                        |
| Claim start    | 410 `claim_expired`                       | The trial has ended. Suggest signing up at https://app.vibber.ai.                                                                                                                               |
| Claim start    | 429 `rate_limited`                        | With `Retry-After: 3600`: five claims were started for this trial already; suggest signing up at https://app.vibber.ai. With a shorter one: wait that long and send it once more.               |
| Claim start    | 503 `temporarily_unavailable`             | "A claim cannot be started right now." Not final, no `Retry-After`: wait a minute and send it once more.                                                                                        |
| Claim poll     | 400 `slow_down`                           | Wait 5 seconds longer between polls.                                                                                                                                                            |
| Claim poll     | 400 `expired_token`                       | The 10 minutes ran out, the trial ended, or the address cannot sign up. Offer to start again (6a gives a new code) or suggest signing up at https://app.vibber.ai.                              |
| Claim poll     | 400 `access_denied`                       | The code was typed wrong too many times. Offer to start again.                                                                                                                                  |
| Claim poll     | 429 with `Retry-After`                    | Not final while the code lasts. If `Retry-After` ends before the code's 10 minutes run out, wait and poll again. If it ends later, tell the person the account could not be finished now.       |
| Claim poll     | 503 `temporarily_unavailable`             | "A trial workspace cannot be set up right now." Not final: wait `interval` seconds and poll again.                                                                                              |

## After the trial

To keep using Vibber, the person adds `https://gateway.vibber.ai/mcp` as a connector in their assistant's settings and signs in with their Vibber account. In Claude Code that is:

```sh
claude mcp add --transport http vibber https://gateway.vibber.ai/mcp
```

## Ending a trial early

If the person asks you to end the trial, revoke your current access token. The answer is 200 with no body.

```sh
curl -s -X POST https://gateway.vibber.ai/agent/oauth2/revoke \
  --data-urlencode "token=$ACCESS_TOKEN" \
  --data-urlencode 'token_type_hint=access_token'
```

The full reference, with every answer and limit: https://vibber.ai/auth-reference.md

## Pricing

The Free plan costs nothing and is for one person. Its sign-up page is https://vibber.ai/free-manual.
