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

# Advanced Agent (Beta)

## Description

This endpoint engages advanced agents that use tools, multi-turn reasoning, and planning to solve complex queries. The agents break down each query into a workflow, execute the steps iteratively, and reflect on the findings before generating a final response.


## OpenAPI

````yaml openapi_agents_advanced POST /v1/agents/runs
openapi: 3.1.0
info:
  title: Streaming
  description: Streaming service for You.com
  version: 0.1.0
servers:
  - url: https://api.you.com
security:
  - bearerAuth: []
paths:
  /v1/agents/runs:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agent
                - input
              properties:
                agent:
                  type: string
                  description: >-
                    The agent mode that will be used to execute your request.
                    This parameter must be set as 'advanced'.
                  default: advanced
                input:
                  type: string
                  description: The input for the agent. This can be a query or a prompt.
                  example: >-
                    You are a biologist studying the impacts of microplastics.
                    Explain what microplastics are to a group of engineers,
                    explain the impacts of microplastics on the body, and what
                    the common source and dosage of microplastics are.
                    High-light what a safe dosage might be and how to achieve it
                stream:
                  description: >-
                    When set to "true", it will enable SSE (server side events)
                    response. This is useful if you want to stream the response
                    to your applications (e.g., with chatbots). Currently, only
                    "true" is supported.
                  type: boolean
                  default: true
                tools:
                  type: array
                  description: >-
                    Add tools the system can call to expand its capabilities,
                    providing more precise answers to the input query. See
                    [Research Tool](/tools/research-tool) and [Compute
                    Tool](/tools/compute-tool) for more details.
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - research
                          - compute
                verbosity:
                  description: >-
                    Controls the level of detail provided by the agent's
                    response. Choosing `high` maps to a long-form report while
                    `medium` maps to a medium verbosity report that captures
                    most details but less comprehensive
                  type: string
                  enum:
                    - medium
                    - high
                  default: medium
                workflow_config:
                  description: >-
                    Manages the parameters that control how the agent
                    orchestrates and executes the workflow to answer your query.
                    Adjust its settings to balance between response quality,
                    thoroughness, and speed.
                  type: object
                  properties:
                    max_workflow_steps:
                      description: >-
                        Defines the maximum number of steps the agent uses in
                        its workflow plan to answer your query. Higher values
                        allow for more tool calls, but it takes longer for the
                        agent to provide the response. For instance, setting
                        `max_workflow_steps=5` could allow the agent to call the
                        research tool 3 times and the compute tool 2 times.
                      type: integer
                      minimum: 1
                      maximum: 20
                      default: 10
            example:
              agent: advanced
              input: >-
                You are a biologist studying the impacts of microplastics.
                Explain what microplastics are to a group of engineers, explain
                the impacts of microplastics on the body, and what the common
                source and dosage of microplastics are. High-light what a safe
                dosage might be and how to achieve it
      responses:
        '200':
          description: Inference response in application/json or text/event-stream format.
          content:
            application/json:
              schema:
                type: object
                properties:
                  output:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The type of the output.
                          example: chat_node.answer
                        text:
                          type: string
                          description: The text of the output.
                          example: >-
                            What Engineers Need to Know. **Key Takeaway:**  
                            Microplastics are tiny plastic particles that are
                            pervasive in the environment and can enter the human
                            body through various [...]
                        content:
                          type: object
                          description: Returns the exact search query.
                          example: >-
                            You are a biologist studying the impacts of
                            microplastics. Explain what microplastics are to a
                            group of engineers, explain the impacts of
                            microplastics on the body, and what the common
                            source and dosage of microplastics are. High-light
                            what a safe dosage might be and how to achieve it
                        agent:
                          type: string
                          description: The agent used to generate the response.
                          default: advanced
            text/event-stream:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: Sequence number of the SSE event, starts from 0.
                    example: 0
                  event:
                    type: string
                    description: The type of the SSE event.
                    example: response.output_item.added
                  data:
                    type: object
                    properties:
                      seq_id:
                        type: integer
                        description: >-
                          Sequence number of the SSE event, starts from 0. Same
                          as `id` field.
                        example: 0
                      type:
                        type: string
                        description: The type of the SSE event. Same as `event` field.
                        example: response.output_item.added
                      response:
                        type: object
                        properties:
                          type:
                            type: string
                            description: The type of the response.
                            example: web_search.results, chat_node.answer
                          output_index:
                            type: integer
                            description: The index of the output in the response.
                            example: 0
                          delta:
                            type: string
                            description: The delta of the response.
                          full:
                            type: object
                            description: The full response object of the output item.
        '400':
          description: Bad Request. Invalid or malformed request body/parameters.
          content:
            application/json:
              schema:
                type: object
                required:
                  - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      required:
                        - status
                        - code
                        - title
                        - detail
                      properties:
                        status:
                          type: string
                          example: '400'
                        code:
                          type: string
                          example: bad_request
                        title:
                          type: string
                          example: Invalid request body
                        detail:
                          type: string
                          example: The field 'tools' must be an array of objects.
              example:
                errors:
                  - status: '400'
                    code: bad_request
                    title: Invalid request body
                    detail: The field 'tools' must be an array of objects.
        '401':
          description: Unauthorized. Problems with API key.
          content:
            application/json:
              schema:
                type: object
                required:
                  - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      required:
                        - status
                        - code
                        - title
                        - detail
                      properties:
                        status:
                          type: string
                          example: '401'
                        code:
                          type: string
                          example: unauthorized
                        title:
                          type: string
                          example: Unauthorized
                        detail:
                          type: string
                          example: >-
                            Missing or invalid Authorization header. Use
                            'Authorization: Bearer <API_KEY>'.
              example:
                errors:
                  - status: '401'
                    code: unauthorized
                    title: Unauthorized
                    detail: >-
                      Missing or invalid Authorization header. Use
                      'Authorization: Bearer <API_KEY>'.
        '403':
          description: Forbidden. API key lacks scope for this path.
          content:
            application/json:
              schema:
                type: object
                required:
                  - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      required:
                        - status
                        - code
                        - title
                        - detail
                      properties:
                        status:
                          type: string
                          example: '403'
                        code:
                          type: string
                          example: tool_not_allowed
                        title:
                          type: string
                          example: Tool not allowed
                        detail:
                          type: string
                          example: >-
                            You are not allowed to use the requested tool for
                            this agent or tenant.
              example:
                errors:
                  - status: '403'
                    code: tool_not_allowed
                    title: Tool not allowed
                    detail: >-
                      You are not allowed to use the requested tool for this
                      agent or tenant.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        The unique API Key required to authorize API access. Learn how to get
        yours in the [“Get your API key” section of the
        documentation](/get-started/quickstart#get-your-api-key).

````