๐งฐ Getting Started
1. Obtain API Key
GET https://api.lenia.com/v1/auth
Navigate to support to generate your API authentication token.
2. Test the API
GET https://api.lenia.com/simulations
All API methods support CORS and rate-limiting unauthenticated requests.
๐งช API Endpoints
GET /simulations
Fetches an array of recent simulation metadata. Requires API key in Authorization
header.
GET /simulations
Authorization: Bearer <apiKey>
{ "simulations": [ { "id": "sim-5f43782f7d", "name": "Pattern Formation", "author": "mike", "url": "https://api.lenia.com/simulations/5f43782f7d", "created": "2025-09-25T10:30:45Z" } ] }
POST /simulations
Creates a new simulation. Requires API key in Authorization
header. Accepts application/json
payload.
POST /simulations
Content-Type: application/json
Authorization: Bearer <apiKey>
{
"name": "My Simulation",
"settings": {
"width": 100,
"height": 100,
"diffusion": 2.0
}
}
{ "id": "sim-5f44d11a2c", "url": "https://api.lenia.com/simulations/5f44d11a2c" }
GET /simulations/{id}
Fetch a specific simulations data. Returns binary pixel array if requested as application/octet-stream
, JSON summary if requested as JSON.
GET /simulations/5f43782f7d
Authorization: Bearer <apiKey>
{ "id": "sim-5f43782f7d", "name": "Pattern Formation", "data": "base64binary...", "created": "2025-09-25T10:30:45Z" }
๐ Authentication
All API calls require authentication using a bearer token. Visit the support page to generate your API key.
Request Headers
Authorization: Bearer <your-api-key>
Content-Type: application/json
Example Response
{
"error": null,
"data": {"id": "sim-...", ...},
"meta": {"status": "success", "time": "2025-09-29T08:45:00Z"}
}