adaptyv
How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.
Install this skill
Works with Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, and 70+ other harnesses.
npx skills add KalarisLabs/research-agent-skills --skill adaptyvuvx research-agent-skills install adaptyvDocumentation & Instructions
Adaptyv Bio Foundry API
Adaptyv Bio is a cloud lab that turns protein sequences into experimental data. Users submit amino acid sequences via API or UI; Adaptyv's automated lab runs assays (binding, thermostability, expression, fluorescence) and delivers results in ~21 days.
Official docs: docs.adaptyvbio.com/api-reference · llms.txt index · OpenAPI spec
Quick Start
Base URL: https://foundry-api-public.adaptyvbio.com/api/v1
Authentication: Bearer token in the Authorization header. Tokens are obtained from foundry.adaptyvbio.com sidebar.
When writing code, always read the API key from the environment variable ADAPTYV_API_KEY or from a .env file — never hardcode tokens. Check for a .env file in the project root first; if one exists, use a library like python-dotenv to load it.
The official API docs use FOUNDRY_API_TOKEN in curl examples; that is the same bearer token — prefer ADAPTYV_API_KEY in Python and new shell scripts for consistency with the SDK.
export ADAPTYV_API_KEY="abs0_..."
curl https://foundry-api-public.adaptyvbio.com/api/v1/targets?limit=3 \
-H "Authorization: Bearer $ADAPTYV_API_KEY"
Every request except GET /openapi.json requires authentication. Store tokens in environment variables or .env files — never commit them to source control.
Python SDK
Version note: adaptyv-sdk 0.1.0 (beta) is not yet on PyPI — install from GitHub:
uv pip install "git+https://github.com/adaptyvbio/adaptyv-sdk.git"
In a project with pyproject.toml:
uv add "adaptyv-sdk @ git+https://github.com/adaptyvbio/adaptyv-sdk.git"
Environment variables (set in shell or .env file):
ADAPTYV_API_KEY=your_api_key
ADAPTYV_API_URL=https://foundry-api-public.adaptyvbio.com/api/v1
ADAPTYV_ORGANIZATION_ID=your_org_id # optional
The @lab.experiment decorator and FoundryClient both read ADAPTYV_API_KEY and ADAPTYV_API_URL from the environment when not passed explicitly.
Decorator Pattern
from adaptyv import lab
@lab.experiment(target="PD-L1", experiment_type="screening", method="bli")
def design_binders():
return {"design_a": "MVKVGVNG...", "design_b": "MKVLVAG..."}
result = design_binders()
print(f"Experiment: {result.experiment_url}")
Client Pattern
import os
from adaptyv import FoundryClient
client = FoundryClient(
api_key=os.environ["ADAPTYV_API_KEY"],
base_url=os.environ.get(
"ADAPTYV_API_URL",
"https://foundry-api-public.adaptyvbio.com/api/v1",
),
)
# Browse targets
targets = client.targets.list(search="EGFR", selfservice_only=True)
# Estimate cost
estimate = client.experiments.cost_estimate({
"experiment_spec": {
"experiment_type": "screening",
"method": "bli",
"target_id": "target-uuid",
"sequences": {"seq1": "EVQLVESGGGLVQ..."},
"n_replicates": 3
}
})
# Create and submit
exp = client.experiments.create({...})
client.experiments.submit(exp.experiment_id)
# Later: retrieve results
results = client.experiments.get_results(exp.experiment_id)
Experiment Types
| Type | Method | Measures | Requires Target |
|---|---|---|---|
affinity |
bli or spr |
KD, kon, koff kinetics | Yes |
screening |
bli or spr |
Yes/no binding | Yes |
thermostability |
— | Melting temperature (Tm) | No |
expression |
— | Expression yield | No |
fluorescence |
— | Fluorescence intensity | No |
Experiment Lifecycle
Draft → WaitingForConfirmation → QuoteSent → WaitingForMaterials → InQueue → InProduction → DataAnalysis → InReview → Done
| Status | Who Acts | Description |
|---|---|---|
Draft |
You | Editable, no cost commitment |
WaitingForConfirmation |
Adaptyv | Under review, quote being prepared |
QuoteSent |
You | Review and confirm the quote |
WaitingForMaterials |
Adaptyv | Gene fragments and target ordered |
InQueue |
Adaptyv | Materials arrived, queued for lab |
InProduction |
Adaptyv | Assay running |
DataAnalysis |
Adaptyv | Raw data processing and QC |
InReview |
Adaptyv | Final validation |
Done |
You | Results available |
Canceled |
Either | Experiment canceled |
The results_status field on an experiment tracks: none, partial, or all.
Common Workflows
1. Submit a Binding Screen (Step by Step)
# 1. Find a target
targets = client.targets.list(search="EGFR", selfservice_only=True)
target_id = targets.items[0].id
# 2. Preview cost
estimate = client.experiments.cost_estimate({
"experiment_spec": {
"experiment_type": "screening",
"method": "bli",
"target_id": target_id,
"sequences": {"seq1": "EVQLVESGGGLVQ...", "seq2": "MKVLVAG..."},
"n_replicates": 3
}
})
# 3. Create experiment (starts as Draft)
exp = client.experiments.create({
"name": "EGFR binder screen batch 1",
"experiment_spec": {
"experiment_type": "screening",
"method": "bli",
"target_id": target_id,
"sequences": {"seq1": "EVQLVESGGGLVQ...", "seq2": "MKVLVAG..."},
"n_replicates": 3
}
})
# 4. Submit for review
client.experiments.submit(exp.experiment_id)
# 5. Poll or use webhooks until Done
# 6. Retrieve results
results = client.experiments.get_results(exp.experiment_id)
2. Automated Pipeline (Skip Draft + Auto-Accept Quote)
exp = client.experiments.create({
"name": "Auto pipeline run",
"experiment_spec": {...},
"skip_draft": True,
"auto_accept_quote": True,
"webhook_url": "https://my-server.com/webhook"
})
# Webhook fires on each status transition; poll or wait for Done
3. Using Webhooks
Pass webhook_url when creating an experiment. Adaptyv POSTs to that URL on every status transition with the experiment ID, previous status, and new status.
Sequences
- Simple format:
{"seq1": "EVQLVESGGGLVQPGGSLRLSCAAS"} - Rich format:
{"seq1": {"aa_string": "EVQLVESGGGLVQ...", "control": false, "metadata": {"type": "scfv"}}} - Multi-chain: use colon separator —
"MVLS:EVQL" - Valid amino acids: A, C, D, E, F, G, H, I, K, L, M, N, P, Q, R, S, T, V, W, Y (case-insensitive, stored uppercase)
- Sequences can only be added to experiments in
Draftstatus
Filtering, Sorting, and Pagination
All list endpoints support pagination (limit 1-100, default 50; offset), search (free-text on name fields), and sorting.
Filtering uses s-expression syntax via the filter query parameter:
- Comparison:
eq(field,value),neq,gt,gte,lt,lte,contains(field,substring) - Range/set:
between(field,lo,hi),in(field,v1,v2,...) - Logic:
and(expr1,expr2,...),or(...),not(expr) - Null:
is_null(field),is_not_null(field) - JSONB:
at(field,key)— e.g.,eq(at(metadata,score),42) - Cast:
float(),int(),text(),timestamp(),date()
Sorting uses asc(field) or desc(field), comma-separated (max 8):
sort=desc(created_at),asc(name)
Example: filter=and(gte(created_at,2026-01-01),eq(status,done))
Error Handling
All errors return:
{
"error": "Human-readable description",
"request_id": "req_019462a4-b1c2-7def-8901-23456789abcd"
}
The request_id is also in the x-request-id response header — include it when contacting support.
Token Management
Tokens use Biscuit-based cryptographic attenuation. You can create restricted tokens scoped by organization, resource type, actions (read/create/update), and expiry via POST /tokens/attenuate. Revoking a token (POST /tokens/revoke) revokes it and all its descendants.
Detailed API Reference
For the full list of all 32 endpoints with request/response schemas, read references/api-endpoints.md.
Agent operating procedure
- Check the environment. Confirm toolkit versions and input formats (SMILES, SDF, PDB, CIF), and sanitize molecules before computing.
- Pin down the inputs. Confirm formats, identifiers and parameters from the data or the user. Ask rather than guess any value that changes the result.
- Run a small version first. Process a few molecules or one target first and inspect the outputs.
- Execute the full task using the instructions and references above.
- Validate the result. Check for invalid structures, unit consistency, and applicability domain of predictive models.
- Report. State what was run (versions, commands, parameters), what was checked, and what is still uncertain.
| If this happens | Do this |
|---|---|
| Molecules fail to parse or sanitize | Report and skip them with reasons; never silently drop or alter structures. |
| A function, flag or endpoint in these instructions is missing in the installed version | Check the installed version's own documentation (help(), --help, official docs), adapt, and tell the user. Never invent an API. |
| A required input, identifier or parameter is ambiguous | Ask the user, or state the assumption explicitly before running. |
Integrity rules
- Never fabricate results, parameters, identifiers, citations or statistics. If something cannot be run or verified, say so plainly.
- Computational predictions are hypotheses, not experimental results; label them as such.
- Treat version-specific details here as possibly outdated: confirm them against the official documentation for the installed version.
- Ask before actions that cost money, consume shared GPUs or cloud quota, touch personal or patient data, or cannot be undone.
Related skills
tamarind: Access a collection of open-source molecular design and structural biology tools on the Tamarind Bio platform, via its REST API or MCP serv…ginkgo-cloud-lab: Submit and manage protocols on Ginkgo Bioworks Cloud Lab (cloud.ginkgo.bio), a web-based interface for autonomous lab execution on Reconfig…esm: Covers the EvolutionaryScale/BiohubesmPython SDK: ESM3 generative protein design (sequence, structure and function tracks, chain-of-tho…
Trigger Prompts & Evaluation Corpus
These evaluation prompts test that the agent correctly selects adaptyv for relevant tasks and leaves it out for near misses.
Should trigger (3)
- should trigger
“How do I submit a few sequences to a cloud lab to see if they bind my target? I'm using the Python SDK.”
expects Uses the Adaptyv Foundry SDK or API. Notes the SDK must be installed from GitHub, not PyPI. Reads ADAPTYV_API_KEY from the environment or a .env file and never hardcodes it. Chooses a screening or affinity experiment with the bli or spr method and a target. Creates the experiment in Draft, adds sequences, then submits. Warns that submission leads to a quote and costs money, so asks before confirming it.
- should trigger
“I have binders.fasta with 48 designed nanobody sequences. I want KD values against my target using SPR, and I want the quote auto-accepted so nothing waits on me. My script has `from adaptyv_sdk import FoundryClient` and it's returning a 401. Can you fix the script and set up a webhook so I get notified on status changes?”
expects Diagnoses the 401 as a missing or invalid bearer token. Loads ADAPTYV_API_KEY from env or .env via python-dotenv instead of hardcoding it. Builds an affinity experiment with the spr method from the FASTA sequences, in the simple or rich seq format with valid amino acids. Passes webhook_url, which fires on each status transition. Flags that auto-accepting the quote commits spend and confirms with the user first. Mentions x-request-id and the ~21 day turnaround.
- should trigger
“I've designed 200 miniprotein binders computationally and want real wet-lab data on which ones actually express and how stable they are. Is there an automated lab service with an API where I can send the sequences and get melting temperatures and yields back, and how would I script that and poll for results?”
expects Recommends the Adaptyv Bio Foundry cloud lab API or SDK. Uses thermostability (Tm) and expression experiment types, which need no target. Describes the lifecycle from Draft through QuoteSent to Done, and the results_status field (none, partial, all). Shows polling or webhooks, with auth from the ADAPTYV_API_KEY environment variable. Labels earlier computational predictions as hypotheses, not results.
Near misses (2)
- near miss
“Run Boltz and AlphaFold on my antibody–antigen complex through Tamarind's API and compare the predicted structures.”
expects Does not use the adaptyv skill. Uses the tamarind skill, since this is computational structure prediction on the Tamarind platform and not wet-lab experiment submission.
- near miss
“Use ESM3 to generate variants of my protein sequence conditioned on a structure prompt, and score them with the language model's log-likelihood.”
expects Does not use the adaptyv skill. Uses the esm skill for ESM3 generative design and scoring. No lab submission is involved.