Set team egress settings
curl --request PUT \
--url https://api.compute.anonalabs.com/v1/network \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"allow_internet_access": false,
"allowOut": [
"pypi.org",
"files.pythonhosted.org"
]
}
'import requests
url = "https://api.compute.anonalabs.com/v1/network"
payload = {
"allow_internet_access": False,
"allowOut": ["pypi.org", "files.pythonhosted.org"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({allow_internet_access: false, allowOut: ['pypi.org', 'files.pythonhosted.org']})
};
fetch('https://api.compute.anonalabs.com/v1/network', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"scope": "tenant_default",
"scopeID": "<string>",
"revision": 123,
"compiled": {
"allow_internet_access": true,
"allowOut": [
"<string>"
],
"denyOut": [
"<string>"
]
},
"warnings": [
"<string>"
]
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Network
Set team egress settings
Replaces the team egress settings. The body is a network policy in the
E2B shape (the fields of a create’s network object, plus
allow_internet_access). Owners and admins, or API keys without scope
or sandbox limits. Header values in rules may only be vault
placeholders such as Bearer ${vault.openai_key}.
PUT
/
v1
/
network
Set team egress settings
curl --request PUT \
--url https://api.compute.anonalabs.com/v1/network \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"allow_internet_access": false,
"allowOut": [
"pypi.org",
"files.pythonhosted.org"
]
}
'import requests
url = "https://api.compute.anonalabs.com/v1/network"
payload = {
"allow_internet_access": False,
"allowOut": ["pypi.org", "files.pythonhosted.org"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({allow_internet_access: false, allowOut: ['pypi.org', 'files.pythonhosted.org']})
};
fetch('https://api.compute.anonalabs.com/v1/network', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"scope": "tenant_default",
"scopeID": "<string>",
"revision": 123,
"compiled": {
"allow_internet_access": true,
"allowOut": [
"<string>"
],
"denyOut": [
"<string>"
]
},
"warnings": [
"<string>"
]
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Authorizations
ApiKeyAuthBearerAuth
An Anona Compute API key (e2b_ followed by lowercase hex).
Body
application/json
An egress policy in the E2B wire shape. Unknown keys are refused.
IPs, CIDRs or host names to allow
IPv4 addresses or CIDRs to block; 0.0.0.0/0 blocks all public egress
Per-host header transforms: {host: [{transform: {headers: {Name: "Bearer ${vault.name}"}}}]}
Show child attributes
Show child attributes