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.
/api/llm-provider/get-listList
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
query- If you would like to filter on LLM Provider. You can specify include a query here. For more information, please check out writing queries here.
select- By default you will only retrieve ID of objects, to retrieve more fields you need to select them. For more information, please check how to select here.
sort- Objects will be sorted based on created date by default. You can change the sort order — see Data Types: Sort.
List Request
POST/api/llm-provider/get-list?skip=0&limit=10Content-Type: application/json ApiKey: YOUR_API_KEY
{
"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"
}
]
}/api/llm-provider/:id/get-itemGet item by ID
This endpoint allows you to retrieve LLM Provider by ID.
id- text
- ID of the Object
Optional Request Body
select- By default you will only retrieve ID of objects, to retrieve more fields you need to select them. For more information, please check how to select here.
Get Item Request
POST/api/llm-provider/:id/get-itemContent-Type: application/json ApiKey: YOUR_API_KEY
{
"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"
}/api/llm-provider/countCount
This endpoint allows you to retrieve the count of all your LLM Provider.
Optional Request Body
query- If you would like to filter on LLM Provider. You can specify include a query here. For more information, please check out writing queries here.
Count Request
POST/api/llm-provider/countContent-Type: application/json ApiKey: YOUR_API_KEY
{
"query": {
"llmType": "Example llm type"
}
}Response
{
"count": 107
}/api/llm-providerCreate LLM Provider
This endpoint allows you to create a new object.
Create Request
POST/api/llm-providerContent-Type: application/json ApiKey: YOUR_API_KEY
{
"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"
}/api/llm-provider/:idUpdate 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:
Update Request
PUT/api/llm-provider/:idContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"isDefault": true,
"llmType": "Example llm type",
"name": "Example name"
}
}Response
{}/api/llm-provider/:idDelete 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:
Delete Request
DELETE/api/llm-provider/:idContent-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
PublicProject OwnerProject AdminProject MemberRead LLMRead All Project Resources
Create Permissions
Required to create LLM Provider
Project OwnerProject AdminProject MemberCreate LLM
Update Permissions
Required to update LLM Provider
Project OwnerProject AdminProject MemberEdit LLM
Delete Permissions
Required to delete LLM Provider
Project OwnerProject AdminProject MemberDelete LLM