API reference
Your models
Models you trained, of every type: list, inspect, rename, tag and delete.
On this page
List your MPNN models (deprecated)
GET/api/v1/user-models/mpnn
API key or tokenDeprecated
Deprecated. Use GET /user-models?model_type=mpnn and GET /user-models/{model_id}. This route stops working after Fri, 15 Jan 2027 00:00:00 GMT.
Parameters
| Name | Type | Description |
|---|---|---|
model_name | string |
Example request
curl "https://api.cognichem.com/api/v1/user-models/mpnn" \
-H "X-Api-Key: $COGNICHEM_API_KEY"from cognichem_client import CogniChem
client = CogniChem.from_env()
result = client.inference.models.mpnn.user()
print(result)Python SDK pip install cognichem-client (1.1 or later). from_env() reads COGNICHEM_API_KEY.
Responses
Successful Response · application/json · GetMPNNModelsResponse
| Field | Type | Description |
|---|---|---|
model_info | object | null | A dictionary containing MPNN model information. |
model_names[] | string[] | null | A list of MPNN model names. |
models[] | SavedModelRef[] | null | The same models with their ids, for scoring jobs. |
models.classes_by_target[] | ((string | integer)[])[] | null | Class labels per target of a multiclass model (models trained since #976); a scoring job names one as |
models.created_at | string | null | When training started (your models only). |
models.model_idrequired | string |
|
models.model_typerequired | string | Model family ( |
models.namerequired | string | Display name; pass it as |
models.statusrequired | string |
One of: |
models.target_names[] | string[] | null | The model's targets, primary first; a scoring job may name another as |
models.task | string | null |
|
models.unit | string | null | Unit of the predicted value, when the model declares one. |
models.visibilityrequired | string |
One of: |
Errors are RFC 7807 problem details (application/problem+json) with status, title, detail, request_id, and a retryability hint (validation, auth, quota, conflict, upstream, timeout, or terminal). Handling errors
| Status | When |
|---|---|
400 | Invalid input or business rule violation. |
401 | Missing or invalid credentials. |
402 | Wallet cannot cover the Assistant turn hold. |
403 | Authenticated but not allowed to access the resource. |
404 | Resource not found or not owned by the user. |
409 | Conflict (e.g. idempotency key reuse with a different body). |
413 | Request body or workflow spec exceeds size caps. |
422 | Request body or query failed validation. |
429 | Rate limit exceeded. |
500 | Unexpected server error. |
503 | Dependency temporarily unavailable. |
Delete one of your MPNN models (deprecated)
DELETE/api/v1/user-models/mpnn
API key or tokenDeprecated
Deprecated. Use DELETE /user-models/{model_id}. This route stops working after Fri, 15 Jan 2027 00:00:00 GMT.
Parameters
| Name | Type | Description |
|---|---|---|
model_namerequired | string |
Example request
curl -X DELETE "https://api.cognichem.com/api/v1/user-models/mpnn?model_name=MODEL_NAME" \
-H "X-Api-Key: $COGNICHEM_API_KEY"from cognichem_client import CogniChem
client = CogniChem.from_env()
result = client.inference.models.mpnn.delete("MODEL_NAME")
print(result)Python SDK pip install cognichem-client (1.1 or later). from_env() reads COGNICHEM_API_KEY.
Responses
Successful Response · application/json · MessageResponse
| Field | Type | Description |
|---|---|---|
messagerequired | string | The message content. |
Errors are RFC 7807 problem details (application/problem+json) with status, title, detail, request_id, and a retryability hint (validation, auth, quota, conflict, upstream, timeout, or terminal). Handling errors
| Status | When |
|---|---|
400 | Invalid input or business rule violation. |
401 | Missing or invalid credentials. |
402 | Wallet cannot cover the Assistant turn hold. |
403 | Authenticated but not allowed to access the resource. |
404 | Resource not found or not owned by the user. |
409 | Conflict (e.g. idempotency key reuse with a different body). |
413 | Request body or workflow spec exceeds size caps. |
422 | Request body or query failed validation. |
429 | Rate limit exceeded. |
500 | Unexpected server error. |
503 | Dependency temporarily unavailable. |
List your saved models
GET/api/v1/user-models
API key or token
List the models you trained, oldest first, with your model quota.
Each entry has the model_id that scoring jobs take and the model_type and name that inference takes, plus its description, tags and validation / test metrics (fold_metrics). quota counts your models against your plan's cap; failed models never count.
Parameters
| Name | Type | Description |
|---|---|---|
model_type | string | Only models of this type (for example Limits: |
include_failed | boolean | Also list your newest failed models (up to 100), whose training stopped without a model. Default: |
Example request
curl "https://api.cognichem.com/api/v1/user-models?model_type=mpnn" \
-H "X-Api-Key: $COGNICHEM_API_KEY"import os
import httpx
response = httpx.get(
"https://api.cognichem.com/api/v1/user-models",
params={"model_type": "mpnn"},
headers={"X-Api-Key": os.environ["COGNICHEM_API_KEY"]},
)
response.raise_for_status()
print(response.json())Uses httpx; the Python SDK has no method for this endpoint.
Responses
Successful Response · application/json · UserModelsResponse
| Field | Type | Description |
|---|---|---|
models[]required | UserModelSummary[] | Your models, oldest first. |
models.classes_by_target[] | ((string | integer)[])[] | null | |
models.created_at | string | null | |
models.description | string | null | Your description. |
models.failure_reason | string | null | Why a failed model has no bundle ( |
models.fold_metrics | map<string, number> | Validation, cross-validation and test metrics such as |
models.model_idrequired | string | |
models.model_typerequired | string | |
models.namerequired | string | |
models.public_model_id | string | null | The public copy of this model in |
models.published_at | string | null | When that public copy was published. |
models.ready_at | string | null | When training finished. |
models.statusrequired | string | One of: |
models.tags[] | string[] | Your tags. |
models.target_names[] | string[] | null | |
models.task | string | null | |
models.unit | string | null | |
models.visibilityrequired | string | One of: |
quota | ModelQuota | null | Your model count and cap; |
quota.limitrequired | integer | Your tier's cap; training a new model past it fails before it starts. |
quota.tierrequired | integer | Your subscription tier. |
quota.usedrequired | integer | Models that count against the cap (training or ready; failed models never count). |
Errors are RFC 7807 problem details (application/problem+json) with status, title, detail, request_id, and a retryability hint (validation, auth, quota, conflict, upstream, timeout, or terminal). Handling errors
| Status | When |
|---|---|
400 | Invalid input or business rule violation. |
401 | Missing or invalid credentials. |
402 | Wallet cannot cover the Assistant turn hold. |
403 | Authenticated but not allowed to access the resource. |
404 | Resource not found or not owned by the user. |
409 | Conflict (e.g. idempotency key reuse with a different body). |
413 | Request body or workflow spec exceeds size caps. |
422 | Request body or query failed validation. |
429 | Rate limit exceeded. |
500 | Unexpected server error. |
503 | Dependency temporarily unavailable. |
Get one of your saved models
GET/api/v1/user-models/{model_id}
API key or token
Get one of your models with its training settings, metrics and history.
Parameters
| Name | Type | Description |
|---|---|---|
model_idrequired | string | Limits: |
Example request
curl "https://api.cognichem.com/api/v1/user-models/mdl-01JABCDEFGHJKMNPQRSTVWXYZ0" \
-H "X-Api-Key: $COGNICHEM_API_KEY"import os
import httpx
response = httpx.get(
"https://api.cognichem.com/api/v1/user-models/mdl-01JABCDEFGHJKMNPQRSTVWXYZ0",
headers={"X-Api-Key": os.environ["COGNICHEM_API_KEY"]},
)
response.raise_for_status()
print(response.json())Uses httpx; the Python SDK has no method for this endpoint.
Responses
Successful Response · application/json · SavedModelDetail
| Field | Type | Description |
|---|---|---|
classes_by_target[] | ((string | integer)[])[] | null | |
config | object | Training settings ( |
created_at | string | null | |
description | string | null | |
edited_at | string | null | Your last edit of name, description or tags. |
failed_at | string | null | When training failed. |
failure_message | string | null | The training job's message when the model failed. |
failure_reason | string | null | |
fold_metrics | map<string, number> | |
framework_versions | object | Library versions the model was trained with. |
history[] | object[] | Per-epoch training curve (downsampled); empty for families without one. |
job_id | string | null | The training job's |
metrics_summary | object | Validation and test metrics; keys depend on the model family. |
model_idrequired | string | |
model_typerequired | string | |
namerequired | string | |
public_model_id | string | null | |
published_at | string | null | |
ready_at | string | null | |
size_bytes | integer | Stored bundle size (0 until ready). Default: |
staterequired | string |
|
statusrequired | string | One of: |
tags[] | string[] | |
target_names[] | string[] | null | |
task | string | null | |
training_job | TrainingJobSummary | null | The training job, while it exists. |
training_job.finished_at | string | null | |
training_job.job_name | string | null | Your job name. |
training_job.process_idrequired | string | Job id for |
training_job.runtime_seconds | number | null | Billed runtime. |
training_job.started_at | string | null | |
training_job.status | string | null | Job status. |
training_job.status_message | string | null | The job's last message (the error when it failed). |
unit | string | null | |
visibilityrequired | string | One of: |
Errors are RFC 7807 problem details (application/problem+json) with status, title, detail, request_id, and a retryability hint (validation, auth, quota, conflict, upstream, timeout, or terminal). Handling errors
| Status | When |
|---|---|
400 | Invalid input or business rule violation. |
401 | Missing or invalid credentials. |
402 | Wallet cannot cover the Assistant turn hold. |
403 | Authenticated but not allowed to access the resource. |
404 | Resource not found or not owned by the user. |
409 | Conflict (e.g. idempotency key reuse with a different body). |
413 | Request body or workflow spec exceeds size caps. |
422 | Request body or query failed validation. |
429 | Rate limit exceeded. |
500 | Unexpected server error. |
503 | Dependency temporarily unavailable. |
Rename, describe or tag one of your saved models
PATCH/api/v1/user-models/{model_id}
API key or token
Change a model's name, description or tags; fields you leave out keep their values.
Inference selects your models by model_type and name, so after a rename pass the new name as model_name. Jobs and workflows that take model_id are unaffected.
Parameters
| Name | Type | Description |
|---|---|---|
model_idrequired | string | Limits: |
Request body
application/json · UpdateSavedModelRequest
| Field | Type | Description |
|---|---|---|
description | string | null | New description; Limits: |
name | string | null | New name, unique among your models of this Limits: |
tags[] | string[] | null | Replacement tags (duplicates ignoring case are dropped); Limits: |
Example request
curl -X PATCH "https://api.cognichem.com/api/v1/user-models/mdl-01JABCDEFGHJKMNPQRSTVWXYZ0" \
-H "X-Api-Key: $COGNICHEM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "aqsoldb-logs-v2"
}'import os
import httpx
response = httpx.patch(
"https://api.cognichem.com/api/v1/user-models/mdl-01JABCDEFGHJKMNPQRSTVWXYZ0",
headers={"X-Api-Key": os.environ["COGNICHEM_API_KEY"]},
json={"name": "aqsoldb-logs-v2"},
)
response.raise_for_status()
print(response.json())Uses httpx; the Python SDK has no method for this endpoint.
Responses
Successful Response · application/json · SavedModelDetail
| Field | Type | Description |
|---|---|---|
classes_by_target[] | ((string | integer)[])[] | null | |
config | object | Training settings ( |
created_at | string | null | |
description | string | null | |
edited_at | string | null | Your last edit of name, description or tags. |
failed_at | string | null | When training failed. |
failure_message | string | null | The training job's message when the model failed. |
failure_reason | string | null | |
fold_metrics | map<string, number> | |
framework_versions | object | Library versions the model was trained with. |
history[] | object[] | Per-epoch training curve (downsampled); empty for families without one. |
job_id | string | null | The training job's |
metrics_summary | object | Validation and test metrics; keys depend on the model family. |
model_idrequired | string | |
model_typerequired | string | |
namerequired | string | |
public_model_id | string | null | |
published_at | string | null | |
ready_at | string | null | |
size_bytes | integer | Stored bundle size (0 until ready). Default: |
staterequired | string |
|
statusrequired | string | One of: |
tags[] | string[] | |
target_names[] | string[] | null | |
task | string | null | |
training_job | TrainingJobSummary | null | The training job, while it exists. |
training_job.finished_at | string | null | |
training_job.job_name | string | null | Your job name. |
training_job.process_idrequired | string | Job id for |
training_job.runtime_seconds | number | null | Billed runtime. |
training_job.started_at | string | null | |
training_job.status | string | null | Job status. |
training_job.status_message | string | null | The job's last message (the error when it failed). |
unit | string | null | |
visibilityrequired | string | One of: |
Errors are RFC 7807 problem details (application/problem+json) with status, title, detail, request_id, and a retryability hint (validation, auth, quota, conflict, upstream, timeout, or terminal). Handling errors
| Status | When |
|---|---|
400 | Invalid input or business rule violation. |
401 | Missing or invalid credentials. |
402 | Wallet cannot cover the Assistant turn hold. |
403 | Authenticated but not allowed to access the resource. |
404 | You have no live model with that id. |
409 | You already have a model of this type by that name. |
413 | Request body or workflow spec exceeds size caps. |
422 | Request body or query failed validation. |
429 | Rate limit exceeded. |
500 | Unexpected server error. |
503 | Dependency temporarily unavailable. |
Delete one of your saved models
DELETE/api/v1/user-models/{model_id}
API key or token
Delete one of your models. Its name and its slot in your model quota are free again at once.
Parameters
| Name | Type | Description |
|---|---|---|
model_idrequired | string | Limits: |
Example request
curl -X DELETE "https://api.cognichem.com/api/v1/user-models/mdl-01JABCDEFGHJKMNPQRSTVWXYZ0" \
-H "X-Api-Key: $COGNICHEM_API_KEY"import os
import httpx
response = httpx.delete(
"https://api.cognichem.com/api/v1/user-models/mdl-01JABCDEFGHJKMNPQRSTVWXYZ0",
headers={"X-Api-Key": os.environ["COGNICHEM_API_KEY"]},
)
response.raise_for_status()
print(response.json())Uses httpx; the Python SDK has no method for this endpoint.
Responses
Successful Response · application/json · MessageResponse
| Field | Type | Description |
|---|---|---|
messagerequired | string | The message content. |
Errors are RFC 7807 problem details (application/problem+json) with status, title, detail, request_id, and a retryability hint (validation, auth, quota, conflict, upstream, timeout, or terminal). Handling errors
| Status | When |
|---|---|
400 | Invalid input or business rule violation. |
401 | Missing or invalid credentials. |
402 | Wallet cannot cover the Assistant turn hold. |
403 | Authenticated but not allowed to access the resource. |
404 | Resource not found or not owned by the user. |
409 | Conflict (e.g. idempotency key reuse with a different body). |
413 | Request body or workflow spec exceeds size caps. |
422 | Request body or query failed validation. |
429 | Rate limit exceeded. |
500 | Unexpected server error. |
503 | Dependency temporarily unavailable. |
Publish one of your models as a public model (administrators)
POST/api/v1/user-models/{model_id}/publish
API key or token
Publish a copy of one of your ready models as a public model that every tier can list in GET /public-models and predict with. Administrators only.
Send dry_run: true (the default) first: it runs every check and reports the size of the copy without writing anything. The public copy is a snapshot under the platform's public-model account with a new model_id; your model stays private, and later edits to it do not change the copy. Your description and tags are not published, so description is required and must carry the attribution the training data's terms require (attribution_confirmed). To replace your public model of the same type and name, pass it as retire_model_id: it stops being listed but keeps running by id.
Parameters
| Name | Type | Description |
|---|---|---|
model_idrequired | string | Limits: |
| Name | Type | Description |
|---|---|---|
Idempotency-Key | string | A unique key (a UUID) for this request. Retrying with the same key and body returns the first result instead of repeating the work; the same key with a different body is a 409. |
Request body
application/json · PublishModelRequest
| Field | Type | Description |
|---|---|---|
attribution_confirmed | boolean | You confirm the description carries the attribution the training data's terms require. Required to publish (not for a dry run). Default: |
descriptionrequired | string | Public description. Required: your private description and tags are never published. Cite the training data's source and licence. Limits: |
dry_run | boolean | Check and preview only (default); nothing is written. Default: |
public_namerequired | string | Name in Limits: |
retire_model_id | string | null | Your listed public model of the same type and name to replace in the same step. It leaves Limits: |
Example request
curl -X POST "https://api.cognichem.com/api/v1/user-models/mdl-01JABCDEFGHJKMNPQRSTVWXYZ0/publish" \
-H "X-Api-Key: $COGNICHEM_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"description": "Chemprop MPNN on TDC Caco2_Wang (CC BY 4.0).",
"dry_run": true,
"public_name": "Caco-2 permeability (TDC)"
}'import os
import uuid
import httpx
response = httpx.post(
"https://api.cognichem.com/api/v1/user-models/mdl-01JABCDEFGHJKMNPQRSTVWXYZ0/publish",
headers={"X-Api-Key": os.environ["COGNICHEM_API_KEY"], "Idempotency-Key": str(uuid.uuid4())},
json={
"description": "Chemprop MPNN on TDC Caco2_Wang (CC BY 4.0).",
"dry_run": True,
"public_name": "Caco-2 permeability (TDC)",
},
)
response.raise_for_status()
print(response.json())Uses httpx; the Python SDK has no method for this endpoint.
Responses
Successful Response · application/json · PublishModelResponse
| Field | Type | Description |
|---|---|---|
dry_runrequired | boolean | Whether this was only a preview. |
model_typerequired | string | Its type, which the public copy keeps. |
public_model_id | string | null | The new public model; |
public_namerequired | string | The public name. |
retired_model_id | string | null | The public model this one replaced, if any. |
size_bytesrequired | integer | Size of the public copy. |
source_model_idrequired | string | Your model. |
Errors are RFC 7807 problem details (application/problem+json) with status, title, detail, request_id, and a retryability hint (validation, auth, quota, conflict, upstream, timeout, or terminal). Handling errors
| Status | When |
|---|---|
400 | Invalid input or business rule violation. |
401 | Missing or invalid credentials. |
402 | Wallet cannot cover the Assistant turn hold. |
403 | Only administrators can publish their own models. Needs a signed-in session with two-step sign-in ( |
404 | You have no live model with that id. |
409 | The publish was refused: the model is not ready, has no model card, or the public name is taken; or the Idempotency-Key is in use. |
413 | Request body or workflow spec exceeds size caps. |
422 | Request body or query failed validation. |
429 | Rate limit exceeded. |
500 | Unexpected server error. |
503 | Publishing from the app is not configured. |
504 | The outcome is unknown; check GET /public-models. |