curl --request POST \
--url https://biohub.ai/api/v1/generate_tensor \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "esm3-open-2024-03",
"track": "<string>",
"inputs": {
"sequence": [
123
],
"coordinates": [
[
[
123
]
]
],
"structure": [
123
],
"secondary_structure": [
123
],
"sasa": [
123
],
"function": [
[
123
]
],
"residue_annotation": [
[
123
]
]
},
"potential_sequence_of_concern": false,
"invalid_ids": [],
"schedule": "cosine",
"strategy": "random",
"num_steps": 20,
"temperature": 0.5,
"temperature_annealing": true,
"top_p": 1,
"condition_on_coordinates_only": true
}
'import requests
url = "https://biohub.ai/api/v1/generate_tensor"
payload = {
"model": "esm3-open-2024-03",
"track": "<string>",
"inputs": {
"sequence": [123],
"coordinates": [[[123]]],
"structure": [123],
"secondary_structure": [123],
"sasa": [123],
"function": [[123]],
"residue_annotation": [[123]]
},
"potential_sequence_of_concern": False,
"invalid_ids": [],
"schedule": "cosine",
"strategy": "random",
"num_steps": 20,
"temperature": 0.5,
"temperature_annealing": True,
"top_p": 1,
"condition_on_coordinates_only": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'esm3-open-2024-03',
track: '<string>',
inputs: {
sequence: [123],
coordinates: [[[123]]],
structure: [123],
secondary_structure: [123],
sasa: [123],
function: [[123]],
residue_annotation: [[123]]
},
potential_sequence_of_concern: false,
invalid_ids: [],
schedule: 'cosine',
strategy: 'random',
num_steps: 20,
temperature: 0.5,
temperature_annealing: true,
top_p: 1,
condition_on_coordinates_only: true
})
};
fetch('https://biohub.ai/api/v1/generate_tensor', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://biohub.ai/api/v1/generate_tensor",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'esm3-open-2024-03',
'track' => '<string>',
'inputs' => [
'sequence' => [
123
],
'coordinates' => [
[
[
123
]
]
],
'structure' => [
123
],
'secondary_structure' => [
123
],
'sasa' => [
123
],
'function' => [
[
123
]
],
'residue_annotation' => [
[
123
]
]
],
'potential_sequence_of_concern' => false,
'invalid_ids' => [
],
'schedule' => 'cosine',
'strategy' => 'random',
'num_steps' => 20,
'temperature' => 0.5,
'temperature_annealing' => true,
'top_p' => 1,
'condition_on_coordinates_only' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://biohub.ai/api/v1/generate_tensor"
payload := strings.NewReader("{\n \"model\": \"esm3-open-2024-03\",\n \"track\": \"<string>\",\n \"inputs\": {\n \"sequence\": [\n 123\n ],\n \"coordinates\": [\n [\n [\n 123\n ]\n ]\n ],\n \"structure\": [\n 123\n ],\n \"secondary_structure\": [\n 123\n ],\n \"sasa\": [\n 123\n ],\n \"function\": [\n [\n 123\n ]\n ],\n \"residue_annotation\": [\n [\n 123\n ]\n ]\n },\n \"potential_sequence_of_concern\": false,\n \"invalid_ids\": [],\n \"schedule\": \"cosine\",\n \"strategy\": \"random\",\n \"num_steps\": 20,\n \"temperature\": 0.5,\n \"temperature_annealing\": true,\n \"top_p\": 1,\n \"condition_on_coordinates_only\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://biohub.ai/api/v1/generate_tensor")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"esm3-open-2024-03\",\n \"track\": \"<string>\",\n \"inputs\": {\n \"sequence\": [\n 123\n ],\n \"coordinates\": [\n [\n [\n 123\n ]\n ]\n ],\n \"structure\": [\n 123\n ],\n \"secondary_structure\": [\n 123\n ],\n \"sasa\": [\n 123\n ],\n \"function\": [\n [\n 123\n ]\n ],\n \"residue_annotation\": [\n [\n 123\n ]\n ]\n },\n \"potential_sequence_of_concern\": false,\n \"invalid_ids\": [],\n \"schedule\": \"cosine\",\n \"strategy\": \"random\",\n \"num_steps\": 20,\n \"temperature\": 0.5,\n \"temperature_annealing\": true,\n \"top_p\": 1,\n \"condition_on_coordinates_only\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://biohub.ai/api/v1/generate_tensor")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"esm3-open-2024-03\",\n \"track\": \"<string>\",\n \"inputs\": {\n \"sequence\": [\n 123\n ],\n \"coordinates\": [\n [\n [\n 123\n ]\n ]\n ],\n \"structure\": [\n 123\n ],\n \"secondary_structure\": [\n 123\n ],\n \"sasa\": [\n 123\n ],\n \"function\": [\n [\n 123\n ]\n ],\n \"residue_annotation\": [\n [\n 123\n ]\n ]\n },\n \"potential_sequence_of_concern\": false,\n \"invalid_ids\": [],\n \"schedule\": \"cosine\",\n \"strategy\": \"random\",\n \"num_steps\": 20,\n \"temperature\": 0.5,\n \"temperature_annealing\": true,\n \"top_p\": 1,\n \"condition_on_coordinates_only\": true\n}"
response = http.request(request)
puts response.read_body{
"model": "esm3-open-2024-03",
"created": "<string>",
"potential_sequence_of_concern": false,
"warning_messages": [
"<string>"
],
"outputs": {
"sequence": [
123
],
"coordinates": [
[
[
123
]
]
],
"structure": [
123
],
"secondary_structure": [
123
],
"sasa": [
123
],
"function": [
[
123
]
],
"residue_annotation": [
[
123
]
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}generate_tensor
(ESM3) Generates an output track conditioned on inputs. Accepts and returns raw tokens.
curl --request POST \
--url https://biohub.ai/api/v1/generate_tensor \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "esm3-open-2024-03",
"track": "<string>",
"inputs": {
"sequence": [
123
],
"coordinates": [
[
[
123
]
]
],
"structure": [
123
],
"secondary_structure": [
123
],
"sasa": [
123
],
"function": [
[
123
]
],
"residue_annotation": [
[
123
]
]
},
"potential_sequence_of_concern": false,
"invalid_ids": [],
"schedule": "cosine",
"strategy": "random",
"num_steps": 20,
"temperature": 0.5,
"temperature_annealing": true,
"top_p": 1,
"condition_on_coordinates_only": true
}
'import requests
url = "https://biohub.ai/api/v1/generate_tensor"
payload = {
"model": "esm3-open-2024-03",
"track": "<string>",
"inputs": {
"sequence": [123],
"coordinates": [[[123]]],
"structure": [123],
"secondary_structure": [123],
"sasa": [123],
"function": [[123]],
"residue_annotation": [[123]]
},
"potential_sequence_of_concern": False,
"invalid_ids": [],
"schedule": "cosine",
"strategy": "random",
"num_steps": 20,
"temperature": 0.5,
"temperature_annealing": True,
"top_p": 1,
"condition_on_coordinates_only": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'esm3-open-2024-03',
track: '<string>',
inputs: {
sequence: [123],
coordinates: [[[123]]],
structure: [123],
secondary_structure: [123],
sasa: [123],
function: [[123]],
residue_annotation: [[123]]
},
potential_sequence_of_concern: false,
invalid_ids: [],
schedule: 'cosine',
strategy: 'random',
num_steps: 20,
temperature: 0.5,
temperature_annealing: true,
top_p: 1,
condition_on_coordinates_only: true
})
};
fetch('https://biohub.ai/api/v1/generate_tensor', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://biohub.ai/api/v1/generate_tensor",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'esm3-open-2024-03',
'track' => '<string>',
'inputs' => [
'sequence' => [
123
],
'coordinates' => [
[
[
123
]
]
],
'structure' => [
123
],
'secondary_structure' => [
123
],
'sasa' => [
123
],
'function' => [
[
123
]
],
'residue_annotation' => [
[
123
]
]
],
'potential_sequence_of_concern' => false,
'invalid_ids' => [
],
'schedule' => 'cosine',
'strategy' => 'random',
'num_steps' => 20,
'temperature' => 0.5,
'temperature_annealing' => true,
'top_p' => 1,
'condition_on_coordinates_only' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://biohub.ai/api/v1/generate_tensor"
payload := strings.NewReader("{\n \"model\": \"esm3-open-2024-03\",\n \"track\": \"<string>\",\n \"inputs\": {\n \"sequence\": [\n 123\n ],\n \"coordinates\": [\n [\n [\n 123\n ]\n ]\n ],\n \"structure\": [\n 123\n ],\n \"secondary_structure\": [\n 123\n ],\n \"sasa\": [\n 123\n ],\n \"function\": [\n [\n 123\n ]\n ],\n \"residue_annotation\": [\n [\n 123\n ]\n ]\n },\n \"potential_sequence_of_concern\": false,\n \"invalid_ids\": [],\n \"schedule\": \"cosine\",\n \"strategy\": \"random\",\n \"num_steps\": 20,\n \"temperature\": 0.5,\n \"temperature_annealing\": true,\n \"top_p\": 1,\n \"condition_on_coordinates_only\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://biohub.ai/api/v1/generate_tensor")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"esm3-open-2024-03\",\n \"track\": \"<string>\",\n \"inputs\": {\n \"sequence\": [\n 123\n ],\n \"coordinates\": [\n [\n [\n 123\n ]\n ]\n ],\n \"structure\": [\n 123\n ],\n \"secondary_structure\": [\n 123\n ],\n \"sasa\": [\n 123\n ],\n \"function\": [\n [\n 123\n ]\n ],\n \"residue_annotation\": [\n [\n 123\n ]\n ]\n },\n \"potential_sequence_of_concern\": false,\n \"invalid_ids\": [],\n \"schedule\": \"cosine\",\n \"strategy\": \"random\",\n \"num_steps\": 20,\n \"temperature\": 0.5,\n \"temperature_annealing\": true,\n \"top_p\": 1,\n \"condition_on_coordinates_only\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://biohub.ai/api/v1/generate_tensor")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"esm3-open-2024-03\",\n \"track\": \"<string>\",\n \"inputs\": {\n \"sequence\": [\n 123\n ],\n \"coordinates\": [\n [\n [\n 123\n ]\n ]\n ],\n \"structure\": [\n 123\n ],\n \"secondary_structure\": [\n 123\n ],\n \"sasa\": [\n 123\n ],\n \"function\": [\n [\n 123\n ]\n ],\n \"residue_annotation\": [\n [\n 123\n ]\n ]\n },\n \"potential_sequence_of_concern\": false,\n \"invalid_ids\": [],\n \"schedule\": \"cosine\",\n \"strategy\": \"random\",\n \"num_steps\": 20,\n \"temperature\": 0.5,\n \"temperature_annealing\": true,\n \"top_p\": 1,\n \"condition_on_coordinates_only\": true\n}"
response = http.request(request)
puts response.read_body{
"model": "esm3-open-2024-03",
"created": "<string>",
"potential_sequence_of_concern": false,
"warning_messages": [
"<string>"
],
"outputs": {
"sequence": [
123
],
"coordinates": [
[
[
123
]
]
],
"structure": [
123
],
"secondary_structure": [
123
],
"sasa": [
123
],
"function": [
[
123
]
],
"residue_annotation": [
[
123
]
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
You may have access to additional, private models as well. These will be visible on the Rate Limits page under the Developer Console
esm3-open-2024-03 Track to generate: sequence, structure, secondary_structure, sasa, or function.
Show child attributes
Show child attributes
Disclose potential sequences of concern. For approved users, such sequences will not go through additional safety filtering. Reach out if you are interested in using this.
Token indices that should not be sampled.
Unmasking schedule for generation. Controls the number of tokens to unmask during each round of iterative generation.
cosine, linear Unmasking strategy to use. Controls which tokens to unmask during each round of iterative generation. 'random' will unmask a correct number of tokens randomly. 'entropy' will unmask the tokens with the lowest logit entropy first. Default was random. Updated on 02/14/2025.
random, entropy Number of steps for generation. There is diminishing return for decoding steps more than 20. Note that this needs to be less than or equal to the sequence length. Default was 8. Updated on 02/14/2025.
1 <= x <= 100Temperature for sampling. Default was 1.0. Updated on 02/14/2025.
x >= 0Whether temperature should be annealed during generation. Default was False. Updated on 02/14/2025.
Top-p sampling.
x <= 1Use coordinates instead of structure tokens as generation conditioning.
Response
Successful Response
You may have access to additional, private models as well. These will be visible on the Rate Limits page under the Developer Console
esm3-open-2024-03 ISO formatted date time
Indicate that the returned sequence may be of potential concerns.
Warning messages returned by FastAPI.
Show child attributes
Show child attributes