Totoy Api
Explanation
Knowledge Bases
- GETReturns a list of Knowledge Bases.
- POSTCreates a Knowledge Base.
- GETRetrieves a Knowledge Base.
- DELDeletes a Knowledge Base.
- PATCHModifies a Knowledge Base.
- POSTCreates a Knowledge Base Chat Response for the given Messages.
- GETReturns a list of Knowledge Base Sources.
- POSTAdds Sources to a Knowledge Base.
- GETRetrieves a Knowledge Base Source.
- DELRemoves a Knowledge Base Source from a Knowledge Base.
Sources
Projects
Organization
Returns a list of Projects.
curl --request GET \
--url https://api.totoy.ai/v1/projects \
--header 'Authorization: Bearer <token>'
{
"data": [
{
"project_id": "pj_avX7imfLaPcQnv5ckvGlOEBA9",
"name": "Totoy GmbH Project",
"created_at": "2023-07-05T12:34:13Z",
"updated_at": "2024-01-05T12:00:00Z",
"knowledge_base_ids": [
"kb_feMfJbeqbAEj4u8K5HqmKpUbY",
"kb_kfjd34sfgsd2gfskijuh23zgt"
],
"source_ids": [
"src_oXiYDg8QOc9JsOk86idRXiywD",
"src_qoY7rSGkiWtn4NP8kPXc7xzrq"
],
"is_default": false,
"usage": {
"assistant_messages": {
"knowledge_bases_chats": 1354,
"explanations": 1234,
"total": 2588
},
"document_sources_pages": 2534,
"text_sources": 3756
}
},
{
"project_id": "pj_bxW8jnfoMbRQow6dlHmPIRCA2",
"name": "Default Project",
"created_at": "2023-07-05T12:34:13Z",
"updated_at": "2023-07-05T12:34:13Z",
"knowledge_base_ids": [],
"source_ids": [],
"is_default": true,
"usage": {
"assistant_messages": {
"knowledge_bases_chats": 4321,
"explanations": 5634,
"total": 9955
},
"document_sources_pages": 5342,
"text_sources": 7563
}
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Response
A list of Projects
.
A list of Projects
.
A project is a collection of Sources
and Knowledge Bases
with the same lifespan. If a project is deleted, all associated resources will also be deleted. Explanations
can also be assigned to Projects
for billing purposes.
The unique identifier of a Project
28
"pj_avX7imfLaPcQnv5ckvGlOEBA9"
The name of the Project
256
"Totoy GmbH Project"
Date-time of when the Project
was created, in ISO 8601 format
"2023-07-05T12:34:13Z"
Date-time of when the Project
was last modified, in ISO 8601 format
"2023-07-05T12:34:13Z"
A list of knowledge_base_ids
that are assigned to the Project
. One Project
can have multiple Knowledge Bases
.
[]
A list of source_ids
of Sources
that are assigned to the Project
.
Unique identifier for a Source
that is assigned to the Project
.
[
"src_oXiYDg8QOc9JsOk86idRXiywD",
"src_qoY7rSGkiWtn4NP8kPXc7xzrq"
]
Whether the Project
is the default Project
for the Organization
. The default Project
is used when no Project
is specified in an API request. The default Project
cannot be deleted.
false
The usage of the Project
.
The number of Messages
with the role assistant
, used by the Project
in the current billing period.
The number of Knowledge Base Chat Messages
with the role assistant
, used by the Project
in the current billing period.
1354
The number of Explanation Messages
with the role assistant
, used by the Project
in the current billing period.
1234
The total number of Messages
with the role assistant
, used by the Project
in the current billing period.
2588
The number of Document Sources
pages stored in the Project
.
2534
The amount of Text Sources
stored in the Project
.
3756
{
"assistant_messages": {
"knowledge_bases_chats": 1354,
"explanations": 1234,
"total": 2588
},
"document_sources_pages": 2534,
"text_sources": 3756
}
curl --request GET \
--url https://api.totoy.ai/v1/projects \
--header 'Authorization: Bearer <token>'
{
"data": [
{
"project_id": "pj_avX7imfLaPcQnv5ckvGlOEBA9",
"name": "Totoy GmbH Project",
"created_at": "2023-07-05T12:34:13Z",
"updated_at": "2024-01-05T12:00:00Z",
"knowledge_base_ids": [
"kb_feMfJbeqbAEj4u8K5HqmKpUbY",
"kb_kfjd34sfgsd2gfskijuh23zgt"
],
"source_ids": [
"src_oXiYDg8QOc9JsOk86idRXiywD",
"src_qoY7rSGkiWtn4NP8kPXc7xzrq"
],
"is_default": false,
"usage": {
"assistant_messages": {
"knowledge_bases_chats": 1354,
"explanations": 1234,
"total": 2588
},
"document_sources_pages": 2534,
"text_sources": 3756
}
},
{
"project_id": "pj_bxW8jnfoMbRQow6dlHmPIRCA2",
"name": "Default Project",
"created_at": "2023-07-05T12:34:13Z",
"updated_at": "2023-07-05T12:34:13Z",
"knowledge_base_ids": [],
"source_ids": [],
"is_default": true,
"usage": {
"assistant_messages": {
"knowledge_bases_chats": 4321,
"explanations": 5634,
"total": 9955
},
"document_sources_pages": 5342,
"text_sources": 7563
}
}
]
}