Create Index
curl --request POST \
--url https://api.example.com/v1/projects/{project_id}/indexes \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-selected-account-id: <api-key>' \
--data '
{
"name": "<string>",
"model": "openai/gpt-5.2",
"file_summarization_prompt": "<string>",
"folder_summarization_prompt": "<string>",
"engine_type": "file_system"
}
'import requests
url = "https://api.example.com/v1/projects/{project_id}/indexes"
payload = {
"name": "<string>",
"model": "openai/gpt-5.2",
"file_summarization_prompt": "<string>",
"folder_summarization_prompt": "<string>",
"engine_type": "file_system"
}
headers = {
"x-api-key": "<api-key>",
"x-selected-account-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-selected-account-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
model: 'openai/gpt-5.2',
file_summarization_prompt: '<string>',
folder_summarization_prompt: '<string>',
engine_type: 'file_system'
})
};
fetch('https://api.example.com/v1/projects/{project_id}/indexes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/projects/{project_id}/indexes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'model' => 'openai/gpt-5.2',
'file_summarization_prompt' => '<string>',
'folder_summarization_prompt' => '<string>',
'engine_type' => 'file_system'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-selected-account-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/projects/{project_id}/indexes"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"model\": \"openai/gpt-5.2\",\n \"file_summarization_prompt\": \"<string>\",\n \"folder_summarization_prompt\": \"<string>\",\n \"engine_type\": \"file_system\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-selected-account-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/projects/{project_id}/indexes")
.header("x-api-key", "<api-key>")
.header("x-selected-account-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"model\": \"openai/gpt-5.2\",\n \"file_summarization_prompt\": \"<string>\",\n \"folder_summarization_prompt\": \"<string>\",\n \"engine_type\": \"file_system\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/projects/{project_id}/indexes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-selected-account-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"model\": \"openai/gpt-5.2\",\n \"file_summarization_prompt\": \"<string>\",\n \"folder_summarization_prompt\": \"<string>\",\n \"engine_type\": \"file_system\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"project_id": "<string>",
"name": "<string>",
"engine_type": "file_system",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "pending",
"config": {},
"nodes": [
{
"id": "<string>",
"text": "<string>",
"level": 123,
"parent_id": "<string>",
"metadata": {},
"children_ids": [
"<string>"
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Indexes
Create Index
Create an empty index (synchronous).
Allocates the DB record, writes an empty serialized engine to blob
storage with the provided config, and marks the index ready. Files
are added later via POST /indexes/{index_id}/files (which kicks off
a batch-mutation workflow).
POST
/
v1
/
projects
/
{project_id}
/
indexes
Create Index
curl --request POST \
--url https://api.example.com/v1/projects/{project_id}/indexes \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-selected-account-id: <api-key>' \
--data '
{
"name": "<string>",
"model": "openai/gpt-5.2",
"file_summarization_prompt": "<string>",
"folder_summarization_prompt": "<string>",
"engine_type": "file_system"
}
'import requests
url = "https://api.example.com/v1/projects/{project_id}/indexes"
payload = {
"name": "<string>",
"model": "openai/gpt-5.2",
"file_summarization_prompt": "<string>",
"folder_summarization_prompt": "<string>",
"engine_type": "file_system"
}
headers = {
"x-api-key": "<api-key>",
"x-selected-account-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-selected-account-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
model: 'openai/gpt-5.2',
file_summarization_prompt: '<string>',
folder_summarization_prompt: '<string>',
engine_type: 'file_system'
})
};
fetch('https://api.example.com/v1/projects/{project_id}/indexes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/projects/{project_id}/indexes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'model' => 'openai/gpt-5.2',
'file_summarization_prompt' => '<string>',
'folder_summarization_prompt' => '<string>',
'engine_type' => 'file_system'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-selected-account-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/projects/{project_id}/indexes"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"model\": \"openai/gpt-5.2\",\n \"file_summarization_prompt\": \"<string>\",\n \"folder_summarization_prompt\": \"<string>\",\n \"engine_type\": \"file_system\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-selected-account-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/projects/{project_id}/indexes")
.header("x-api-key", "<api-key>")
.header("x-selected-account-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"model\": \"openai/gpt-5.2\",\n \"file_summarization_prompt\": \"<string>\",\n \"folder_summarization_prompt\": \"<string>\",\n \"engine_type\": \"file_system\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/projects/{project_id}/indexes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-selected-account-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"model\": \"openai/gpt-5.2\",\n \"file_summarization_prompt\": \"<string>\",\n \"folder_summarization_prompt\": \"<string>\",\n \"engine_type\": \"file_system\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"project_id": "<string>",
"name": "<string>",
"engine_type": "file_system",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "pending",
"config": {},
"nodes": [
{
"id": "<string>",
"text": "<string>",
"level": 123,
"parent_id": "<string>",
"metadata": {},
"children_ids": [
"<string>"
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Create request for the file-system index engine.
Response
Successful Response
Full index entity with nodes and config (returned by get by ID).