Ebbot GPT API

Unlock the Power of Advanced Language Models with Ebbot GPT API

Welcome to the Ebbot GPT API documentation. Our API offers seamless integration of service-optimized Large Language Models (LLMs) and Knowledge Management tools into your applications. With Ebbot GPT, you can harness sophisticated text generation capabilities and enhance your systems with cutting-edge AI technology. Explore our documentation to learn how to integrate and leverage the full potential of Ebbot GPT in your projects.

1. API Key

To make requests to the API, you will need an API key. To obtain one, please request access by filling out this form.

2. Tenant

A tenant is required for many requests. Tenants help separate token usage and datasets between different users. Typically, you’ll only need one tenant, but multiple tenants can be used if your business case requires it. Tenants are tied to your API key, ensuring your data remains secure.

3. Making a Request

  • ExternalId: The ID you chose when creating the tenant.

  • Auth: Authentication is done with a bearer token in the authorization header. Example: "Authorization: Bearer MyAPIKey123"

3.1 List Models

To list the available models:

curl -X GET "egpt-gateway/v1/models" \
 -H "accept: application/json" \
 -H "authorization: Bearer API-KEY"

3.2 Create a tenant

Tenants are automatically created when a request with an unknown tenant is made. If you want to manually create a tenant then use this:

curl -X POST "egpt-gateway/v1/tenants/EXTERNAL-ID" \
 -H "accept: application/json"\
 -H "authorization: Bearer API-KEY" \

(Replace externalId with the id you want to add)

3.3 List tenants

To list the tenants you have created:

curl -X GET "egpt-gateway/v1/tenants" \
 -H "accept: application/json"\
 -H "authorization: Bearer API-KEY" \

A response could look like this:

[
"MyId1",
"MyId2",
"MyId3"
]

3.4 Creating a chat completion

This is where the magic happens. This is where you get a response from the bot. Here is a simple request with the bare necessities:

curl -X POST "egpt-gateway/v1/EXTERNAL-ID/chat/completion" \
 -H "accept: application/json"\
 -H "authorization: Bearer API-KEY"\
 -H "content-type: application/json" \
 -d '{"pipeline":"egpt","model":"ebbot_gpt-1.2.3","messages":[{"content":"You are a helpful assistant.","role":"system"},{"content":"Hello how are you?","role":"user"}]}' \

A response might look like this:

{
  "response": {
    "id": "cmpl-1c6f8437c81f417983a137b00b986bda",
    "object": "chat.completion",
    "created": 18661963,
    "model": "ebbot_gpt-1.2.3",
    "choices": [
      {
        "index": 0,
        "message": {
          "role": "assistant",
          "content": "Hello! I'm an AI, so I don't have feelings like humans do, but I'm here to assist you with any questions or tasks you might have. How can I help you today?"
        },
        "finish_reason": "stop"
      }
    ],
    "usage": {
      "prompt_tokens": 28,
      "total_tokens": 121,
      "completion_tokens": 93
    },
    "pipeline": "egpt"
  },
  "documentSlicerMetadata": {
    "cutDocuments": 0
  },
  "sources": []
}

Request parameters

The following table describes the various parameters you can use when configuring your request. These parameters control different aspects of the response generation and the overall behavior of the API. Each parameter has specific functionality, ranging from controlling randomness in responses to enabling advanced retrieval mechanisms. Understanding these parameters will help you tailor the API's output to better meet your needs and ensure that you can leverage all available features effectively.

FieldTypeDescription

top_p

float

Top-p filtering selects words with the highest probability that cumulatively reach a set threshold, ensuring diverse and unpredictable text generation. (Alternative to temperature)

temperature

float

Controls the randomness of the response. Higher values make the output more random.

seed

integer

Attempts to make the answer deterministic.

maxTokens

integer

Maximum number of tokens used in the answer.

contentGuard

boolean

Flags inappropriate content by user and bot (e.g., sexual content, violence).

rag

object

Retrieval Augmented Generation (embedder)

rag.enabled

boolean

Indicates if the embedder is enabled.

rag.output

string

Placeholder for the word that will be replaced by the response from the embedder in the system prompt (e.g., {documents})

rag.dataSetId

string (UUID)

The ID of the dataset that should be used.

rag.returnSources

boolean

If the sources of the datasets should be returned.

rag.searchDefinitions

array

List of search definitions.

rag.searchDefinitions.rnrK

integer

Retrieve and rerank involves first pulling relevant information from a large dataset and then sorting it by importance or relevance. (Experimental)

rag.searchDefinitions.topK

number

Selects the top 'K' items from a list based on the highest scores or most relevance.

rag.searchDefinitions.numberOfMessages

integer

Number of messages to use from the conversation.

rag.searchDefinitions.filter

string

Filters based on specific roles (user, assistant, both).

pipeline

string

Specifies the inference engine to be used (e.g., egpt, openai).

model

string

The model to be used for the request.

messages

array

The conversation history.

messages[].content

string

The content of the message.

messages[].role

enum

Who sent the message (e.g., system, user, assistant).

When you have gotten a completion you can add the response from the bot to the array of messages and then continue the conversation with your user input. It could look like this:

...

  "messages": [
    {
      "content": "You are a helpful assistant.",
      "role": "system"
    },
    {
      "content": "Hello how are you?",
      "role": "user"
    },
    {
      "content": "Hello! I'm an AI, so I don't have feelings like humans do, but I'm here to assist you with any questions or tasks you might have. How can I help you today?",
      "role": "assistant"
    },
    {
      "content": "Okay nice! There is a problem with my tv remote. How can I get it fixed?",
      "role": "user"
    }
  ]
    
...

4. Get token usage

To get the token usage between two dates:

curl -X GET "egpt-gateway/v1/EXTERNAL-ID/usage?from=2024-05-01+12%3A00%3A00.000%2B00&to=2024-09-01+12%3A00%3A00.000%2B00" \
 -H "accept: application/json"\
 -H "authorization: Bearer API-KEY" 

The response might look something like this:

{
  "usage": [
    {
      "day": "2024-06-28T00:00:00.000Z",
      "sum": 2224
    },
    {
      "day": "2024-07-17T00:00:00.000Z",
      "sum": 1435
    }
  ],
  "pages": {
    "currentPage": 1,
    "totalPages": 1
  }
}

Last updated