# Use Phi from your AI

Ask Claude, Cursor or Codex to fold, design and score, check the price first, and find the results.

Once your AI is [connected](/docs/quickstart/claude), you work by asking. It picks a Phi tool, runs it on your organization's credits and brings back the result. Describe the work, ask for the price when the run is large, and say where to save the files.

## Ask for the work

Each request below names the tool your AI will call, so you can tell what it did.

**Fold a structure.** Give the sequence. Join the chains of a complex with a colon.

```text
Fold this sequence with Phi and tell me how confident the structure is: NLYIQWLKDGGPSSGRPPPS
```

Phi picks the model: ESMFold 2 for one chain, AlphaFold 2 for a complex, and Boltz-2 when the request has a ligand, DNA, RNA or an affinity prediction. Name a model if you want a different one. The tool is `phi_fold_structure`.

**Design a binder.** Load the target first, then design against residues you name.

```text
Load PDB 9GH7 into Phi. Then design miniprotein binders against chain A at residues A150, A154, A156 and A159. Price it before you run it.
```

`phi_load_target` reads the structure and reports its chains and residue numbers. `phi_design_binder` takes the modality (`miniprotein`, `vhh` or `antibody`) and picks the generator. Give hotspots. If you leave them out, the model chooses the site, which is rarely the one you want. Write residues in the structure's own numbering, as the [hotspots guide](/docs/guides/hotspots-and-numbering) explains.

**Design or score sequences.** Give a backbone. Add your own sequences to score them instead.

```text
Design 20 sequences for the backbone from my last run.
```

`phi_score_designs` runs ProteinMPNN. It measures how well a sequence fits the backbone, not whether it binds. To check binding, fold the designs and read the interface metrics.

**Any other model.** Ask what is available, then name the one you want. `phi_list_models` and `phi_describe_model` list the models and their inputs, and `phi_run_model` runs one with its own parameters.

**Group the work.** Add a project name to a request, such as "file this under TFR1 binders". Phi creates the project if it does not exist, and the runs appear under it in Work.

## Check the price first

Every tool that starts a run takes `dry_run`. A dry run returns the model it chose, the parameters and `estimated_credits`, and spends nothing. Ask for one whenever the run is large:

```text
Price this first, then wait for me to say go.
```

When you say go, your AI calls the same tool again to submit. Design runs cost the most, and a hunt model's design count is a budget, not a batch size, so start small. Ask `phi_quota` for your balance at any point.

Phi's own agent in the app always stops for your confirmation before it spends. In your own AI, the dry run is your check, and whether the client asks before each tool call is a setting in that client.

If the balance does not cover the run, or the run would go over your organization's monthly limit, Phi refuses it before it starts and returns the shortfall. An admin adds credits or raises the limit on the [Billing](/docs/billing) page.

## Follow a run

A submit returns a `job_id` at once. Your AI then calls `phi_job_status`, which reports the status, the stage that is running, the credits used and how long to wait before asking again. A fold usually finishes in about two minutes. Designs take longer.

A run ends as `COMPLETED`, `FAILED`, `CANCELLED` or `ERROR`. A failed run carries the error and a recommended action, so ask your AI to say what went wrong and what to change before it tries again.

- To stop a run and its credit use, say "cancel that run". It cannot cancel a run that has finished.
- To find a run from earlier in the conversation, ask for your recent runs. `phi_list_jobs` lists them, newest first.

## Read the results

For a design or scoring run, `phi_job_results` returns the best candidates with their sequences and scores. Rank them with `ipsae`, `ipsae_min`, `iptm`, `plddt`, `ipae` or `rmsd`, and ask for only the designs that pass every threshold.

```text
Show the top 10 designs from that run by ipSAE. Only include designs that pass all thresholds.
```

The [metrics guide](/docs/guides/metrics) says what each score means and where the thresholds come from.

Structure files come back as links that expire. Ask your AI to save them to a folder in your project, for example "save the structures to ./designs". The run stays in Work in the app either way.

## Keep the best designs

Each ranked candidate carries its design `id`. Ask your AI to star the ones you want, set a review status (`unreviewed`, `promising`, `rejected` or `selected`) or add a note. `phi_curate_designs` applies the change to every design you name in one call and records you as the reviewer.

```text
Star the top 5 designs from that run and mark them promising.
```

Rank first so your AI has the ids. Starred and reviewed designs show their state in the Designs tab of Work.

## See the work in the app

Every run your AI starts appears on the Work page of the app under your name, with its status, results and cost. Work opens on Mine. Switch to Organization to see everyone's runs. Credits come from the one balance your organization shares.

## Teach your AI Phi's methods

Skills are instruction files your AI reads when a task matches. `phi-fold` says how to fold and read the confidence scores. `phi-pilot` says how to run a small pilot before a batch, priced with a dry run first. `phi-hotspots` says how to write hotspots, and `phi-redesign` how to redesign a sequence. Install them once for Claude Code, Cursor and Codex:

```bash
phi skills install -g
```

Start a new session afterward. You can then name the skill: "use the phi-pilot skill to compare generators on this target". The [pilot guide](/docs/guides/why-pilot) shows what that run decides.

---
Source: https://dynophi.com/docs/guides/from-your-ai
