Skip to main content
GET
/
v4
/
knowledge-bases
Python
import os
from scale_gp import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
page = client.knowledge_bases.list()
page = page.items[0]
print(page.knowledge_base_id)
package main

import (
"context"
"fmt"

"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)

func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.KnowledgeBases.List(context.TODO(), sgp.KnowledgeBaseListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.egp.scale.com/v4/knowledge-bases \
--header 'x-api-key: <api-key>'
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.egp.scale.com/v4/knowledge-bases', 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://api.egp.scale.com/v4/knowledge-bases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);

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

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.get("https://api.egp.scale.com/v4/knowledge-bases")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.egp.scale.com/v4/knowledge-bases")

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "items": [
    {
      "knowledge_base_id": "<string>",
      "vector_store_id": "<string>",
      "knowledge_base_name": "<string>",
      "embedding_config": {
        "type": "<string>",
        "model_deployment_id": "<string>"
      },
      "created_at": "<string>",
      "metadata": {},
      "updated_at": "<string>",
      "connections": [
        {
          "last_uploaded_at": "2023-11-07T05:31:56Z",
          "knowledge_base_data_source": {
            "name": "<string>",
            "data_source_config": {
              "source": "<string>",
              "s3_bucket": "<string>",
              "aws_region": "<string>",
              "aws_account_id": "<string>",
              "s3_prefix": ""
            },
            "id": "<string>",
            "created_at": "2023-11-07T05:31:56Z",
            "updated_at": "2023-11-07T05:31:56Z",
            "created_by_user_id": "<string>",
            "account_id": "<string>",
            "description": "<string>",
            "tagging_information": {
              "type": "all",
              "tags_to_apply": {}
            }
          }
        }
      ],
      "artifacts_status": {
        "artifacts_chunking": 123,
        "artifacts_embedding": 123,
        "artifacts_completed": 123,
        "artifacts_pending": 123,
        "artifacts_uploading": 123,
        "artifacts_failed": 123
      },
      "artifact_count": 123,
      "cluster_status": "<string>",
      "created_by_user_id": "<string>",
      "kb_index_configuration": {
        "fields": {
          "author": {
            "fields": {
              "age": {
                "filterable": true,
                "type": "int32"
              },
              "name": {
                "filterable": true,
                "searchable": true,
                "type": "string"
              }
            },
            "type": "complex"
          },
          "priority": {
            "filterable": true,
            "type": "int32"
          }
        },
        "max_index_size": 123
      }
    }
  ],
  "total_item_count": 123,
  "current_page": 123,
  "items_per_page": 123
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Query Parameters

view
enum<string>[] | null
Available options:
Connections,
ArtifactCount,
IndexConfiguration
name
string | null

Optional search by knowledge base name (case-insensitive partial match)

page
integer
default:1

Page number for pagination to be returned by the given endpoint. Starts at page 1

Required range: x >= 1
limit
integer
default:100

Maximum number of artifacts to be returned by the given endpoint. Defaults to 100 and cannot be greater than 10k.

Required range: 1 <= x <= 10000
account_id
string | null

Optional search by account_id

Response

Successful Response

items
KnowledgeBaseItemV2 · object[]
required

The data returned for the current page.

total_item_count
integer
required

The total number of items of the query

current_page
integer
required

The current page number.

items_per_page
integer
required

The number of items per page.