AmpLabs

API Documentation

Integrate AmpLabs into your workflow with the CLI, Python SDK, REST API, or MCP server for AI agents.

CLI

Install the amplabs-playground package and use the amplabs command to run simulations, generate LUTs, and manage simulation tokens from your terminal.

bash
pip install "amplabs-playground[cli]"

amplabs login
amplabs simulate --cell LG_M50T --rate 1C --duration 1h
amplabs batch --sweep "temperature 0,25,45" --cell LG_M50T
amplabs lut --tables ocv_soc,dcir --cell LG_M50T
amplabs credits
amplabs cells

Python SDK

Use the Python client for programmatic access. Pass your personal access token when creating the client.

python
# pip install amplabs-playground
from amplabs import AmpLabs

client = AmpLabs(token="pat_xxx")
result = client.simulate(cell="LG_M50T", current=-5, duration=3600)
print(f"Final voltage: {result.voltage[-1]:.3f} V")

REST API

All functionality is available via the REST API. Authenticate with a Bearer token in the Authorization header.

bash
# Base URL
https://api.hub.amplabs.ai

# Authentication
curl -H "Authorization: Bearer pat_xxx" \
  https://api.hub.amplabs.ai/api/v1/credits/balance
MethodEndpointDescription
POST/api/v1/spme/simulateRun a single SPMe simulation
POST/api/v1/spme/batchRun a batch simulation sweep
POST/api/v1/lut/generateGenerate look-up tables (OCV, DCIR, etc.)
GET/api/v1/profilesList available cell profiles
GET/api/v1/credits/balanceCheck your simulation token balance

See the full Swagger documentation for request/response schemas and all available endpoints.

MCP Server

Connect AI agents to AmpLabs through the Model Context Protocol. The server is hosted at https://api.hub.amplabs.ai/mcp (streamable HTTP), so there is nothing to install. In Claude Code:

bash
claude mcp add --transport http batterylab https://api.hub.amplabs.ai/mcp

Other MCP clients: add a remote (HTTP) server with the same URL. Tools that read or change your account take your personal access token as auth_token.