> ## Documentation Index
> Fetch the complete documentation index at: https://docs.biomni.phylo.bio/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Create an API key and authenticate your requests to the Biomni API

The Biomni API lets you run agents programmatically — create projects, upload
files, start tasks, and fetch results, all from your own code. Requests are
authenticated with an **API key**.

## Base URL

All API requests go to:

```
https://api.phylo.bio/api/v1
```

<Note>
  This is the base URL for **Individual** and **Team** plans. **Enterprise**
  plans run on a dedicated host — ask the Biomni support team for your API base
  URL.
</Note>

## Create an API key

API keys are scoped to a **workspace**: a key acts within the workspace it was
created in, and with **your own permissions** in that workspace.

1. Open **Settings → API Keys** (make sure you're in the workspace you want the
   key for).
2. Click **Create key**, give it a name (e.g. `Batch analysis pipeline`), and
   optionally an expiration.
3. **Copy the key immediately.** The plaintext key is shown **only once** —
   store it in a secret manager. You can't view it again.

<Warning>
  Treat your API key like a password. Anyone with it can act as you within that
  workspace. Never commit it to source control or paste it into shared docs.
</Warning>

## Authenticate a request

Send the key as a **bearer token** in the `Authorization` header:

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.phylo.bio/api/v1/projects \
    -H "Authorization: Bearer $BIOMNI_API_KEY"
  ```

  ```python Python theme={null}
  import os, requests

  BASE = "https://api.phylo.bio/api/v1"
  headers = {"Authorization": f"Bearer {os.environ['BIOMNI_API_KEY']}"}

  resp = requests.get(f"{BASE}/projects", headers=headers)
  resp.raise_for_status()
  print(resp.json())
  ```
</CodeGroup>

## Scope and permissions

* **Workspace-scoped.** A key only works within the workspace it was created in.
  To automate in another workspace, switch to it and create a separate key.
* **Acts as you.** The key inherits your role and access in that workspace — it
  can't do anything your account can't do.

## Revoke a key

From **Settings → API Keys**, **Revoke** disables a key immediately and
permanently. If a key might be exposed, revoke it and create a new one.

Keys can also carry an **expiration**; an expired key stops working
automatically. Set one for short-lived automation.

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/api/quickstart">
    Key → project → task → results, end to end.
  </Card>

  <Card title="Recipes" icon="book" href="/api/recipes">
    Batch runs, long-running tasks, cancellation.
  </Card>
</CardGroup>
