Environments
Create an environment
Create an API-managed environment.
TypeScript SDKThe npm client, generated from the API spec.Python SDKThe PyPI client, sync and async.
| Method | Path | Required permissions |
|---|---|---|
| POST | /v1/environments | write:environments |
Token access
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Unavailable. Not supported by sandbox tokens, even with permissions.ellipsis enabled.
Higher permission levels include lower levels: read < write < delete.
Sessions can reference its name or ID.
curl -X POST "https://api.ellipsis.dev/v1/environments" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"environment": {
"ellipsis": {
"kind": "environment",
"name": "api-environment",
"metadata": {
"labels": [],
"annotations": {}
}
},
"repositories": [
{
"name": "api-repo"
}
],
"compute": {},
"hooks": {},
"mcp_servers": [],
"variables": []
}
}'import os
from ellipsis import Ellipsis
from ellipsis import models
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
request = models.CreateEnvironmentRequest.model_validate(
{
"environment": {
"ellipsis": {
"kind": "environment",
"name": "api-environment",
"metadata": {
"labels": [],
"annotations": {}
}
},
"repositories": [
{
"name": "api-repo"
}
],
"compute": {},
"hooks": {},
"mcp_servers": [],
"variables": []
}
}
)
result = client.environments.create(request.environment)
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const request: Parameters<typeof client.environments.create>[0] = {
"environment": {
"ellipsis": {
"kind": "environment",
"name": "api-environment",
"metadata": {
"labels": [],
"annotations": {}
}
},
"repositories": [
{
"name": "api-repo"
}
],
"compute": {},
"hooks": {},
"mcp_servers": [],
"variables": []
}
};
const result = await client.environments.create(request);
console.log(result);Request
Example request body
{
}
Body parameters
environmentEnvironmentDocument-Inputrequired
The environment's definition.
Response
Example response, 201
{
}