Skip to main content
This guide takes you from an API key to a full agent run: create a project, start a task, wait for it to finish, and pull the result files. Every call uses your API key as a bearer token.

Set up your key

Create a key in Settings → API Keys (see Authentication), then export it:
The base URL is https://api.phylo.bio/api/v1. All requests act within the workspace your key belongs to.
Confirm it works with a read-only call:
A 200 means you’re authenticated; a 401 means the key is missing, revoked, or expired (see Errors & rate limits).

The core loop

1

Create a project

Projects group related tasks and files.
Response contains a project id (proj_...).
2

Start a task

Send a message with a project_id — Biomni auto-creates a task and starts the agent. The response includes the new task (with its id, sess_...).
To attach files you uploaded to the project, pass their ids as "file_ids": ["file_..."] (see Working with files).
3

Poll until it's done

Fetch the task and watch status move from idle/running to completed (or failed).
Poll on an interval (e.g. every 5–10s) with backoff. Agent tasks can run for minutes; design for long-running work rather than a single blocking request.
4

Fetch the results

List the files the agent produced. Each carries a presigned download_url.
Download each download_url to save the outputs.

Full example (Python)

A complete, copy-pasteable script that runs the loop end-to-end:

Working with files

To give the agent input files, upload them to the project’s Drive first, then reference their ids when you start the task. The bytes go directly to cloud storage — the API only hands you a presigned target and never touches the file itself:
  1. POST /files/uploads — begin an upload for a file in a project; returns a presigned upload_url, the fields to send with it, and a file_id.
  2. POST the bytes to upload_url as form-data with those fields (returns 204).
  3. POST /files/{file_id}/finalize — confirm the upload so the agent can read it.
  4. Pass "file_ids": ["file_..."] in your POST /messages call.
Files of any size work — the response’s upload_type is single for small files and multipart for large ones (upload the parts, then finalize with their ETags). We recommend keeping individual files under 25 GB. See the Upload a file reference for both flows.

Choosing a model tier

The first POST /messages that creates a Task can pick the agent’s model tier with model: standard (default), fast (lower latency), or max (highest capability). Omit it to use the account default. The tier is set when the Task is created, so continuing a Task (task_id) ignores it.

Next steps