Quick Start Guide

Appliance running? If not, start with Deploy on AWS.

1. Get an API Key

  • Open the admin console and sign in with your current admin token (see the CloudFormation Outputs tab).
  • Go to the Keys tab and create a new admin key to authorize your application.
  • Creating a tenant API key in the FEVER admin console
    Keys tab: mint admin or scoped tenant keys.

2. Install the Client

pip install https://github.com/Lowdown-Labs/fever-clients/releases/download/v0.4.0/fever_client-0.4.0-py3-none-any.whl
npm install https://github.com/Lowdown-Labs/fever-clients/releases/download/v0.4.0/fever-client-0.4.0.tgz
go get github.com/Lowdown-Labs/fever-clients/clients/go@v0.4.0
gem install https://github.com/Lowdown-Labs/fever-clients/releases/download/v0.4.0/fever_client-0.4.0.gem
curl -LO https://github.com/Lowdown-Labs/fever-clients/releases/download/v0.4.0/fever-client-0.4.0.jar
curl -LO https://github.com/Lowdown-Labs/fever-clients/releases/download/v0.4.0/fever-clients-rust-0.4.0.tar.gz
tar xzf fever-clients-rust-0.4.0.tar.gz
cargo add --path ./rust
curl -LO https://github.com/Lowdown-Labs/fever-clients/releases/download/v0.4.0/fever-clients-php-0.4.0.tar.gz
tar xzf fever-clients-php-0.4.0.tar.gz
composer config repositories.fever path ./php
composer require lowdownlabs/fever-client
curl -LO https://github.com/Lowdown-Labs/fever-clients/releases/download/v0.4.0/LowdownLabs.Fever.0.4.0.nupkg
dotnet add package LowdownLabs.Fever --source .

3. Configure the Client

  • Clients only need 2 values: host ยท access_token.
  • host is your appliance base URL; access_token is the key from step 1.
  • Call whoami once to confirm the key and see the role/scope it carries.
import asyncio

import fever_client

async def main():
    config = fever_client.Configuration(
        host="https://your-appliance",
        access_token="YOUR_API_KEY",
    )
    async with fever_client.ApiClient(config) as client:
        auth = fever_client.AuthApi(client)
        print(await auth.whoami())

asyncio.run(main())
import { AuthApi, Configuration } from "fever-client";

const auth = new AuthApi(
  new Configuration({
    basePath: "https://your-appliance",
    accessToken: "YOUR_API_KEY",
  })
);

console.log(await auth.whoami());
package main

import (
	"context"
	"fmt"

	fever "github.com/Lowdown-Labs/fever-clients/clients/go"
)

func main() {
	cfg := fever.NewConfiguration()
	cfg.Servers = fever.ServerConfigurations{{URL: "https://your-appliance"}}
	ctx := context.WithValue(context.Background(), fever.ContextAccessToken, "YOUR_API_KEY")
	client := fever.NewAPIClient(cfg)

	me, _, err := client.AuthAPI.Whoami(ctx).Execute()
	if err != nil {
		panic(err)
	}
	fmt.Println(me)
}
require "fever_client"

FeverClient.configure do |config|
  config.scheme = "https"
  config.host = "your-appliance"
  config.access_token = "YOUR_API_KEY"
end

puts FeverClient::AuthApi.new.whoami.inspect
import com.lowdownlabs.fever.ApiClient;
import com.lowdownlabs.fever.Configuration;
import com.lowdownlabs.fever.api.AuthApi;

public class Quickstart {
    public static void main(String[] args) throws Exception {
        ApiClient client = Configuration.getDefaultApiClient();
        client.setBasePath("https://your-appliance");
        client.setRequestInterceptor(builder ->
            builder.header("Authorization", "Bearer YOUR_API_KEY"));
        AuthApi auth = new AuthApi(client);
        System.out.println(auth.whoami());
    }
}
use fever_client::apis::{auth_api, configuration::Configuration};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = Configuration {
        base_path: "https://your-appliance".to_owned(),
        bearer_access_token: Some("YOUR_API_KEY".to_owned()),
        ..Default::default()
    };
    let me = auth_api::whoami(&config).await?;
    println!("{me:?}");
    Ok(())
}
<?php
require_once __DIR__ . '/vendor/autoload.php';

use LowdownLabs\Fever\Api\AuthApi;
use LowdownLabs\Fever\Configuration;

$config = (new Configuration())
    ->setHost('https://your-appliance')
    ->setAccessToken('YOUR_API_KEY');

$auth = new AuthApi(null, $config);
print_r($auth->whoami());
using LowdownLabs.Fever.Api;
using LowdownLabs.Fever.Client;

var config = new Configuration
{
    BasePath = "https://your-appliance",
    AccessToken = "YOUR_API_KEY"
};
var auth = new AuthApi(config);
Console.WriteLine(await auth.WhoamiAsync());

4. First Search

  • Give it a query - text or an image; you'll receive a set of ranked SearchHit objects out.
  • Nothing ingested yet? Follow How to Ingest User Data with FEVER first, then come back.
import asyncio

import fever_client

async def main():
    config = fever_client.Configuration(
        host="https://your-appliance",
        access_token="YOUR_API_KEY",
    )
    async with fever_client.ApiClient(config) as client:
        search = fever_client.SearchApi(client)
        hits = await search.search(
            fever_client.SearchRequest(
                text="plaid handbag", k=10, customer_id="shop-42"
            )
        )
        for hit in hits:
            print(hit.blob_id, round(hit.score, 3), hit.media_ref)

asyncio.run(main())
import { Configuration, SearchApi } from "fever-client";

const search = new SearchApi(
  new Configuration({
    basePath: "https://your-appliance",
    accessToken: "YOUR_API_KEY",
  })
);

const hits = await search.search({
  searchRequest: { text: "plaid handbag", k: 10, customerId: "shop-42" },
});
for (const hit of hits) {
  console.log(hit.blobId, hit.score?.toFixed(3), hit.mediaRef);
}
package main

import (
	"context"
	"fmt"

	fever "github.com/Lowdown-Labs/fever-clients/clients/go"
)

func main() {
	cfg := fever.NewConfiguration()
	cfg.Servers = fever.ServerConfigurations{{URL: "https://your-appliance"}}
	ctx := context.WithValue(context.Background(), fever.ContextAccessToken, "YOUR_API_KEY")
	client := fever.NewAPIClient(cfg)

	req := fever.NewSearchRequest()
	req.SetText("plaid handbag")
	req.SetK(10)
	req.SetCustomerId("shop-42")
	hits, _, err := client.SearchAPI.Search(ctx).SearchRequest(*req).Execute()
	if err != nil {
		panic(err)
	}
	for _, hit := range hits {
		fmt.Println(hit.BlobId, hit.Score, hit.GetMediaRef())
	}
}
require "fever_client"

FeverClient.configure do |config|
  config.scheme = "https"
  config.host = "your-appliance"
  config.access_token = "YOUR_API_KEY"
end

request = FeverClient::SearchRequest.new(text: "plaid handbag", k: 10, customer_id: "shop-42")
hits = FeverClient::SearchApi.new.search(request)
hits.each { |hit| puts "#{hit.blob_id} #{hit.score.round(3)} #{hit.media_ref}" }
import com.lowdownlabs.fever.ApiClient;
import com.lowdownlabs.fever.Configuration;
import com.lowdownlabs.fever.api.SearchApi;
import com.lowdownlabs.fever.model.SearchHit;
import com.lowdownlabs.fever.model.SearchRequest;

public class StorefrontSearch {
    public static void main(String[] args) throws Exception {
        ApiClient client = Configuration.getDefaultApiClient();
        client.setBasePath("https://your-appliance");
        client.setRequestInterceptor(builder ->
            builder.header("Authorization", "Bearer YOUR_API_KEY"));
        SearchApi api = new SearchApi(client);

        SearchRequest request = new SearchRequest()
            .text("plaid handbag")
            .k(10)
            .customerId("shop-42");
        for (SearchHit hit : api.search(request)) {
            System.out.println(hit.getBlobId() + " " + hit.getScore() + " " + hit.getMediaRef());
        }
    }
}
use fever_client::apis::{configuration::Configuration, search_api};
use fever_client::models::SearchRequest;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = Configuration {
        base_path: "https://your-appliance".to_owned(),
        bearer_access_token: Some("YOUR_API_KEY".to_owned()),
        ..Default::default()
    };
    let mut request = SearchRequest::new();
    request.text = Some("plaid handbag".to_owned());
    request.k = Some(10);
    request.customer_id = Some("shop-42".to_owned());
    let hits = search_api::search(&config, request).await?;
    for hit in hits {
        println!("{:?} {:?} {:?}", hit.blob_id, hit.score, hit.media_ref);
    }
    Ok(())
}
<?php
require_once __DIR__ . '/vendor/autoload.php';

use LowdownLabs\Fever\Api\SearchApi;
use LowdownLabs\Fever\Configuration;
use LowdownLabs\Fever\Model\SearchRequest;

$config = (new Configuration())
    ->setHost('https://your-appliance')
    ->setAccessToken('YOUR_API_KEY');
$api = new SearchApi(null, $config);

$request = new SearchRequest(['text' => 'plaid handbag', 'k' => 10, 'customer_id' => 'shop-42']);
foreach ($api->search($request) as $hit) {
    echo $hit->getBlobId() . ' ' . $hit->getScore() . ' ' . $hit->getMediaRef() . PHP_EOL;
}
using LowdownLabs.Fever.Api;
using LowdownLabs.Fever.Client;
using LowdownLabs.Fever.Model;

var config = new Configuration
{
    BasePath = "https://your-appliance",
    AccessToken = "YOUR_API_KEY"
};
var api = new SearchApi(config);
var hits = await api.SearchAsync(
    new SearchRequest(text: "plaid handbag", k: 10, customerId: "shop-42"));
foreach (var hit in hits)
{
    Console.WriteLine($"{hit.BlobId} {hit.Score} {hit.MediaRef}");
}

Where Next