Templates
Create a template
Authorization
BearerAuth AuthorizationBearer <token>
API key (csk_live_…)
In: header
Request Body
application/json
slug*string
Unique template identifier (lowercase, hyphens allowed)
Match
^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$Length
1 <= length <= 64name*string
Human-readable template name
Length
1 <= length <= 100description?string
Template description
Length
length <= 500baseImage*string
Base Docker image
Value in
"node-22" | "python-3.12"envVars?
Environment variables (KEY=value pairs)
guardrails?
Default guardrails for runs using this template
egressDomains?array<>
Allowed egress domains for network access
Items
items <= 20Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.cospec.io/v1/templates" \ -H "Content-Type: application/json" \ -d '{ "slug": "string", "name": "string", "baseImage": "node-22" }'{
"template": {
"id": "string",
"slug": "string",
"name": "string",
"description": "string",
"baseImage": "node-22",
"envVars": {
"property1": "string",
"property2": "string"
},
"guardrails": {
"maxTurns": 0,
"maxCostUsd": 0,
"timeoutMinutes": 0
},
"egressDomains": [
"string"
],
"isSystem": true,
"createdBy": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"requestId": "string"
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"requestId": "string"
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"requestId": "string"
}