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

# Express Agent (Beta)

## Description

This endpoint answers the user's query with an LLM using web results (max 1 web search) to ground the answer. Use it for answering simple questions that involve a web search that require a low latency agent.


## OpenAPI

````yaml openapi_agents 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 'express'.
                  default: express
                input:
                  type: string
                  description: The input for the agent. This can be a query or a prompt.
                  example: What is the capital of France?
                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).
                  type: boolean
                  default: false
                tools:
                  type: array
                  description: >-
                    Add tools the system can call to expand its capabilities,
                    providing more precise answers to the input query. Currently
                    supports only the Web Search tool.  See [Web Search
                    Tool](/tools/web-search-tool) for more details.
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        example: web_search
            example:
              agent: express
              input: What is the capital of France?
      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: web_search.results, message.answer
                        text:
                          type: string
                          description: The text of the output.
                          example: The capital of France is Paris.
                        content:
                          type: object
                          description: Returns the exact search query.
                          example: What is the capital of France?
                        agent:
                          type: string
                          description: The agent used to generate the response.
                          default: express
            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, message.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.
                            example: pital of France
                          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).

````