> This page is for Docs.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For task-scoped instructions for coding agents working in a Fern project, run `fern instructions` (or `npx fern-api@latest instructions` if the Fern CLI isn't installed or doesn't recognize `instructions`), or see https://buildwithfern.com/learn/home/fern-instructions.md.

# Try Fern as a guest

> Publish a docs site or generate an SDK from an OpenAPI spec with no Fern account using a temporary guest session, then claim the work into your organization.

The Fern CLI can publish docs and generate SDKs without a Fern account. Add `--guest` to `fern generate` and the CLI starts a temporary guest session with its own guest organization. Docs publish to a temporary site, and SDKs download to your project. To keep the work, claim the session into an organization before it expires.

Guest mode is built for coding agents. The agent runs the CLI and stops at the claim link, and you claim the docs site or SDK in the browser.

## Use a coding agent

Give Claude Code, Cursor, Codex, Devin, or a similar agent your OpenAPI spec and ask for a docs site or an SDK. For best results, first install the [Fern agent skills](/learn/docs/ai-features/agent-skills) with `npx skills add fern-api/skills --all`.

#### Create a docs site from an OpenAPI spec

I have this OpenAPI spec `./openapi.yml` and I need to create a docs website for this spec using Fern. Can you do this for me?

#### Generate an SDK from an OpenAPI spec

I have this OpenAPI spec `./openapi.yml` and I need to generate an SDK for this using Fern. Can you do this for me?

The agent creates a `fern` folder, runs `fern check`, then runs `fern generate --docs --guest` or `fern generate --guest`. It reports the temporary site URL or the SDK's output path and build link, plus the claim link and the session's expiry. To claim the work, continue from [Claim the work](#claim-the-work).

## Try it in your browser

To try guest mode without installing anything, use the card below. Drop your own OpenAPI spec or add the Plant Store sample API, then publish a docs site, generate a TypeScript SDK, or both. Each build runs on Fern's servers, shows the build log while it runs, and ends with a claim link. To keep what you build, continue from [Claim the work](#claim-the-work).

The web version of this page has an interactive card here that publishes a docs site and generates a TypeScript SDK from an uploaded OpenAPI spec or the Plant Store sample API. To do the same from a terminal, follow the steps in the next section.

## Run it yourself

#### Create a Fern project

Install the CLI and create a `fern` folder. For docs, follow the [Docs quickstart](/learn/docs/getting-started/quickstart). For SDKs, follow the [SDKs quickstart](/learn/sdks/overview/quickstart). The `organization` in `fern.config.json` only names the project at this point.

#### Publish or generate as a guest

#### Docs

```bash
fern generate --docs --guest
```

The CLI publishes the site to a `https://temp-<id>.docs.buildwithfern.com` URL, ignoring the `organization` in `fern.config.json` and the `instances` URL in `docs.yml`. A banner on the site says it's unclaimed and when it expires.

The CLI also uploads your `fern` folder with the site, so connecting a GitHub repository after you claim the site commits the folder to that repository. Add `--no-source` to publish without it.

#### SDKs

```bash
fern generate --guest
```

The CLI writes each SDK to its output path. Guests can only download SDKs: a target that publishes to GitHub or a package registry fails the run. Add `--preview` to write every target to `fern/.preview/<generator>/`, or set the target's output to local files. Generated code keeps the names from the `organization` in `fern.config.json`.

The output includes a build link to a public build page, where you can download the SDK for 7 days. Rerunning with the same inputs returns the finished build without spending usage.

The first `--guest` run prints the session ID, the guest organization, the expiry time, and the claim link:

```txt
Started guest session gs_7416b9841b13 as organization guest-6dd35d51ee9e (expires 11/14/2026, 12:23:08 AM).
Claim it to keep this work: https://dashboard.buildwithfern.com/claim/gs_7416b9841b13?from=sdk#...
```

Treat the claim link like a password. The part after `#` is a secret, and anyone with the link can claim the session.

#### Claim the work

Open the claim link and sign in to the Fern Dashboard. Under **Organization**, select **New** and enter an organization ID, or select **Existing** and choose an organization you administer. Then enter the docs URL (`<slug>.docs.buildwithfern.com`) or a name for the SDK that's unique in the organization, and select the claim button, for example **Create `<organization>` and claim** for a new organization.

#### Docs

![Keep your docs site page with Organization, Organization ID and Docs URL fields](/learn/_fern-files/_img/232a0999600a50b5b38c6aeac309d0015e0527956c26ec15004a313ee2e68d08.webp)

#### SDKs

![Keep your SDKs page with Organization, Organization ID and SDK name fields](/learn/_fern-files/_img/8ce035dbe70e61e8a50e8c0ea839efc79c0855a751562541b54ee59868ac23b8.webp)

To claim from the terminal instead, sign in and run [`fern claim`](/learn/cli-api-reference/cli-reference/general-commands#fern-claim) in the same repository:

```bash
fern login
fern claim
```

By default, `fern claim` turns the guest organization into your own. Pass `--org <organization>` to move the work into an existing organization you administer. Either way, claiming requires a signed-in user, so an agent can't do it for you.

Like the claim link, `fern claim` moves the docs site and SDK builds into the organization and removes the temporary-site banner and guest expiry. To choose names as you would on the claim page, pass `--docs-url <slug>` for the site's `<slug>.docs.buildwithfern.com` address, or `--sdk-name <name>` for the SDK:

```bash
fern claim --org <organization> --docs-url <slug>
```

After the claim, the CLI points `fern.config.json` at the organization. When `docs.yml` has a single instance, it also sets that instance's URL to the claimed site, so the next `fern generate --docs` updates it. Then it removes the guest session. Later runs use `fern login` or `FERN_TOKEN` without `--guest`.

If moving the site or SDK fails, for example because the docs URL is taken, the claim still stands and the guest session is kept. Run `fern claim` again, with a different name if needed, to retry the move.

#### Connect GitHub

#### Docs

The site appears in your organization's docs list as **Publishing**, then **Live**, at `<slug>.docs.buildwithfern.com`. The old `temp-<id>` URL redirects there for 30 days.

A claimed site is a regular Fern site in your organization, the same as one you published with an account. You can [connect GitHub](/learn/dashboard/configuration/github-repo), [add a custom domain](/learn/dashboard/configuration/custom-domains), and, once GitHub is connected, edit with [Fern Editor](/learn/docs/writing-content/fern-editor).

To manage the site from a repository, open the site's overview and select **Connect GitHub**. Create a repository or choose an existing one, then share it with the [Fern GitHub App](/learn/dashboard/configuration/github-repo). Fern commits your `fern` folder, a publish workflow, and a README to `main`. After that, edits are pull requests, and merging publishes the site.

#### SDKs

The SDK appears on your organization's SDKs page with **Download** and **Publish to GitHub**. Select **Publish to GitHub**, create a repository or choose an existing one, then share it with the [Fern GitHub App](/learn/dashboard/configuration/github-repo). Fern pushes the SDK to `main`.

To regenerate the SDK from CI when the spec changes, select **Set up Fern repository** on the SDK's card. Fern commits your `fern` folder, a regenerate workflow, and a README to a repository you choose.

If the dialog reports that Fern can't see the repository after you share it, select **Reconnect GitHub** in the dialog or re-authorize GitHub.

## Expiration

| What                                      | How long it lasts                                                       |
| ----------------------------------------- | ----------------------------------------------------------------------- |
| Guest session and its claim link          | 3 hours from creation                                                   |
| Temporary site                            | Until the session expires. The banner on the site shows the exact time. |
| SDK build and its public build page       | 7 days from the build                                                   |
| Grant from opening the claim link         | 10 minutes, single use. Reopen the link if the claim page sat longer.   |
| Temporary URL redirect after a docs claim | 30 days                                                                 |

The CLI warns when less than an hour is left in the session, and a run that crosses the deadline fails. Work that you claim stays in your organization and no longer expires.

## Usage limits

| Limit                        | Default                                                                               |
| ---------------------------- | ------------------------------------------------------------------------------------- |
| SDK build units per session  | 5. Each target in a build spends one unit, so a TypeScript and Python build spends 2. |
| Docs publishes per session   | 10                                                                                    |
| New sessions                 | 3 per machine per day, 60 per IP address per hour                                     |
| Temporary site size          | 200 pages and 50 MB                                                                   |
| Publishes per temporary site | 20                                                                                    |
| New temporary sites          | 10 per IP address per hour                                                            |

A build that never runs doesn't spend a unit. When a session runs out, the CLI fails with `GUEST_LIMIT_REACHED` and the session keeps its work. Claim the session or log in to continue.

## Commands and options

| Command or option                                                                                         | What it does                                                                                                                |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [`fern generate --guest`](/learn/cli-api-reference/cli-reference/sdk-commands#guest)                      | Generates SDKs on a guest session and writes them to their output paths.                                                    |
| [`fern generate --docs --guest`](/learn/cli-api-reference/cli-reference/docs-commands#guest)              | Publishes docs to a temporary site on a guest session.                                                                      |
| `--no-source`                                                                                             | With `--docs --guest`, publishes without uploading the `fern` folder.                                                       |
| `--new-session`                                                                                           | With `--guest`, starts a new guest session and guest organization. Earlier guest work isn't carried over.                   |
| [`fern claim [--org <organization>]`](/learn/cli-api-reference/cli-reference/general-commands#fern-claim) | Claims this repository's guest session and moves its docs site and SDK builds into the organization. Requires `fern login`. |
| `--docs-url <slug>`                                                                                       | With `fern claim`, gives the claimed docs site the `<slug>.docs.buildwithfern.com` address.                                 |
| `--sdk-name <name>`                                                                                       | With `fern claim`, names the claimed SDK in the organization.                                                               |
| [`fern whoami`](/learn/cli-api-reference/cli-reference/general-commands#fern-whoami)                      | Shows the login, `FERN_TOKEN`, or guest session in use, with the session's ID, organization, and expiry.                    |

The CLI records the session in `fern/.guest-session`, which it gitignores, and keeps the credential in `~/.fern/guest-sessions/`. Later `--guest` runs in the same repository reuse the session.

`--guest` can't be combined with `--local` or `--runner`, and it refuses to run when `FERN_TOKEN` is set or a login is saved. Unset `FERN_TOKEN` or run `fern logout` to continue as a guest, or drop `--guest` to use your account.

Use `--new-session` only when the session expired, was revoked, or was already claimed. After a limit error, claim the session instead, because a new session counts against the daily limit.