Skip to main content
Upload a custom PyBaMM model JSON file
curl --request POST \
  --url https://api.ionworks.com/models/upload-custom \
  --header 'Content-Type: multipart/form-data' \
  --form 'name=<string>' \
  --form 'file=<string>' \
  --form 'description=<string>' \
  --form chemistry=lithium_ion
{
  "name": "<string>",
  "id": "<string>",
  "user_id": "<string>",
  "organization_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "is_custom_model": true,
  "description": "<string>",
  "pybamm_version": "<string>",
  "chemistry": "lithium_ion",
  "created_by_email": "<string>"
}

Body

multipart/form-data
name
string
required

Name for the custom model

file
string
required

PyBaMM serialized model JSON file

description
string | null

Optional description

chemistry
string
default:lithium_ion

Model chemistry kind (lithium_ion, lithium_sulfur, ecm, generic). Defaults to lithium_ion.

Response

Successful Response

Model representing a model as returned by the API (without config).

name
string
required

The name of the model.

id
string
required

The unique identifier for the model.

user_id
string
required

The ID of the user who created the model.

organization_id
string
required

The ID of the organization this model belongs to.

created_at
string<date-time>
required

Timestamp of when the model was created.

updated_at
string<date-time>
required

Timestamp of when the model was last updated.

is_custom_model
boolean
required
read-only

Check if this is a custom model (has compressed model data).

description
string | null

An optional description for the model.

pybamm_version
string | null

PyBaMM version used for this model. If not provided, will be read from pybamm.version.

chemistry
enum<string>
default:lithium_ion

Model chemistry kind: 'lithium_ion' (default — assumes pybamm lithium-ion conventions), 'lithium_sulfur', 'ecm', or 'generic' (no chemistry-specific enrichment).

Available options:
lithium_ion,
lithium_sulfur,
ecm,
generic
created_by_email
string | null

Email of the user who created the model.