Quick Start

Set up a knowledge base and query it via API in 5 minutes.

Create a project

Your API requests are authenticated using API keys. Without an API key, your requests will return an error. To get your API key, follow these steps:

  1. Sign in and navigate to: https://clearai.net/folders

  2. Name your project and click create.

  3. Upload the media you would like to query (note: be sure to select 'Yes' for API Access).

Get your API keys

Your API requests are authenticated using API keys. Without an API key, your requests will return an error. To get your API key, follow these steps:

  1. Launch your project dashboard.

  2. Click the Details dropdown.

  3. Copy the API key to your clipboard.

Make your first request

To make your first request, send an authenticated request to the /ai endpoint. This will post a query and return a response, which is nice.

Submit a query, get a response.

POST https://clearai.net/ai

Submits a query and returns a response, based on the media files indexed for the specific key in use.

Path Parameters

Query Parameters

Headers

Request Body

Take a look at how you might call this method:

require 'net/http'
require 'json'

url = URI('http://clearai.net/ai')

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer your_api_key'

request.body = {
  msg: 'your_message',
  metadata: {
    key1: 'value1',
    key2: 'value2'
  }
}.to_json

response = http.request(request)

puts response.read_body

Last updated