Structure prediction uses proteins, DNA, RNA, small-molecule ligands, or ions to predict the 3D structure of one molecular system. Multiple entities in the same task are predicted together as a complex.
Use model Melo-1 with task type 1. This guide covers input preparation, quoting, submission, and result retrieval. See the task management API for fields and states and the API integration guide for authentication. To pair one target separately with multiple candidates, use virtual screening.
Workflow
- Prepare input: List the molecular entities and chain IDs in
input.sequences. - Get a quote: Call
POST /v1/tasks/quoteto confirm tokens and estimated credits. - Submit: Call
POST /v1/tasks/createwith the same model, task type, and input; save the returnedtask_id. - Query and download: Check
GET /v1/tasks/status. After successful completion, download the complete result ZIP fromoutput_url. - View results: Inspect the structures or create an offline interactive report using the structure prediction report template.
Input format
This example predicts a protein chain and a small-molecule ligand together. Save the request as prediction.json for the quote and submission examples below:
{
"model": "Melo-1",
"task_type": 1,
"input": {
"num_seeds": 1,
"sequences": [
{
"type": "protein",
"id": ["A"],
"sequence": "MKTIIALSYIFCLVFADYKDDDDK"
},
{
"type": "ligand",
"id": ["B"],
"smiles": "CC(=O)OC1=CC=CC=C1C(=O)O"
}
]
}
}
This example illustrates the request format; it is not a validated binding molecule.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | No | Defaults to Melo-1; this is the only currently available model |
task_type | int | No | 1 for structure prediction; also the default if omitted |
task_name | string | No | Used only at task creation; see task submission for naming rules |
input.sequences | array | Yes | Molecular entities to predict; at least one entry |
input.num_seeds | int | No | Number of inference seeds, default 1; accepts 1–20 and multiplies the cost |
Structure prediction uses sequences; do not include screening fields target or candidates. Send only the input parameters described in this guide.
Number of inference seeds
Set input.num_seeds to predict the same molecular system using multiple random seeds. It defaults to 1. Explicit 0, negative values, or values above 20 return INVALID_ARGUMENT. The value must be an integer. Only structure prediction supports it, not virtual screening.
num_seeds specifies the number of random seeds, not a particular seed value or the final number of structure files. Each seed currently generates 5 structure samples; num_seeds: 20 therefore produces 100 samples. More seeds provide more samples but do not guarantee better predictions.
Structure prediction cost is token-tier base cost × num_seeds. The token count and 2,000-token limit are not multiplied. For example, 420 tokens cost 10 credits per seed; num_seeds: 20 costs 200 credits.
Use the same input.num_seeds for quoting and submission. Request a new quote after changing it and adjust the top-level max_cost accordingly.
Models and molecule types
| Model | Supported type values |
|---|---|
Melo-1 | protein, dna, rna, ligand, ion |
Model names and molecule types are case-sensitive. Use the exact spelling in the table.
sequences entries
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Molecular entity type supported by the selected model |
id | array[string] | Yes | 1–50 distinct chain IDs; each is 1–50 characters using only letters, digits, underscores, dots, and hyphens |
sequence | string | Conditional | Required for protein, dna, and rna; minimum length 4; whitespace in the request is ignored |
smiles | string | Conditional | For ligand or ion, supply at least one of smiles or ccd; smiles takes precedence when both are present |
ccd | string | Conditional | PDB CCD code, preferably uppercase, such as ATP, HEM, or MG |
modifications | array | No | CCD modifications for protein, dna, or rna, described below; omitted or [] means no modifications |
Sequence length and alphabet requirements:
- Minimum sequence length: Each
protein,dna, orrnasequence must have at least 4 residues or bases; shorter inputs returnINVALID_SEQUENCE. - Allowed characters:
| Type | Allowed characters |
|---|---|
protein | Standard 20-amino-acid alphabet: ACDEFGHIKLMNPQRSTVWY |
dna | ATCG |
rna | AUCGN |
Use uppercase sequences where possible. The platform also validates SMILES and CCD codes. See pricing and quotas for token calculations.
CCD modifications
Melo-1 accepts CCD modifications through modifications for proteins, DNA, and RNA. For example, the following three entities can be included in input.sequences:
[
{
"type": "protein",
"id": ["A"],
"sequence": "ASGS",
"modifications": [{"position": 2, "ccd": "SEP"}]
},
{
"type": "dna",
"id": ["B"],
"sequence": "ACGT",
"modifications": [{"position": 2, "ccd": "5CM"}]
},
{
"type": "rna",
"id": ["C"],
"sequence": "AUCG",
"modifications": [{"position": 2, "ccd": "PSU"}]
}
]
positionis a 1-based integer within the sequence length. Each position may appear at most once per sequence.ccdis a 1–5-character alphanumeric CCD code, preferably uppercase. The CCD must exist and its category must match protein, DNA, or RNA.- Each modification replaces the entire residue or base at that position with the specified CCD component. Keep the original standard one-letter
sequence; modifications do not change its length. - Each entity supports at most 1,000 modifications. All chain copies in its
idlist use the same modifications.ligandandiondo not support this field. - Omit
modificationsor use[]for no modifications. Use the same modification list for quoting and submission.
A modified position contributes the CCD heavy-atom count, replacing its original 1 token. For example, a length-4 protein with one SEP modification of 11 heavy atoms contributes 4 - 1 + 11 = 14 tokens per chain, or 28 for two identical chains. See token calculation.
Quote and submit
Get a quote
Replace the placeholder with your API key:
curl --request POST 'https://api.atomelody.com/v1/tasks/quote' \
--header 'Authorization: Bearer ak_your_api_key_here' \
--header 'Content-Type: application/json' \
--data-binary @prediction.json
data.token_num is the total tokens across all input molecules, without multiplying by seeds. data.base_cost is the cost for one seed at that tier, and data.quantity is the actual seed count. data.estimated_cost already includes the multiplier; do not multiply it again. See pricing and quotas for the tiers.
Quoting does not create a task, reserve credits, or lock the price. After confirming the quote, submit the same input. The creation response's billing_order.frozen is the actual reservation.
Submit and query a task
Choose either method below. The Python example requires requests and reads the previously saved prediction.json.
import json
from pathlib import Path
import requests
BASE_URL = "https://api.atomelody.com"
API_KEY = "ak_your_api_key_here"
headers = {"Authorization": f"Bearer {API_KEY}"}
payload = json.loads(Path("prediction.json").read_text(encoding="utf-8"))
payload["task_name"] = "Demo_Task" # Optional; provide only when creating the task
response = requests.post(
f"{BASE_URL}/v1/tasks/create",
headers=headers,
json=payload,
timeout=30,
)
response.raise_for_status()
result = response.json()
if result["code"] != "OK":
raise RuntimeError(f'{result["code"]}: {result["message"]}')
task_id = result["data"]["task_id"]
print("Task ID:", task_id)
print("Reserved credits:", result["data"]["billing_order"]["frozen"])
query = requests.get(
f"{BASE_URL}/v1/tasks/status",
headers=headers,
params={"task_id": task_id},
timeout=30,
)
query.raise_for_status()
print(query.json())
The example queries status once; the task may still be running. Use the task waiting script to wait for the same task_id without creating another task. See the task management API for states, cancellation, and error handling.
Query status and download results
For longer waits, use the task waiting script. It polls automatically and prints only status changes and the final result.
| Task state | Action |
|---|---|
1 (CREATED) or 2 (QUEUED) | Wait for execution; use the cancel endpoint if needed |
3 (RUNNING) | Continue polling until computation finishes |
4 (COMPLETED) | Download the complete result ZIP from output_url |
5 (FAILED) | Check data.error.code; reserved credits are released automatically |
6 (CANCELLED) | The task is cancelled; reserved credits are released automatically |
Top-level code: "OK" only means the status query succeeded. Completion depends on data.status. Download URLs are valid for 10 minutes; query again to obtain a new one after expiry.
Use the results
Save the complete ZIP as <task-id>-output.zip and retain the task ID to associate inputs with results.
To explore 3D structures, switch samples, and review ranking scores and confidence, follow creating a structure prediction report. Ask your agent to embed the complete ZIP in the HTML template. The resulting report works offline and supports structure exports.
Reports contain prediction data. Check who should receive them before sharing. Do not include an API key or temporary download URL.