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

# Answer

> The `/answer` endpoint leverages Vizlook search results and an LLM to provide answers, offering direct responses for specific queries and detailed, cited summaries for open-ended questions.<br /><br />Each response includes both the LLM's answer and the sources utilized. Furthermore, the endpoint supports streaming (by setting `stream` true), delivering tokens as they are generated.

<Card horizontal="true" arrow="true" title="Get Your Vizlook API Key" icon="key" href="https://www.vizlook.com/dashboard/api-keys">Sign up and receive \$10 free credit.</Card>


## OpenAPI

````yaml POST /answer
openapi: 3.1.0
info:
  title: Vizlook API
  description: The Vizlook OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.vizlook.com
security:
  - apiKeyAuth: []
paths:
  /answer:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnswerRequestBody'
        required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnswerResponse'
      x-codeSamples:
        - lang: bash
          source: |-
            curl -X POST 'https://api.vizlook.com/answer' \
              -H 'x-api-key: YOUR_VIZLOOK_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                "query": "What is ChatGPT?",
                "contentOptions": {
                  "includeTranscription": true
                }
              }'
        - lang: python
          source: |-
            # pip install vizlook
            from vizlook import Vizlook

            vizlook = Vizlook(api_key="YOUR_VIZLOOK_API_KEY")

            response = vizlook.answer(
                "What is ChatGPT?",
                include_transcription=True,
            )

            print("response with original API field name: ")
            print(response.to_dict())

            print("response with snake case field name: ")
            print(response.to_dict(use_api_field_name=False))

            print("get field value with snake case key from pydantic model: ")
            print(response.answer)
        - lang: javascript
          source: |-
            // npm install @vizlook/sdk
            import Vizlook from "@vizlook/sdk";

            const vizlook = new Vizlook({
              apiKey: "YOUR_VIZLOOK_API_KEY",
            });

            const response = await vizlook.answer("What is ChatGPT?", {
              includeTranscription: true,
            });
            console.log("Answer:", response.answer);
            console.log("Citations:", response.citations);
components:
  schemas:
    AnswerRequestBody:
      required:
        - query
      type: object
      properties:
        query:
          description: The query to answer.
          type: string
          example: What is ChatGPT?
        stream:
          description: >-
            Enable streaming mode. If true, the response is returned as a
            server-sent events (SSE) stream.
          type: boolean
          example: true
        contentOptions:
          description: Configure what answer citations include.
          type: object
          properties:
            includeTranscription:
              description: Whether to include video transcription in the answer citations.
              type: boolean
              example: true
    AnswerResponse:
      type: object
      properties:
        answer:
          description: >-
            The generated answer based on search results. if no search results,
            return empty string `""`.
          type: string
          example: >-
            ChatGPT is an artificial intelligence (AI) chatbot developed by
            OpenAI and released in 2022. It is a generative AI tool that allows
            users to interact with it in a way that simulates natural
            conversation, responding to questions and requests.
        citations:
          description: Search results used to generate the answer.
          type: array
          items:
            $ref: '#/components/schemas/AnswerCitationItem'
        dollarCost:
          description: Dollar cost of the request.
          type: object
          properties:
            total:
              description: Total dollar cost for your request.
              type: number
              example: 0.01
      example:
        answer: >-
          ChatGPT is an artificial intelligence (AI) chatbot developed by OpenAI
          and released in 2022. It is a generative AI tool that allows users to
          interact with it in a way that simulates natural conversation,
          responding to questions and requests.
        citations:
          - url: https://www.youtube.com/watch?v=j5vQ6oXSZpU
            title: What makes OpenAI's new GPT-5 different from past versions?
            description: >-
              OpenAI on Thursday launched GPT-5, the latest generation of the
              artificial intelligence technology that powers ChatGPT. OpenAI
              said the new model is faster and smarter than ever before.
              Technology journalist Jacob Ward joins CBS News to discuss the
              release.


              CBS News 24/7 is the premier anchored streaming news service from
              CBS News and Stations that is available free to everyone with
              access to the internet and is the destination for breaking news,
              live events, original reporting and storytelling, and programs
              from CBS News and Stations' top anchors and correspondents working
              locally, nationally and around the globe. It is available on more
              than 30 platforms across mobile, desktop and connected TVs for
              free, as well as CBSNews.com and Paramount+ and live in 91
              countries.
            thumbnail:
              url: https://i.ytimg.com/vi/j5vQ6oXSZpU/sddefault.jpg
              width: 640
              height: 480
            author:
              name: CBS News
              url: https://www.youtube.com/@cbsnews
              avatar: >-
                https://yt3.ggpht.com/ytc/AIdro_niBFv49gSx4rr1afMZU_Pv7SeuPKO2SMHvv0Ar7OKxM4o=s88-c-k-c0x00ffffff-no-rj
            publishedDate: '2025-08-07T21:07:09.000Z'
            duration: 359
            favicon: >-
              https://www.youtube.com/s/desktop/f788da0a/img/logos/favicon_48x48.png
            score: 0.8580227
            highlights:
              - startTime: 0
                endTime: 23
                visualDescription: >-
                  A male presenter in a dark long-sleeved shirt and jeans stands
                  in a modern, brightly lit office space with plants and wooden
                  accents. He gestures with his hands as he speaks. The
                  background shows a large white screen displaying 'GPT-5'. An
                  inset video then appears, showing a woman looking at a laptop,
                  which displays a 'ChatGPT 5' interface. The interface shows a
                  schedule planning assistant, detailing a day's schedule from
                  coffee with Grant to a flight departure, and includes 'Two
                  quick email actions' and a 'Light packing list'. The woman
                  nods and smiles. Overlapping text on screen announces 'OPENAI
                  RELEASES GPT-5 FIFTH GENERATION OF THE A.I. TECHNOLOGY THAT
                  POWERS CHATGPT'.
                audioTranscription: >-
                  Welcome into CBS News 24/7, OpenAI launches GPT-5, it's the
                  latest generation of the artificial intelligence technology
                  that powers ChatGPT.

                  OpenAI says the new model is faster and smarter than ever
                  before, it comes more than two years after the release of its
                  predecessor, and expectations are high.
            transcription:
              videoClips:
                - startTime: 0
                  endTime: 23
                  visualDescription: >-
                    A male presenter in a dark long-sleeved shirt and jeans
                    stands in a modern, brightly lit office space with plants
                    and wooden accents. He gestures with his hands as he speaks.
                    The background shows a large white screen displaying
                    'GPT-5'. An inset video then appears, showing a woman
                    looking at a laptop, which displays a 'ChatGPT 5' interface.
                    The interface shows a schedule planning assistant, detailing
                    a day's schedule from coffee with Grant to a flight
                    departure, and includes 'Two quick email actions' and a
                    'Light packing list'. The woman nods and smiles. Overlapping
                    text on screen announces 'OPENAI RELEASES GPT-5 FIFTH
                    GENERATION OF THE A.I. TECHNOLOGY THAT POWERS CHATGPT'.
                - startTime: 24
                  endTime: 43
                  visualDescription: >-
                    A male tech journalist, Jacob Ward, wearing a plaid shirt
                    and dark pants, stands opposite a female presenter in a
                    light blue suit. They are on a brightly lit studio set with
                    a large purple background displaying 'CBS NEWS TECHWATCH' in
                    white bold letters with circuit board graphics. The female
                    presenter holds a tablet and gestures while speaking. A
                    smaller screen to the left shows the previous segment with
                    the man presenting in the modern office, and then a graphic
                    that says 'Introducing ChatGPT'.
              audioClips:
                - startTime: 1
                  endTime: 10
                  transcription: >-
                    Welcome into CBS News 24/7, OpenAI launches GPT-5, it's the
                    latest generation of the artificial intelligence technology
                    that powers ChatGPT.
                  speakerId: speaker_1
                - startTime: 11
                  endTime: 23
                  transcription: >-
                    OpenAI says the new model is faster and smarter than ever
                    before, it comes more than two years after the release of
                    its predecessor, and expectations are high.
                  speakerId: speaker_1
                - startTime: 24
                  endTime: 35
                  transcription: >-
                    So I want to bring in Jacob Ward, technology journalist,
                    host of The Rip Current podcast.
                  speakerId: speaker_1
                - startTime: 35
                  endTime: 38
                  transcription: >-
                    Thanks for being here, also the author of The Loop, How
                    Technology is Creating World Without Choices, and How to
                    Fight Back.
                  speakerId: speaker_1
                - startTime: 38
                  endTime: 43
                  transcription: >-
                    Okay, first things first, we're talking about this release
                    of ChatGPT-5.
                  speakerId: speaker_1
        dollarCost:
          total: 0.01
    AnswerCitationItem:
      allOf:
        - $ref: '#/components/schemas/CommonVideoData'
        - type: object
          properties:
            highlights:
              description: >-
                The video clip that best matches the query. It only one video
                clip now.
              type: array
              items:
                $ref: '#/components/schemas/VideoHighlight'
            transcription:
              $ref: '#/components/schemas/Transcription'
    CommonVideoData:
      type: object
      properties:
        url:
          description: The video page URL.
          type: string
          example: https://www.youtube.com/watch?v=2FMBSblpcrc
        title:
          description: The video title.
          type: string
          example: How to use one paper towel | Joe Smith | TEDxConcordiaUPortland
        description:
          description: The video description.
          type: string
          example: >-
            R. P. Joe Smith served as a District Attorney in Umatilla County and
            nearly won a race for Oregon Attorney General without taking a
            single contribution over $99.99.
        thumbnail:
          description: The video thumbnail image.
          type: object
          properties:
            url:
              description: image URL
              type: string
              example: https://i.ytimg.com/vi/2FMBSblpcrc/sddefault.jpg
            width:
              description: image width
              type: integer
              example: 640
            height:
              description: image height
              type: integer
              example: 480
        author:
          description: The information of video author.
          type: object
          properties:
            name:
              description: author name
              type: string
              example: TEDx Talks
            url:
              description: author detail URL
              type: string
              nullable: true
              example: https://www.youtube.com/@tedx
            avatar:
              description: author avatar URL
              type: string
              example: >-
                https://yt3.ggpht.com/1gDPO-4YPWFErfn3yQBnv0yxpkmiud1m5CrorApkOqUYdNd9FrZQ9xB9C9VmDt4EsgArnlwqAQc=s88-c-k-c0x00ffffff-no-rj
        publishedDate:
          description: Video published date, ISO timestamp string
          type: string
          example: '2012-04-18T04:26:13.000Z'
        duration:
          description: Video duration in seconds
          type: integer
          example: 268
        favicon:
          description: The URL of the favicon for the search result's domain.
          type: string
          example: >-
            https://www.youtube.com/s/desktop/f788da0a/img/logos/favicon_48x48.png
        score:
          description: relevance score for query
          type: number
          nullable: true
          example: 0.6847141
    VideoHighlight:
      description: The video clip that best matches the query.
      type: object
      properties:
        startTime:
          description: Start time of the video clip in seconds.
          type: integer
          example: 47
        endTime:
          description: End time of the video clip in seconds.
          type: integer
          example: 84
        visualDescription:
          description: Visual description of the video clip.
          type: string
          example: >-
            Joe Smith stands center stage, demonstrating various ways people
            grab paper towels. He mimes pulling two or three trifold paper
            towels, then several tear-off sheets which he crumbles, then sheets
            from a self-cutting dispenser which he also crumples. He then
            demonstrates using recycled paper towels, indicating that people
            take more because they are less absorbent. He bends over a white
            basin, then stands up, pointing his finger upwards and smiling,
            emphasizing that everything can be done with 'one towel'.
        audioTranscription:
          description: Audio transcription of the video clip.
          type: string
          nullable: true
          example: >-
            Now there are all kinds of paper towel dispensers. There's the
            trifold. People typically take two or three.

            There's the one that cuts it that you have to tear off. People go
            one, two, three, four, tear, this much, right?

            There's the one that cuts itself. People go, one, two, three, four.

            Or there's the same thing, but recycled paper. You have to get five
            of those because they're not as absorbent, of course.

            The fact is, you can do it all with one towel.
    Transcription:
      description: >-
        The video transcription with visual and auditory when set
        `contentOptions.includeTranscription` as `true`, otherwise null.
      type: object
      nullable: true
      properties:
        videoClips:
          description: Video clips with visual descriptions.
          type: array
          items:
            $ref: '#/components/schemas/VideoClip'
        audioClips:
          description: Audio clips with transcriptions.
          type: array
          items:
            $ref: '#/components/schemas/AudioClip'
    VideoClip:
      description: The video clip with visual description.
      type: object
      properties:
        startTime:
          description: Start time of the video clip in seconds.
          type: integer
          example: 0
        endTime:
          description: End time of the video clip in seconds.
          type: integer
          example: 7
        visualDescription:
          description: Visual description of the video clip.
          type: string
          example: >-
            The video opens with a grey background featuring the red 'TEDx'
            logo, followed by 'ConcordiaUPortland' in black text. Below it, 'x =
            independently organized TED event' is in smaller red text. The text
            'BECOMING EXTRAORDINARY' appears briefly, then a yellow-green
            rectangular banner with an orange bird icon and the text
            'UNCONVENTIONALGUIDES.COM' fades in. The background gradually
            changes from grey to white and then to a darker shade before
            transitioning to black.
    AudioClip:
      description: The video clip with audio transcription.
      type: object
      properties:
        startTime:
          description: Start time of the video clip in seconds.
          type: integer
          example: 11
        endTime:
          description: End time of the video clip in seconds.
          type: integer
          example: 26
        transcription:
          description: Transcription of the audio clip.
          type: string
          example: >-
            571 million, 230,000 pounds of paper towels are used by Americans
            every year.
        speakerId:
          description: >-
            The speaker ID of the audio clip, such as 'speaker_1'. If the
            speaker is identified, it will be set to the speaker's name.
          type: string
          example: Joe Smith
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: API key must be provided via `x-api-key` header.

````