> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anonalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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}`.




## OpenAPI

````yaml /compute/api-reference/anona-openapi.yaml put /v1/network
openapi: 3.0.3
info:
  title: Anona Compute API (Anona routes)
  version: 0.1.0
  description: >
    Routes the Anona Compute gateway serves next to the E2B-compatible API:

    live-view viewer tokens, SSH certificates, network policy, the credential

    vault, usage and billing, webhooks and telemetry export, thumbnails, preview
    links,

    public ports, pause when idle, template builds, and API key management.


    Written from the gateway handlers
    (`gateway/internal/stream/token/handlers.go`,

    `gateway/internal/sshca/handler.go`,
    `gateway/internal/handlers/apikeys/apikeys.go`)

    and checked against a running gateway by
    `docs-site/scripts/verify_openapi.py`.
servers:
  - url: https://api.compute.anonalabs.com
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Live view
  - name: SSH
  - name: Sandbox access
  - name: Templates
  - name: Network
  - name: Credential vault
  - name: Usage and billing
  - name: Webhooks and telemetry
  - name: API keys
  - name: Service
paths:
  /v1/network:
    put:
      tags:
        - Network
      summary: Set team egress settings
      description: |
        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}`.
      operationId: putTeamNetwork
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NetworkSpec'
            example:
              allow_internet_access: false
              allowOut:
                - pypi.org
                - files.pythonhosted.org
      responses:
        '200':
          description: Stored and compiled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    NetworkSpec:
      type: object
      description: An egress policy in the E2B wire shape. Unknown keys are refused.
      properties:
        allow_internet_access:
          type: boolean
        allowOut:
          type: array
          items:
            type: string
          description: IPs, CIDRs or host names to allow
        denyOut:
          type: array
          items:
            type: string
          description: IPv4 addresses or CIDRs to block; 0.0.0.0/0 blocks all public egress
        dnsServers:
          type: array
          items:
            type: string
        rules:
          type: object
          description: >-
            Per-host header transforms: {host: [{transform: {headers: {Name:
            "Bearer ${vault.name}"}}}]}
          additionalProperties:
            type: array
            items:
              type: object
        allowPublicTraffic:
          type: boolean
    PolicyResult:
      type: object
      required:
        - scope
        - scopeID
        - revision
      properties:
        scope:
          type: string
          enum:
            - tenant_default
            - template
            - sandbox
            - tenant_ceiling
        scopeID:
          type: string
        revision:
          type: integer
        compiled:
          $ref: '#/components/schemas/CompiledPolicy'
        warnings:
          type: array
          items:
            type: string
    CompiledPolicy:
      type: object
      description: The policy as the engine enforces it.
      properties:
        allow_internet_access:
          type: boolean
        allowOut:
          type: array
          items:
            type: string
          nullable: true
        denyOut:
          type: array
          items:
            type: string
          nullable: true
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: The HTTP status code.
        message:
          type: string
        error_code:
          type: string
          description: >-
            Machine-readable reason, on some errors (for example
            `invalid_request`).
  responses:
    BadRequest:
      description: The request body is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: No valid API key or session.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The key's scopes or the caller's role do not allow this.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: An Anona Compute API key (`e2b_` followed by lowercase hex).
    BearerAuth:
      type: http
      scheme: bearer
      description: 'The same API key, sent as `Authorization: Bearer e2b_...`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.