๐Ÿ“ˆ Mafin

Endpoint: /mafin/query

  • Base URL: https://api.vectify.ai
  • Method: POST

This API endpoint allows you to query Mafin, financial AI copilot developed by Vectify AI.

You can interact with Mafin by passing your query, optionally providing a ticker symbol, chat history, and specifying if you want to stream the response.

Authentication

To authenticate your requests to the Mafin API, you must include your API key in the request header. You can find your API key in the Vectify Dashboard (opens in a new tab).

Example Request Header:

{
  "api_key": "YOUR_API_KEY_HERE"
}

Request Body

The request body must be formatted as a JSON object and can include the following fields:

Parameters:

  • query (required, string):
    The main query string that you want Mafin to respond to. This should contain your question or request for information.
    Example: "What is the quick ratio of AMD in FY2022?"

  • ticker (optional, string):
    A stock ticker symbol of the company you'd like to inquire about. This is optional if the query already contains the company name or ticker.
    Example: "AMD"

  • chat_history (optional, array of dictionaries):
    An array of previous exchanges in the conversation to provide context for Mafin. Each entry should be a dictionary with two keys:

    • role: The role of the speaker, either user or vectify.
    • content: The content of the message exchanged.

    Example:

    "chat_history": [
      {"role": "user", "content": "Where is the HQ of AMD?"},
      {"role": "vectify", "content": "AMD is headquartered in Santa Clara, California."}
    ]
  • streaming (optional, boolean): If set to true, the response will be streamed in real-time, allowing partial answers to be delivered as the system processes the query. If set to false or omitted, the response will be provided after the entire query is processed.
    Example: false

Example Request:

{
  "query": "What is the quick ratio of AMD in FY2022?",
  "chat_history": [
    {"role": "user", "content": "Where is the HQ of AMD?"},
    {"role": "vectify", "content": "AMD is headquartered in Santa Clara, California."}
  ],
  "streaming": false
}