API Reference
Welcome to Delos API Reference. Try and develop using the smartest Orchestration Models, which unleash:
- LLM chatting, streaming and embedding
- Translation Models
- Web Models
- Files Parsing and Querying
- Vision (to come)
Export Delos API Reference
Leverage LLM power with Delos API.
Export the Delos API Reference as text to use it in other applications or for offline reference.
Getting started?
Check out our Delos Platform Documentation guides and tutorials.
BASE URL
CLIENT LIBRARIES
INSTALL
# Get Delos package:
$ pip install delos
INITIALIZATION
from delos import DelosClient
delos_client = DelosClient(your-delos-api-key)
USE
response = delos_client.llm_chat(text="Hello Delos!", model="gpt-4o")
print(response)
LLM
Chat
/llm/chat
Chat with a LLM. Requires authentication using an API key.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI.
Body Parameters
text
stringThe message to be sent to the LLM.
model
stringThe model to chat with.
Options are gpt-4o-mini
, gpt-4o
, gpt-3.5
(legacy), command-r
, command-r-plus
, llama-3-70b-instruct
, mistral-large
, mistral-small
, claude-3.5-sonnet
, claude-3-haiku
messages
stringList of previous messages before this new message.
temperature
floatChoice of the randomness of the model, in between 0
and 1
. (Default value: 0.7
).
response_format
stringAllows to request response formatted as
-
JSON object (
response_format = {'type':'json_object'}
) -
or receive a text string (
response_format = {'type':'text'}
), (default behavior). Choosingtext
is equivalent to not specifying this parameter.
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
stringOutput of processed request. Contains the LLM answer.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/llm/chat
from delos import DelosClient
delos_client = DelosClient(api_key='my-delos-api-key')
response = delos_client.llm_chat(
text='And France? Respond in a JSON',
model='gpt-4o-mini',
# response_format={"type":"json_object"}, # uncomment for JSON response
messages="[
{'role':'system', 'content':'You are a helpful assistant.'},
{'role':'user', 'content':'what is the capital of Spain?'},
{'role':'assistant', 'content':'The capital of Spain is Madrid.'}
]"
)
print(response)
{
"request_id": "a7049c4f-a7cc-46d1-80e9-2b7ecb8b4a22",
"response_id": "792b9b3d-3650-4ef1-8d5a-7d4911427bea",
"status_code": 200,
"status": "success",
"message": "Chat response received. (All messages have been read)",
"data": "The capital city of France is Paris.",
"error": null,
"timestamp": "2024-12-03T14:36:53.029212Z",
"cost": 7e-05,
}
Chat Stream
/llm/chat_stream
Chat with a LLM (streaming). Requires authentication using an API key.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI.
Body Parameters
text
stringThe message to be sent to the LLM.
model
stringThe model to chat with.
Options are gpt-4o-mini
, gpt-4o
, gpt-3.5
(legacy),command-r
, command-r-plus
, llama-3-70b-instruct
, mistral-large
, mistral-small
, claude-3.5-sonnet
, claude-3-haiku
messages
stringList of previous messages before this new message.
temperature
floatChoice of the randomness of the model, in between 0
and 1
. (Default value: 0.7
).
response_format
stringAllows to request response formatted as
-
JSON object (
response_format = {"type":"json_object"}
) -
or receive a text string (
response_format = {"type":"text"}
), (default behavior). Choosingtext
is equivalent to not specifying this parameter.
request_usage
booleanReceive a JSON object at the end of the stream with request details. Default: False
.
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
stringOutput of processed request. Contains the LLM answer.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/llm/chat_stream
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.llm_chat_stream(
text="And France?",
model="gpt-4o-mini",
# response_format={"type":"json_object"}, # uncomment for JSON response
messages="[
{'role':'system', 'content':'You are a helpful assistant.'},
{'role':'user', 'content':'what is the capital of Spain?'},
{'role':'assistant', 'content':'The capital of Spain is Madrid.'}
]",
request_usage=False # 'request_usage=True' for usage tracking
)
print(response)
'0:""
'0:"The"
'0:" capital"
'0:" city"
'0:" of"
'0:" France"
'0:" is"
'0:" Paris"
'0:"."
# when usage_tracking=True, end of the stream is:
'2:'{ "id": "5f1490c4-66d1-45f8-a6d8-ce76498c4f07",
"choices": [{"delta": {}, "finish_reason": "stop"}],
"request_id": "5f1490c4-66d1-45f8-a6d8-ce76498c4f07",
"response_id": "431dd385-5941-4447-8f01-e293a2fb63d1",
"status_code": 200,
"status": "success",
"message": "Chat response received.
(All the 3 previous *messages* have been read.)",
"timestamp": "2025-03-04T09:03:20.252125+00:00",
"cost": 0.000465}'
Chat beta
/llm/chat/beta
Chat with a LLM. (Single endpoint for chat
and chat_stream
endpoints, by providing stream
parameter.)
Requires authentication using an API key.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI.
Body Parameters
text
stringThe message to be sent to the LLM.
model
stringThe model to chat with.
Options are gpt-4o-mini
, gpt-4o
, gpt-3.5
(legacy), command-r
, command-r-plus
, llama-3-70b-instruct
, mistral-large
, mistral-small
, claude-3.5-sonnet
, claude-3-haiku
messages
stringList of previous messages before this new message.
temperature
floatChoice of the randomness of the model, in between 0
and 1
. (Default value: 0.7
).
response_format
stringAllows to request response formatted as
-
JSON object (
response_format = {'type':'json_object'}
) -
or receive a text string (
response_format = {'type':'text'}
), (default behavior). Choosingtext
is equivalent to not specifying this parameter.
stream
booleanAllows to request LLM response as:
-
Response object (as in
/llm/chat
endpoint), default behavior, -
or streaming response (as in
/llm/chat_stream
endpoint).
request_usage
booleanReceive a JSON object at the end of the stream with request details. Default: False
.
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
stringOutput of processed request. Contains the LLM answer.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/llm/chat/beta
from delos import DelosClient
delos_client = DelosClient(api_key='my-delos-api-key')
response = delos_client.llm_chat(
text='And France? Respond in a JSON',
model='gpt-4o-mini',
# response_format={"type":"json_object"}, # uncomment for JSON response
messages=[
{"role":"system", "content":"You are a helpful assistant."},
{"role":"user", "content":"what is the capital of Spain?"},
{"role":"assistant", "content":"The capital of Spain is Madrid."}
],
stream=False, # 'stream=True' for streaming response
request_usage=False # 'request_usage=True' for usage tracking
)
print(response)
{
"request_id": "a7049c4f-a7cc-46d1-80e9-2b7ecb8b4a22",
"response_id": "792b9b3d-3650-4ef1-8d5a-7d4911427bea",
"status_code": 200,
"status": "success",
"message": "Chat response received. (All messages have been read)",
"data": "The capital city of France is Paris.",
"error": null,
"timestamp": "2024-12-03T14:36:53.029212Z",
"cost": 7e-05,
}
Embed text
/llm/embed
Generates an embedding for the provided text.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
text
stringText to be embedded
model
stringThe model to embed with. Options are ada-v2
, text-embedding-3-large
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
dictOutput of processed request. Contains the list of text blocks (since input text is split to fix embedder context-window), numbered from 0 onwards, with their embeddings.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/llm/embed
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.llm_embed(text="Hello world")
print(response)
{
"request_id":"6cbd9a37-8ffc-40ab-9f52-be4b35cafeb4",
"response_id":"ba740405-7854-48ff-8a13-d9075ebfb32e",
"status_code":200,
"status":"success",
"message":"Text successfully embedded.",
"data": {
"embedded_texts": [
{
"id": 0,
"text": "Hello world",
"embedding": [
-0.018942920491099358,
-0.012851867824792862,
...,
-0.01006540097296238,
0.0035288927610963583,
-0.013837556354701519
]
}
},
"error":null,
"timestamp":"2024-12-03T14:38:10.930607Z",
"cost":0.00017
}
Translate
Translate text
/translate-text
Translate a text using the specified output language.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI.
Body Parameters
text
stringThe text to be translated
output_language
stringISO 639-1 code of the target language
input_language
stringISO 639-1 code of the origin language. It is not required.
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
dictOutput of processed request.
translation
stringTranslated text
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/translate-text
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.translate_text(
text="Hello, how are you?",
output_language="fr",
)
print(response)
{
"message": "Request completed successfully",
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"response_id": "123e4567-e89b-12d3-a456-426614174001",
"status": "success",
"status_code": 200,
"data": {
"translation": "Hola, ¿cómo estás?"
},
"error": null,
"timestamp": "2024-10-15T13:32:34.727776Z",
"cost": 0.00002
}
Translate a file
/translate-file
Translate a file using the specified return type.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI.
Body Parameters
file
stringFile (path and name) to be translated
output_language
stringISO 639-1 code of the target language
input_language
stringISO 639-1 code of the origin language. It is not required.
return_type
stringThe format for the translation result. Options are:
-
url
to obtain a downloadable file, keeping original layout -
or
raw_text
which process just the text and not the whole file formatting (default).
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
dictOutput of processed request.
translation
textTranslated text (if raw_text
return type selected)
file_url
stringURL to download the translated file (if url
return type selected)
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/translate-file
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
local_filepath = "/path/to/file_name.docx"
response = delos_client.translate_file(
filepath=local_filepath,
output_language="it",
return_type="raw_text",
)
print(response)
{
"request_id": "a92aebfd-231b-4d7f-8721-369f4de4805e",
"response_id": "0fc761ce-963b-4459-9d46-3f15ca6eb911",
"status_code": 200,
"status": "success",
"message": "Translation completed successfully",
"data": {
"translation": "Ciao, questo è un documento di prova.",
"file_url": null,
},
"error": null,
"timestamp": "2024-10-16T07:25:41.793412Z",
"cost": 0.00004,
}
Files Index
List Index
/files/list_index
Lists all index that are active
or in countdown
for the organization with their details.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
arrayOutput of processed request. Contains a list of index available in current organization including index_uuid, created_at, expires_at, status, and vectorized status
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/list_index
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.files_index_list()
print(response)
{
"request_id": "1fb2732b-3632-4c61-bcb7-25078c9b3d87",
"response_id": "4fc9c0ae-3fae-4725-a25c-28161dc8ea89",
"status_code": 200,
"status": "success",
"message": "Retrieved 2 indices.",
"data": {
"indices": [
{
"index_uuid": "277bed11-c6a1-4d5e-98f2-7dd9737e",
"name": "Financial reports",
"status": "active",
"vectorized": false,
"created_at": "2024-12-03T11:29:11.234237+00:00",
"updated_at": "2024-12-03T11:29:11.234242+00:00",
"expires_at": null,
"storage": {
"size_bytes": 147086,
"size_mb": 0.14,
"num_files": 1,
},
},
{
"index_uuid": "0850f0d1-72d5-4f2a-80f3-6718c5cd6",
"name": "Resarch Articles",
"status": "countdown",
"vectorized": true,
"created_at": "2024-12-02T16:30:55.310428+00:00",
"updated_at": "2024-12-03T11:06:53.366713+00:00",
"expires_at": "2024-12-03T15:07:53.129516+00:00",
"storage": {
"size_bytes": 26385089,
"size_mb": 25.16,
"num_files": 7,
},
},
],
"total_storage": {
"bytes": 27648191,
"mb": 26.37,
"limit_mb": 100,
"usage_percentage": 26.4,
},
},
"error": null,
"timestamp": "2024-12-03T14:03:26.680425Z",
"cost": 0.0,
}
Index Details
/files/index_details
Fetches details about a specified index, such as its current status, expiration time, vectorization state, and a list of files it contains.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Query Parameters
index_uuid
stringThe unique id for this files Index
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
stringOutput of processed request. Index details including index_uuid, vectorized status, status, expires_at, and files list
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/index_details
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.files_index_details(
index_uuid="35d885a5-fc92-4ae5-b030",
)
print(response)
{
"request_id":"e08e604b-356b-4f24-b497-058c2410a034",
"response_id":"8341bb51-7574-4281-bc76-27e150456e65",
"status_code":200,
"status":"success",
"message":"Index 35d885a5-fc92-4ae5-b030 details retrieved.",
"data":{
"index_uuid":"277bed11-c6a1-4d5e-98f2-7dd9737ee881",
"name":"Financial Reports",
"vectorized":false,
"status":"active",
"expires_at":null,
"created_at":"2024-12-03T11:29:11.234237+00:00",
"updated_at":"2024-12-06T08:32:01.732122+00:00",
"storage":
{
"size_bytes":83503,
"size_mb":0.08,
"num_files":3
},
"files":[
{
"file_id":"3c67b758c34d1e316c2968ed68b96",
"file_name":"Q3_2023_Financial_Report.pdf",
"size":2743841
},
{
"file_id":"8dab82b1f69972cb9d9d4261b20d5",
"file_name":"Presentation.pptx",
"size":1178274
},
{
"file_id":"c0d5aaf3791eeee1001e50f9377",
"file_name":"Investment_Report_2023.docx",
":28620
}
]
},
"error":null,
"timestamp":"2024-12-06T09:33:40.459524Z",
"cost":0.0
}
Create Index
/files/create_index_and_parse
Creates an index for the uploaded files and parses their content.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
name
stringName for the index
files
arrayList of files to be uploaded and indexed
read_images
booleanChoice to scan the images and graphic elements in the file. (Default: False
)
tags
textList of tags to be enabled for this index.
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
stringOutput of processed request. Contains the information about processed files.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/create_index_and_parse
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
filepaths = [
"/path/to/file1.docx",
"/path/to/file2.pdf",
"/path/to/file3.txt",
]
response = delos_client.files_index_create(
filepaths=filepaths,
name="My Files Index",
)
print(response)
{
"request_id": "fa86ced4-eb83-4c7d-afbf-57a00f952889",
"response_id": "4d2d91fa-75aa-4c68-b903-16a92a84a80d",
"status_code": 200,
"status": "success",
"message": "Index created successfully",
"data": {
"index_uuid": "277bed11-c6a1-4d5e-98f2-7dd9737ee881",
"name": "My Files Index",
"created_at": "2024-12-03T11:29:11.234237+00:00",
"updated_at": "2024-12-03T11:29:11.234242+00:00",
"vectorized": "False",
"status": "active",
"files": {
"26a79e1e7233ef12c763c4a0e6b322168c": {
"file_id": "26a7-9e1e7233-ef12c763c4a0-e6b322168c",
"file_name": "file1.docx",
"size": 147086,
},
"127a213247f5b08eecb212b28775e521f6": {
"file_id": "127a2-13247f5b08e-ecb212b28-775e521f6",
"file_name": "file2.pdf",
"size": 147086,
},
"f66d2345d7c64ea7e46806b81bf2649b9": {
"file_id": "f66d23-45d7c64ea7e4-6806b81b-f2649b9",
"file_name": "file3.txt",
"size": 147086,
},
},
},
"error": null,
"timestamp": "2024-12-03T13:51:19.123547Z",
"cost": 0.0027,
}
Add Files To Index
/files/add_files_to_index
Adds new files to an existing index.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
index_uuid
stringThe unique id for this files Index
files
arrayArray of files to be added to the index
read_images
booleanChoice to scan the images and graphic elements in the file. (Default: False)
tags
stringArray of tags to be appied to all files in this operation
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
dictOutput of processed request. Contains the details of newly processed files.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/add_files_to_index
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
filepaths = [
"/path/to/file1.docx",
"/path/to/file2.pdf",
"/path/to/file3.txt",
]
response = delos_client.files_index_add_files(
index_uuid="d01fab70-124e-440f-bb4a-397b32ff00cb",
filepaths=filepaths,
tags=["quarterly", "Q1", "2024"],
)
print(response)
{
"request_id": "53c5e71a-6616-4e99-87bb-f4247111907f",
"response_id": "1f5a8543-b892-4085-9147-5d9930665ee9",
"status_code": 200,
"status": "success",
"message": "Files added and processed successfully",
"data": {
"index_uuid": "d01fab70-124e-440f-bb4a-397b32ff00cb",
"new_files": ["127a213247f5b08eecb212b28775e"],
"processed_chunks": 2,
},
"error": null,
"timestamp": "2024-12-06T08:32:01.743056Z",
"cost": 0.001,
}
Embed Index
/files/embed_index
Vectorize Index Content. Calculates the vectorized representations of all text contents within the specified index.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
index_uuid
stringThe unique id for this files Index
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
stringOutput of processed request.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/embed_index
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.files_index_embed(
index_uuid="e5c156e2-aa64-4c7b-9f3e",
)
print(response)
{
"request_id": "a1fc8f56-79d8-428a-9b04-e69e5cdc16b2",
"response_id": "6bee942a-b792-4e1e-aa61-31721c9edb1e",
"status_code": 200,
"status": "success",
"message": "Index 'e5c15...-9f3e' successfully vectorized.",
"data": {
"index_uuid": "e5c156e2-aa64-4c7b-9f3e",
},
"error": null,
"timestamp": "2024-12-03T13:39:32.689477Z",
"cost": 0.00034,
}
Ask Index
/files/ask_index
Queries a vectorized index for information related to a given question.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
index_uuid
stringUUID of the Index to be queried
question
stringQuestion about the documents in the index
output_language
stringDesired output language code
active_files
multiselectComma-separated list of file ids belonging to this Index to be considered in this research.
tags
textList of files tags that are enabled for this research. Only tags assigned by the user are considered (tags_user
), and not the suggested tags (tags_auto
) proposed while uploading files.
-
Files having at least one of these
tags_user
will be considered in this research. -
Files having no
tags_user
assigned by the user will be considered as no match, and therefore not included in this research.
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
dictOutput of processed request. Contains the response to the question, and the used files sources dictionary.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/ask_index
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.files_index_ask(
index_uuid="f2503e3e-676a-4673-8ed5-cd7c8b627cea",
question="Where is the mentioned power station located?",
output_language="en",
tags="energy"
)
print(response)
{
"request_id": "cffa76cd-87c9-4617-9290-af43671e069e",
"response_id": "4607b131-1e31-4c1b-aca8-34138cdb46b6",
"status_code": 200,
"status": "success",
"message": "File(s) deleted from index successfully",
"data": {
"index_uuid": "d01fab70-124e-440f-bb4a-397b32ff00cb",
"remaining_files": [
"c0d5aaf3791eeee1001eff515a822206ab8df5650f93771ca",
"f66d2345d7c64ea7e46806b81bf2649b9ffcfc78428feba00",
],
},
"error": null,
"timestamp": "2024-12-03T14:26:19.919794Z",
"cost": 0.0,
}
Delete Files
/files/delete_files_from_index
Deletes specific files from an existing index using their file ids.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
index_uuid
stringThe unique ID for this files Index
files_ids
arrayList of file IDs to delete from the index
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
dictOutput of processed request. Contains the list of remaining files.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/delete_files_from_index
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
file_id1 = "127a2-13247f5b08eec-b212b28775-e521f69"
response = delos_client.files_index_delete_files(
index_uuid="d01fab70-124e-440f-bb4a-397b32ff00cb",
files_ids=[file_id1, file_id2],
)
print(response)
{
"message": "Request completed successfully",
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"response_id": "123e4567-e89b-12d3-a456-426614174001",
"status": "success",
"status_code": 200,
"data": {
"answer": "Station is located in Oldbury ('FILE:1').",
"sources": {
1: "file_id1",
2: "file_id2",
},
},
"timestamp": "2024-10-15T13:32:34.727776Z",
}
Delete Index
/files/delete_index
Marks an existing index for deletion.
Warning
: This operation will be effective after 2h.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
index_uuid
stringThe unique ID for the files index
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
stringOutput of processed request.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/delete_index
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.files_index_delete(
index_uuid="277bed11-c6a1-4d5e-98f2",
)
print(response)
{
"request_id": "c2957b77-34f7-467a-8bb5-0f2f7c517dee",
"response_id": "06655901-e06c-4e0c-a28f-6143fa034143",
"status_code": 200,
"status": "success",
"message": "Index marked for deletion",
"data": {
"index_uuid": "277bed11-c6a1-4d5e-98f2",
"expires_at": "2024-12-03T16:32:31.779965+00:00",
},
"error": null,
"timestamp": "2024-12-03T14:32:31.779965Z",
"cost": 0.0,
}
Rename Index
/files/rename_index
Renames an existing index based on the provided index UUID.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
index_uuid
stringUUID of the Index to be renamed.
name
stringNew name for the index.
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
stringOutput of processed request. Contains the new name for the index and the old name.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/rename_index
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.files_index_rename(
index_uuid="0850f0d1-72d5-4f2a-80f3-6718c5cd6933",
name="New name",
)
print(response)
{
"message": "Index name 'Old name' changed to 'New name'.",
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"response_id": "123e4567-e89b-12d3-a456-426614174001",
"status": "success",
"status_code": 200,
"index_uuid": "0850f0d1-72d5-4f2a-80f3-6718c5cd6933",
"old_name": "Old name",
"new_name": "New name",
"updated_at": "2024-10-15T13:32:34.727776Z",
}
Restore Index
/files/restore_index
Cancels the deletion or expiry of an index within the 2h from the delete_index request.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
index_uuid
stringThe unique ID for this files Index
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
stringOutput of processed request.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/restore_index
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.files_index_restore(
index_uuid="123e4567-e89b-12d3-a456",
)
print(response)
{
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"response_id": "123e4567-e89b-12d3-a456-426614174001",
"status_code": 200,
"status": "success",
"message": "Index restored successfully",
"data": {
"index_uuid": "123e4567-e89b-12d3-a456",
"status": "active",
},
"timestamp": "2024-11-18T12:00:00Z",
}
Files Index Tags
Get Index Tags
/files/get_index_tags
Retrieves the tags for an index.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Query Parameters
index_uuid
stringThe unique id for this files Index
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
dictOutput of processed request. Contains the index tags information.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/get_index_tags
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.files_get_index_tags(
index_uuid="0000-0000-0000-0000"
)
print(response)
{
"request_id": "f251c467-58bb-4686-a965-5686322b53a7",
"response_id": "5f15975c-780d-47c1-86e1-0185af5efa0c",
"status_code": 200,
"status": "success",
"message": "Tags information for index 0000-0000-0000-0000",
"data": "Index 0000-0000-0000-0000 predefined tags:
['research', 'financial', 'reports'].
Files in index have these tags:
file1.pdf: ['quarterly', 'finance'],
file2.docx: ['annual', 'report']",
"error": null,
"timestamp": "2024-12-03T14:12:46.462944Z",
"cost": 0.0
}
Update Index Tags
/files/update_index_tags
Updates the tags of an existing index.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
index_uuid
stringThe unique id for the files index
tags
arrayThe list of tags to be added to the index
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
dictOutput of processed request containing the index UUID and updated tags.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/update_index_tags
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.files_update_index_tags(
index_uuid="0000-0000-0000-0000",
tags=["research", "finance", "quarterly"]
)
print(response)
{
"message": "Request completed successfully",
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"response_id": "123e4567-e89b-12d3-a456-426614174001",
"status": "success",
"status_code": 200,
"data": {
"answer": "Station is located in Oldbury ('FILE:1').",
"sources": {
1: "file_id1",
2: "file_id2",
},
},
"timestamp": "2024-10-15T13:32:34.727776Z",
}
Update File Tags
/files/update_index_files_tags
Updates the tags of a specific file within an index.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
index_uuid
stringThe unique id for the files index
files_ids
string | list[string]The ID of the file or files to update tags for
tags
arrayThe list of tags to be added to the file
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
stringOutput of processed request.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/files/update_index_files_tags
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.files_update_files_tags(
index_uuid="0000-0000-0000-0000",
files_ids=["abc123"],
tags=["quarterly", "finance", "2024"]
)
print(response)
{
"request_id": "c2957b77-34f7-467a-8bb5-0f2f7c517dee",
"response_id": "06655901-e06c-4e0c-a28f-6143fa034143",
"status_code": 200,
"status": "success",
"message": "Index marked for deletion",
"data": {
"index_uuid": "0000-0000-0000-0000",
"file_id": "[abc123]",
"file_name": "financial_report_q1.pdf",
"tags": ["quarterly", "finance", "2024"],
"suggested_tags": ["report", "financial", "q1"]
},
"error": null,
"timestamp": "2024-12-03T14:32:31.779965Z",
"cost": 0.0,
}
Web
Search
/search
Perform a web search using the provided text and output language.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Body Parameters
text
stringRequest to be searched.
output_language
stringOutput language code.
desired_urls
arrayComma-separated list of URLs to be priviledged in the search.
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringShort output description after processing the request.
data
dictOutput of processed request. Contains the reformulation of the question, the sources URLs on which the answer is based, and the answer obtained.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/search
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.web_search(
text="What is the capital of France?",
output_language="en",
desired_urls=["wikipedia.fr"]
)
print(response)
{
"request_id": "8f032022-8391-4036-8707-63a955d4518d",
"response_id": "72495910-cbaf-434c-89c2-401590251adf",
"status_code": 200,
"status": "success",
"message": "Search completed successfully",
"data": {
"reformulation": "What is the capital of France?",
"urls": [
"https://www.example.com/paris",
"https://www.travel.example/france",
],
"answer": "The capital of France is Paris 'URL:1'...",
},
"error": null,
"timestamp": "2024-12-03T14:19:47.081348Z",
"cost": 0.0042,
}
Status
Health
/health
Check the health status of the API.
Headers
Authorization
stringAPI key to authenticate requests to DelosAPI
Returns
request_id
stringUnique ID for this request.
response_id
stringUnique ID for this response.
status
stringSuccess or failure of the request.
status_code
integerHTTP status code.
message
stringHealth status of the API.
data
stringOutput of processed request.
error
dictErrors description, if any. Default is null
.
timestamp
stringTimestamp of the response.
cost
floatCost of processed request.
/health
from delos import DelosClient
delos_client = DelosClient(api_key="my-delos-api-key")
response = delos_client.status_health()
print(response)
{
"request_id": "849f6bde-375f-47e2-9977-8a3e521088b9",
"response_id": "c5761413-b79a-412c-b324-95ce8dcf4d18",
"status_code": 200,
"status": "success",
"message": "Welcome to DelosAPI",
"data": null,
"error": null,
"timestamp": "2024-12-03T14:22:58.671943Z",
"cost": 0.0,
}