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

# Get an environment



## OpenAPI

````yaml /openapi.json get /v1/environments/{id}
openapi: 3.1.0
info:
  title: testworld API
  version: 1.0.0
  description: >-
    Start a run on a simulated workplace, point your agent at its tools, and
    read back the trace and the evaluation. The hosted API opens with early
    access.
  x-fingerprint: d223e1b42e3f0279
servers:
  - url: https://api.testworld.dev
    description: Hosted, opens with early access
security:
  - bearer: []
paths:
  /v1/environments/{id}:
    get:
      tags:
        - Environments
      summary: Get an environment
      operationId: getEnvironment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: An environment id or slug.
      responses:
        '200':
          description: The environment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment'
        '401':
          description: No key, or a wrong one.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such environment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Environment:
      type: object
      description: >-
        A set of simulated tools seeded with data. Every run starts from the
        same saved state.
      properties:
        id:
          type: string
          description: Opaque id, starts with env_.
        slug:
          type: string
          description: Accepted wherever an environment id is.
        name:
          type: string
        description:
          type: string
        version:
          type: object
          properties:
            id:
              type: string
              description: Opaque id, starts with ver_.
            number:
              type: integer
              minimum: 1
            created_at:
              type: string
              format: date-time
        tools:
          type: array
          items:
            type: object
            properties:
              provider:
                type: string
              surface:
                type: string
              path:
                type: string
                description: The suffix under a run's tools_url.
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/Task'
        seed_digest:
          type: string
          description: >-
            sha256: and the digest of the start state. Equal digests mean equal
            starting data.
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - unauthorized
                - not_found
                - run_ended
                - idempotency_conflict
                - rate_limited
              description: Stable. Use it in code.
            message:
              type: string
              description: For people. It can change.
    Task:
      type: object
      properties:
        id:
          type: string
          description: Opaque id, starts with task_.
        title:
          type: string
        instructions:
          type: string
          description: What the agent is told.
        checks:
          type: array
          items:
            $ref: '#/components/schemas/Check'
    Check:
      type: object
      required:
        - kind
      description: >-
        One assertion a run is scored on. See Checks for the fields each kind
        needs.
      properties:
        id:
          type: string
          description: Assigned by the API for custom checks.
        kind:
          type: string
          enum:
            - record_exists
            - record_absent
            - field_equals
            - field_contains
            - write_count
            - no_writes
            - action_called
            - action_not_called
            - output_contains
            - output_equals
            - rubric
        description:
          type: string
        source:
          type: string
          enum:
            - template
            - custom
        collection:
          type: string
        field:
          type: string
        value: {}
        where:
          type: object
        action:
          type: string
        min:
          type: integer
          minimum: 0
        max:
          type: integer
          minimum: 0
        text:
          type: string
          description: The question a model judge answers, for kind rubric.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: Your API key. Tool calls under tools_url use the run token instead.

````

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