Detected country: US
logo
Open AppStatusSubmit Ticket
GuideAPI References
‌
‌
‌
logo

Powered by

  • Home
  • Advanced
  • API Reference

API Reference

4min read

Share

:::info Our development team is currently in the process of creating comprehensive API documentation at docs.brainfish.ai. If you have any specific requirements or inquiries, please feel free to contact us at support@brainfi.sh.

:::

Explore the potential of our platform, enabling you to develop apps that are contextually relevant and geared towards specific actions using Brainfish. Whether you're integrating your service with ours for public use or creating applications for your team's internal needs, our platform empowers you to do so effectively.

Step 1: Create an API token

  • Navigate to Settings → Advanced → API tokens https://app.brainfi.sh/settings/tokens
  • Click create new token

Create new token

  • Enter a token name that is easy to remember

:::info Access Tokens

An Access Token is used to access your own app data via the API. You should never give your Access Token to a 3rd party. If you're building an app that's destined to be used only by your own teams in your own apps then using your Access Token is generally sufficient.

:::

Step 2: Make your first API call to generate answer for search query

Copy the snippet below into your terminal, making sure to swap

YOUR_ACCESS_TOKEN

for the access token of your app from Step 1.

curl --request POST \
     --url https://app.brainfi.sh/api/articles.contextual.search \
     --header 'accept: application/json' \
     --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
     --header 'content-type: application/json' \
     --data '
{
  "query": "What is Generative Language Models?"
}

Sample response

{
    "status": 200,
    "ok": true,
    "data": {
        "id": "abc12345",
        "citations": [
            {
                "type": "link",
                "title": "Introduction to Generative Language Models",
                "url": "http://example.com/generative-language-models",
                "description": "# Introduction to Generative Language Models \n A Generative Language Model (GLLM) is an advanced AI model designed to generate coherent and contextually relevant text. It employs techniques from deep learning and natural language processing to understand and replicate human-like language patterns.\n\nGLLMs are trained on vast amounts of text data, enabling them to learn grammar, vocabulary, and even nuanced subtleties of language. By leveraging this learning, they can produce text that ranges from creative writing to generating code snippets.\n\nOne of the remarkable features of a GLLM is its ability to generate text that appears to be written by a human, making it useful in various applications such as content creation, chatbots, code generation, and more.\n\nTo generate text, a GLLM takes a seed input and predicts the next words based on the learned patterns. This process continues sequentially, resulting in coherent and contextually appropriate text.\n\nKeep in mind that while GLLMs are impressive in their abilities, they are not infallible and may occasionally produce inaccurate or nonsensical content. As of now, GPT-3 is one of the most advanced examples of a Generative Language Model."
            }
        ],
        "suggestedAnswerMarkdown": "- A Generative Language Model (GLLM) is a sophisticated AI model designed to generate coherent and contextually relevant text.\n- It utilizes techniques from deep learning and natural language processing to understand and replicate human-like language patterns.\n- GLLMs are trained on extensive text data, allowing them to learn grammar, vocabulary, and nuances of language.\n- They can be used for various applications such as content creation, chatbots, code generation, and more.\n- GLLMs take a starting input and predict subsequent words to produce coherent and contextually appropriate text.\n- It's important to note that while GLLMs are impressive, they may occasionally produce inaccurate or nonsensical content.\n- GPT-3 stands as one of the most advanced examples of a Generative Language Model.",
        "suggestedAnswerText": "A Generative Language Model (GLLM) is a sophisticated AI model designed to generate coherent and contextually relevant text. It utilizes techniques from deep learning and natural language processing to understand and replicate human-like language patterns. GLLMs are trained on extensive text data, allowing them to learn grammar, vocabulary, and nuances of language. They can be used for various applications such as content creation, chatbots, code generation, and more. GLLMs take a starting input and predict subsequent words to produce coherent and contextually appropriate text. It's important to note that while GLLMs are impressive, they may occasionally produce inaccurate or nonsensical content. GPT-3 stands as one of the most advanced examples of a Generative Language Model."
    }
}
Nested Articles

Catalog and CatalogContent Management

Get company search queries

How to Integrate Brainfish API with WhatsApp for Automatic Responses

Share