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

# Retrieve Event AI Assistance

> Return an AI-generated explanation of an event, written for a `technical` or `general` audience, wrapped in an `activity_ai_assistance` object. Explanations are cached per tenant, event and audience; generating a new one is limited by a weekly quota per organization and returns 429 `AI_ASSISTANCE_RATELIMIT` once it is exceeded. Returns 400 `UNSUPPORTED_ACTIVITY_TYPE` for event types the assistant does not support, 400 `CHAT_COMPLETION_ERROR` when no explanation could be generated and 404 when the event is not found.

&#x20;Required API key permission: **Read All**


## OpenAPI

````yaml firework-v2-openapi get /firework/v2/activities/{index}/{source}/{id}/ai_assistance
openapi: 3.0.1
info:
  description: >

    Manage and access Firework resources.


    Requests are authenticated with API tokens, which are obtained using an API
    key:


    1. Generate an API key from the [Profile
    page](https://app.flare.io/#/profile).

    2. Send a `POST` request to `https://api.flare.io/tokens/generate` with the
    `Authorization: <api-key>` header to get an API token. API tokens expire
    after 1 hour.

    3. Call the API endpoints with the `Authorization: Bearer <api-token>`
    header.


    See [Authentication](https://api.docs.flare.io/concepts/authentication) for
    details.
  title: Firework API
  version: v2
servers:
  - url: https://api.flare.io/
security:
  - BearerAuth: []
tags:
  - description: >-
      The authenticated user, its API keys, organizations, tenants, onboarding
      and usage.
    name: Account
  - description: >-
      Events collected by Flare: global search, tenant and identifier feeds,
      event details, actions and saved feed views.
    name: Events
  - description: >-
      Identifiers are the assets a tenant monitors, such as domains, keywords
      and email addresses. Includes recommendations and authorization of
      sensitive identifiers.
    name: Identifiers
  - description: Report groups, reports, their sections, schedules and delivery channels.
    name: Reports
paths:
  /firework/v2/activities/{index}/{source}/{id}/ai_assistance:
    get:
      tags:
        - Events
      summary: Explain an event with AI
      description: >-
        Return an AI-generated explanation of an event, written for a
        `technical` or `general` audience, wrapped in an
        `activity_ai_assistance` object. Explanations are cached per tenant,
        event and audience; generating a new one is limited by a weekly quota
        per organization and returns 429 `AI_ASSISTANCE_RATELIMIT` once it is
        exceeded. Returns 400 `UNSUPPORTED_ACTIVITY_TYPE` for event types the
        assistant does not support, 400 `CHAT_COMPLETION_ERROR` when no
        explanation could be generated and 404 when the event is not found.
      operationId: get_activity_assistance_resource
      parameters:
        - description: >-
            First part of the event uid: the event type (for example
            `forum_post`).
          in: path
          name: index
          required: true
          schema:
            type: string
        - description: 'Second part of the event uid: the identifier of the source.'
          in: path
          name: source
          required: true
          schema:
            type: string
        - description: >-
            Last part of the event uid: the identifier of the event within its
            source; it may contain slashes.
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: >-
            Audience the explanation is written for: `technical` (default) or
            `general`.
          in: query
          name: audience
          schema:
            default: technical
            enum:
              - technical
              - general
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/get_activity_assistance_resource_200_response
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: >-
            The event type is not supported by the assistant
            (`UNSUPPORTED_ACTIVITY_TYPE`), no explanation could be generated
            (`CHAT_COMPLETION_ERROR`) or the event cannot be loaded.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: Event not found.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: >-
            The weekly AI assistance quota of the organization is exceeded
            (`AI_ASSISTANCE_RATELIMIT`).
components:
  schemas:
    get_activity_assistance_resource_200_response:
      properties:
        activity_ai_assistance:
          $ref: '#/components/schemas/ActivityAiAssistance'
      type: object
    HttpError:
      properties:
        message:
          description: Human-readable description of the error.
          type: string
        code:
          description: Machine-readable error code.
          type: string
      type: object
    ActivityAiAssistance:
      properties:
        uid:
          description: Uid of the explained event.
          type: string
        prompt:
          description: Question asked to the AI assistant about the event.
          type: string
        response:
          description: Explanation generated by the AI assistant.
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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