Unltd AI logo

Getting started


Get Bots

GET https://api.unltd.ai/v1//bots/

This endpoint retrieves a list of Bot entities. The response can be customized using the provided query parameters. Query parameters allow you to filter bots by custom flag, name, service related attributes or paginate and sort the response. Depending on the user's role and the 'custom' flag value, different results may be returned.

Query Parameters

custom

Boolean

Flag to filter by custom bots. If ture only bot related to the users orgnaizations will be returned.

name

String

The name of the bot to filter by.

sortBy

String

The attribute to sort by.

limit

Integer

The maximum number of bots to return.

page

Integer

The page number to return in the paginated response.

service

String

The service name to filter by.

serviceId

String

The service ID to filter by.

serviceSlug

String

The service slug to filter by.

serviceDirectory

String

The service directory to filter by.

tags

String

A string containing tag IDs separated by commas, used to filter bots associated with these tags.

Permissions

This request requires authentication. Depending on the user's role and the 'custom' flag, the API may return different results. If 'custom' is set to true, it will return the bots associated with the authenticated user. If there's no user attached to the request, it will only return public bots.

API Example

const fetch = require('node-fetch');

async function fetchApiData() {
  const response = await fetch('https://api.unltd.ai/v1//bots/', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer ',
      'Content-Type': 'application/json',
    },
  });

  const data = await response.json();
  console.log(data);
}

fetchApiData();

Response Object

200 success

The response object contains the following properties:

  • results: An array of bot entities.
  • page: The current page number.
  • limit: The maximum number of results per page.
  • totalPages: The total number of pages.
  • totalResults: The total number of bot entities.
{
  "results": [
    {
      "applyToApi": true,
      "creditCost": 100,
      "inputs": [],
      "modelKey": "textCompletion",
      "name": "this is a bot name",
      "description": "this bot is just an example.",
      "slug": "bot_example",
      "id": "648b7ddf26014d2229722471"
    }
  ],
  "page": 1,
  "limit": 10,
  "totalPages": 1,
  "totalResults": 1
}

Get Custom Bots

GET https://api.unltd.ai/v1/organizations/:organizationId/bots/

This request necessitates authentication and can be carried out by an authenticated user who is a member of the specified organization, or by using an organization token. The outcome of this request will be the retrieval of bots associated with the given organization.

Query Parameters

organizationId

String

The ID of the organization to fetch the bots from.

name

String

The name of the bot to filter by.

sortBy

String

The attribute to sort by.

limit

Integer

The maximum number of bots to return.

page

Integer

The page number to return in the paginated response.

tags

String

A string containing tag IDs separated by commas, used to filter bots associated with these tags.

Permissions

This request necessitates authentication and can be carried out by an authenticated user who is a member of the specified organization, or by using an organization token. The outcome of this request will be the retrieval of bots associated with the given organization.

API Example

const fetch = require('node-fetch');

async function fetchApiData() {
  const response = await fetch('https://api.unltd.ai/v1/organizations/123abcidhere/bots/', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer ',
      'Content-Type': 'application/json',
    },
  });

  const data = await response.json();
  console.log(data);
}

fetchApiData();

Response Object

200 success

The response object contains the following properties:

  • results: An array of bot entities.
  • page: The current page number.
  • limit: The maximum number of results per page.
  • totalPages: The total number of pages.
  • totalResults: The total number of bot entities.
{
  "results": [
    {
      "applyToApi": true,
      "creditCost": 100,
      "inputs": [],
      "modelKey": "textCompletion",
      "name": "this is a bot name",
      "description": "this bot is just an example.",
      "slug": "bot_example",
      "id": "648b7ddf26014d2229722471",
      "organizationId": "org_example"
    }
  ],
  "page": 1,
  "limit": 10,
  "totalPages": 1,
  "totalResults": 1
}

Get Single Bot

GET https://api.unltd.ai/v1//bots/:botSlug/

This endpoint retrieves a specific Bot entity based on the provided bot slug. The response contains detailed information about the requested bot. Depending on the user's role, different information may be returned.

Path Parameters

botSlug

string

The unique slug of the bot to be retrieved.

Permissions

This request requires authentication. Depending on the user's role, the API may return different results. If the user is an admin, it will return detailed information about the bot. If the user is not an admin, it will only return publicly available information about the bot.

API Example

const fetch = require('node-fetch');

async function fetchApiData() {
  const response = await fetch('https://api.unltd.ai/v1//bots/example_bot/', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer ',
      'Content-Type': 'application/json',
    },
  });

  const data = await response.json();
  console.log(data);
}

fetchApiData();

Response Object

200 success

The response object will be returned as a bot.
{
  "applyToApi": true,
  "creditCost": 100,
  "inputs": [],
  "modelKey": "textCompletion",
  "name": "this is a bot name",
  "description": "this bot is just an example.",
  "slug": "bot_example",
  "id": "648b7ddf26014d2229722471"
}

Get Single Custom Bot

GET https://api.unltd.ai/v1/organizations/:organizationId/bots/:botSlug/

This endpoint retrieves a specific Bot entity that belongs to an organization, based on the provided organization ID and bot slug. The response contains detailed information about the requested bot.

Path Parameters

organizationId

string

The unique identifier of the organization.

botSlug

string

The unique slug of the organization's bot to be retrieved.

Permissions

This request can be authenticated either by an authenticated user who is a member of the organization or with an organization token

API Example

const fetch = require('node-fetch');

async function fetchApiData() {
  const response = await fetch('https://api.unltd.ai/v1/organizations/example_org_id/bots/example_bot/', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer ',
      'Content-Type': 'application/json',
    },
  });

  const data = await response.json();
  console.log(data);
}

fetchApiData();

Response Object

200 success

The response object will be returned as a organization bot.
{
  "bot": {
    "applyToApi": true,
    "creditCost": 100,
    "inputs": [],
    "modelKey": "textCompletion",
    "name": "this is an organization bot name",
    "description": "this bot is just an example.",
    "slug": "bot_example",
    "id": "648b7ddf26014d2229722471"
  },
  "organization": {
    "id": "org_id",
    "name": "example_org"
  }
}