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

# Step Environment

> 在环境中执行工具调用步骤（支持流式和非流式）



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/agentlin/openapi.documented.yml post /env/step
openapi: 3.1.0
info:
  title: Agentlin API
  description: >-
    The Agentlin REST API. Please see https://linxueyuan.online/agentlin/ for
    more details.
  version: 2.3.0
  termsOfService: https://linxueyuan.online/policies/terms-of-use
  contact:
    name: Agentlin Support
    url: https://help.linxueyuan.online/
  license:
    name: MIT
    url: https://github.com/LinXueyuanStdio/agentlin/blob/master/LICENSE
servers:
  - url: https://api.linxueyuan.online/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Tasks
    description: Create, retrieve, and cancel agent tasks.
  - name: Environment
    description: Interact with remote environments.
paths:
  /env/step:
    post:
      tags:
        - Environment
      summary: Step Environment
      description: 在环境中执行工具调用步骤（支持流式和非流式）
      operationId: step_environment_v1_env_step_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvStepRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Client from 'agentlin_client';


            const client = new Client({
              apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
            });


            const response = await client.env.step({ session_id: 'session_id',
            tool_name: 'tool_name' });


            console.log(response);
        - lang: Python
          source: |-
            import os
            from agentlin_client import Client

            client = Client(
                api_key=os.environ.get("AGENTLIN_API_KEY"),  # This is the default and can be omitted
            )
            response = client.env.step(
                session_id="session_id",
                tool_name="tool_name",
            )
            print(response)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/LinXueyuanStdio/agentlin-client-go\"\n\t\"github.com/LinXueyuanStdio/agentlin-client-go/option\"\n)\n\nfunc main() {\n\tclient := agentlin.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Env.Step(context.TODO(), agentlin.EnvStepParams{\n\t\tSessionID: \"session_id\",\n\t\tToolName:  \"tool_name\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}\n"
components:
  schemas:
    EnvStepRequest:
      properties:
        session_id:
          type: string
          title: Session Id
        tool_name:
          type: string
          title: Tool Name
        tool_args:
          additionalProperties: true
          type: object
          title: Tool Args
        env_vars:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Env Vars
        stream:
          type: boolean
          title: Stream
          default: false
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
      type: object
      required:
        - session_id
        - tool_name
      title: EnvStepRequest
      description: 执行步骤请求（工具调用）
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````