Skip to main content
POST
/
ai
/
session-analyzer
/
providers
Upsert AI Session Analyzer Provider
curl --request POST \
  --url https://use.hoop.dev/api/ai/session-analyzer/providers \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-4o",
  "provider": "openai",
  "api_key": "sk-...",
  "api_url": "https://api.openai.com/v1"
}
'
import requests

url = "https://use.hoop.dev/api/ai/session-analyzer/providers"

payload = {
"model": "gpt-4o",
"provider": "openai",
"api_key": "sk-...",
"api_url": "https://api.openai.com/v1"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-4o',
provider: 'openai',
api_key: 'sk-...',
api_url: 'https://api.openai.com/v1'
})
};

fetch('https://use.hoop.dev/api/ai/session-analyzer/providers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/ai/session-analyzer/providers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gpt-4o',
'provider' => 'openai',
'api_key' => 'sk-...',
'api_url' => 'https://api.openai.com/v1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://use.hoop.dev/api/ai/session-analyzer/providers"

payload := strings.NewReader("{\n \"model\": \"gpt-4o\",\n \"provider\": \"openai\",\n \"api_key\": \"sk-...\",\n \"api_url\": \"https://api.openai.com/v1\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/ai/session-analyzer/providers")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-4o\",\n \"provider\": \"openai\",\n \"api_key\": \"sk-...\",\n \"api_url\": \"https://api.openai.com/v1\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://use.hoop.dev/api/ai/session-analyzer/providers")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-4o\",\n \"provider\": \"openai\",\n \"api_key\": \"sk-...\",\n \"api_url\": \"https://api.openai.com/v1\"\n}"

response = http.request(request)
puts response.read_body
{
  "api_key": "sk-...",
  "api_url": "https://api.openai.com/v1",
  "created_at": "2024-07-25T15:56:35.317601Z",
  "id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
  "model": "gpt-4o",
  "provider": "openai",
  "updated_at": "2024-07-25T15:56:35.317601Z"
}
{
"message": "the error description"
}
{
"message": "the error description"
}

Body

application/json

The request body resource

model
string
required

Model to use

Example:

"gpt-4o"

provider
enum<string>
required

Name for the AI provider

Available options:
openai,
anthropic,
azure-openai,
custom
Example:

"openai"

api_key
string

API key for authentication

Example:

"sk-..."

api_url
string

Base URL of the AI API

Example:

"https://api.openai.com/v1"

Response

OK

api_key
string

API key for authentication

Example:

"sk-..."

api_url
string

Base URL of the AI API

Example:

"https://api.openai.com/v1"

created_at
string
read-only

The time the resource was created

Example:

"2024-07-25T15:56:35.317601Z"

id
string<uuid>
read-only

The resource identifier

Example:

"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"

model
string

Model to use

Example:

"gpt-4o"

provider
string

Name for the AI provider

Example:

"openai"

updated_at
string
read-only

The time the resource was updated

Example:

"2024-07-25T15:56:35.317601Z"