Fastfold Docs

SDK

Install, authenticate, configure, and use the FastFold Python client.

Python client for the FastFold Jobs API.

Installation

Requires Python 3.8+.

pip install fastfold-ai

Authentication

Set your API key in the environment:

export FASTFOLD_API_KEY="sk-...your-api-key"

Then create the client (it reads FASTFOLD_API_KEY by default):

from fastfold import Client

client = Client()

You can also pass credentials explicitly (handy in CI or when using multiple keys):

from fastfold import Client

client = Client(api_key="sk-...your-api-key")

Base URL (optional)

By default, the SDK targets the FastFold API. If you need to override it (self-hosting, proxies, or testing), set a base URL:

from fastfold import Client

client = Client(base_url="https://api.fastfold.ai")

Your first fold

from fastfold import Client

client = Client()  # reads FASTFOLD_API_KEY

myJob = client.fold.create(
    sequence="LLGDFFRKSKEKIGKEFKRIVQRIKDFLRNLVPRTES",
    model="boltz-2",
    is_public=True,
)

print("Job ID:", myJob.id)

results = client.jobs.wait_for_completion(myJob.id, poll_interval=5.0, timeout=900.0)
print("Status:", results.job.status)
print("CIF URL:", results.cif_url())
print("Mean PLDDT:", results.metrics().mean_PLDDT)

link = results.get_viewer_link()
print("Open in viewer:", link)

Polling, timeouts, and scripts

In scripts and notebooks, prefer waiting for completion to simplify control flow:

results = client.jobs.wait_for_completion(
    myJob.id,
    poll_interval=5.0,  # seconds between polls
    timeout=900.0,      # seconds until giving up
)

If you want to implement your own polling loop, you can treat job status as the source of truth and branch your logic accordingly (see the status list in the Examples page).

Visibility (public vs private)

client.jobs.set_public(myJob.id, True)  # make job publicly accessible

What’s next

Last updated on

On this page