AbLang API#

Zeeshan Siddiqui

Feb, 2023

6 min read

On this page, we will show and explain the use of AbLang for Antibody Sequence Completion. As well as document the BioLM API, and demonstrate no-code and code interfaces antibody design


There are 2 BioLM endpoints corresponding to the AbLang Heavy and Light Chain models.

Each of these endpoints has the encode, predict and generate actions

encode generates embeddings, predict returns the likelihoods for the sequence and generate restores the specified positions of a sequence.

Encode API Usage#

Using AbLang Heavy Chain as an example, the encode endpoint is at API endpoint for https://biolm.ai/api/v2/ablang-heavy/encode/.

Making Requests#

import requests

url = "https://biolm.ai/api/v2/ablang-heavy/encode/"

payload = {
    "items": [
    "params": {
        "include": "seqcoding"
headers = {
'Authorization': 'Token {}'.format(os.environ["BIOLMAI_TOKEN"]),
'Content-Type': 'application/json'

response = requests.request("POST", url, headers=headers, data=payload)

import biolmai

cls = biolmai.AbLangHeavy()
resp = cls.encode(seqs, params={
        "include": [
headers = c(
'Authorization' = paste('Token', Sys.getenv('BIOLMAI_TOKEN')),
"Content-Type" = "application/json"
payload = "
    \"items\": [
    \"params\": {
        \"include\": \"seqcoding\"
res <- postForm("https://biolm.ai/api/v2/ablang-heavy/encode/", .opts=list(postfields = payload, followlocation = TRUE), style = "httppost")

JSON Response#

Expand Example Response
"results": [
      "seqcoding": [


The above response is only a small snippet of the full JSON response. However, all the relevant response keys are included.

Request Definitions#


Additional parameters for the request.


Specifies additional data to be included in the response. “seqcoding” indicates that sequence embeddings should be included.


A string variable containing the JSON payload to be sent in the POST request. It consists of items and sequence.


The amino acid sequence of the antibody heavy chain for which you want to generate embeddings.


A list of dictionaries, each representing an item to be processed by the ABLang model. Each dictionary has a key.

Response Definitions#


A list containing the results of the ABLang model’s encoding process. Each element in this list is a dictionary representing the results for one input item (in this case, one antibody heavy chain sequence).


A key within each result dictionary that corresponds to the sequence embeddings generated by the ABLang model for the input antibody heavy chain sequence. The value is a list of floating-point numbers, each representing a dimension in the embedding space. These embeddings capture the characteristics of the input sequence and can be used for various downstream tasks, such as similarity comparisons, clustering, or as input features for machine learning models.