Resource

LLM Provider

Manage LLM Provider configurations. Connect to OpenAI, Anthropic, Ollama, or other LLM providers to enable AI features.

The LLM Provider Model

Properties

  • Name
    _id
    Type
    Object ID
    Description

    ID of this object

  • Name
    createdAt
    Type
    Date
    Description

    Date and Time when the object was created.

  • Name
    updatedAt
    Type
    Date
    Description

    Date and Time when the object was updated.

  • Name
    name
    Type
    NameRequired
    Description

    A friendly name for this LLM configuration.

  • Name
    description
    Type
    Long Text
    Description

    Description of this LLM configuration.

  • Name
    slug
    Type
    SlugRequired
    Description

    Friendly globally unique name for your object

  • Name
    llmType
    Type
    TextRequired
    Description

    The type of LLM provider (OpenAI, Anthropic, Ollama, etc.)

  • Name
    apiKey
    Type
    Long Text
    Description

    The API key for the LLM provider. Required for OpenAI and Anthropic.

  • Name
    modelName
    Type
    Text
    Description

    The name of the model to use (e.g., gpt-4, claude-3-opus, llama2).

  • Name
    baseUrl
    Type
    Short URL
    Description

    The base URL for the LLM API. Required for Ollama, optional for others.

  • Name
    project
    Type
    Project
    Description

    The project this LLM belongs to. If null, it is a global LLM.

  • Name
    projectId
    Type
    Object ID
    Description

    ID of the project this LLM belongs to. If null, it is a global LLM.

  • Name
    createdByUser
    Type
    User
    Description

  • Name
    createdByUserId
    Type
    Object ID
    Description

    User ID who created this object (if this object was created by a User)

  • Name
    isDefault
    Type
    BooleanRequired
    Description

    Is this the default LLM provider for the project? When set, the global LLM provider will not be used.

  • Name
    costPerMillionTokensInUSDCents
    Type
    NumberRequired
    Description

    Cost per million tokens in USD cents. Used for billing when using global LLM providers.

GETorPOST/api/llm-provider/get-list

List

This endpoint allows you to retrieve a paginated list of all your LLM Provider. By default, a maximum of ten LLM Provider are shown per page.

Optional Query Params

  • limit
    number
    Number of objects to fetch. By default 10, you can increase this count up to 100
  • skip
    number
    Number of objects to skip. This can be useful in pagination

Optional Request Body

List Request

POST
/api/llm-provider/get-list?skip=0&limit=10
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY
Body
{
  "select": {
    "costPerMillionTokensInUSDCents": true,
    "isDefault": true,
    "llmType": true,
    "name": true,
    "slug": true
  },
  "query": {
    "llmType": "Example llm type"
  },
  "sort": {
    "createdAt": -1
  }
}

Response

{
  "count": 10,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_id": "377402b0-28fe-11f1-b591-3fdcef396aba",
      "costPerMillionTokensInUSDCents": 100,
      "isDefault": true,
      "llmType": "Example llm type",
      "name": "Example name",
      "slug": "Example slug"
    },
    {
      "_id": "377402b1-28fe-11f1-b591-3fdcef396aba",
      "costPerMillionTokensInUSDCents": 100,
      "isDefault": true,
      "llmType": "Example llm type",
      "name": "Example name",
      "slug": "Example slug"
    },
    {
      "_id": "377402b2-28fe-11f1-b591-3fdcef396aba",
      "costPerMillionTokensInUSDCents": 100,
      "isDefault": true,
      "llmType": "Example llm type",
      "name": "Example name",
      "slug": "Example slug"
    }
  ]
}
GETorPOST/api/llm-provider/:id/get-item

Get item by ID

This endpoint allows you to retrieve LLM Provider by ID.

  • id
    text
    ID of the Object

Optional Request Body

Get Item Request

POST
/api/llm-provider/:id/get-item
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY
Body
{
  "select": {
    "costPerMillionTokensInUSDCents": true,
    "isDefault": true,
    "llmType": true,
    "name": true,
    "slug": true
  }
}

Response

{
  "_id": "377402b0-28fe-11f1-b591-3fdcef396aba",
  "costPerMillionTokensInUSDCents": 100,
  "isDefault": true,
  "llmType": "Example llm type",
  "name": "Example name",
  "slug": "Example slug"
}
POST/api/llm-provider/count

Count

This endpoint allows you to retrieve the count of all your LLM Provider.

Optional Request Body

Count Request

POST
/api/llm-provider/count
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY
Body
{
  "query": {
    "llmType": "Example llm type"
  }
}

Response

{
  "count": 107
}
POST/api/llm-provider

Create LLM Provider

This endpoint allows you to create a new object.

Create Request

POST
/api/llm-provider
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY
Body
{
  "data": {
    "isDefault": true,
    "llmType": "Example llm type",
    "name": "Example name",
    "apiKey": "Example api key",
    "baseUrl": "https://example.com"
  }
}

Response

{
  "_id": "377402b0-28fe-11f1-b591-3fdcef396aba",
  "costPerMillionTokensInUSDCents": 100,
  "isDefault": true,
  "llmType": "Example llm type",
  "name": "Example name",
  "slug": "Example slug"
}
PUT/api/llm-provider/:id

Update by ID

This endpoint allows you to update object by its ID.

Alternative Methods

For clients that do not support PUT requests, you can use POST or GET with the same request headers and body:

POST/api/llm-provider/:id/update-item
GET/api/llm-provider/:id/update-item

Update Request

PUT
/api/llm-provider/:id
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY
Body
{
  "data": {
    "isDefault": true,
    "llmType": "Example llm type",
    "name": "Example name"
  }
}

Response

{}
DELETE/api/llm-provider/:id

Delete by ID

This endpoint allows you to delete object by its ID.

Alternative Methods

For clients that do not support DELETE requests, you can use POST or GET with the same request headers and body:

POST/api/llm-provider/:id/delete-item
GET/api/llm-provider/:id/delete-item

Delete Request

DELETE
/api/llm-provider/:id
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY

Response

{}

Permissions

Your API Token needs permissions to create, update, read or delete this resource. If you do not have permissions to make a request a 4xx status will be sent as response.

Read Permissions

Required to read LLM Provider

  • Public
  • Project Owner
  • Project Admin
  • Project Member
  • Read LLM
  • Read All Project Resources

Create Permissions

Required to create LLM Provider

  • Project Owner
  • Project Admin
  • Project Member
  • Create LLM

Update Permissions

Required to update LLM Provider

  • Project Owner
  • Project Admin
  • Project Member
  • Edit LLM

Delete Permissions

Required to delete LLM Provider

  • Project Owner
  • Project Admin
  • Project Member
  • Delete LLM