Create a session
curl --request POST \
--url https://api.tensorpro.ai/api/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Website planning"
}
'import requests
url = "https://api.tensorpro.ai/api/v1/sessions"
payload = { "title": "Website planning" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'Website planning'})
};
fetch('https://api.tensorpro.ai/api/v1/sessions', 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.tensorpro.ai/api/v1/sessions",
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([
'title' => 'Website planning'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.tensorpro.ai/api/v1/sessions"
payload := strings.NewReader("{\n \"title\": \"Website planning\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.tensorpro.ai/api/v1/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Website planning\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorpro.ai/api/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Website planning\"\n}"
response = http.request(request)
puts response.read_body{
"id": "1f6e3c2a-8b4d-4c7e-9a1f-5d3b7e9c2a4f",
"title": "Website planning",
"created_at": "2026-11-10T04:40:02+00:00"
}
Sessions
Create a session
Create a session and get its ID. Optional: EDN also creates a session the first time you use a new session_id.
POST
/
api
/
v1
/
sessions
Create a session
curl --request POST \
--url https://api.tensorpro.ai/api/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Website planning"
}
'import requests
url = "https://api.tensorpro.ai/api/v1/sessions"
payload = { "title": "Website planning" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'Website planning'})
};
fetch('https://api.tensorpro.ai/api/v1/sessions', 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.tensorpro.ai/api/v1/sessions",
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([
'title' => 'Website planning'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.tensorpro.ai/api/v1/sessions"
payload := strings.NewReader("{\n \"title\": \"Website planning\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.tensorpro.ai/api/v1/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Website planning\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorpro.ai/api/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Website planning\"\n}"
response = http.request(request)
puts response.read_body{
"id": "1f6e3c2a-8b4d-4c7e-9a1f-5d3b7e9c2a4f",
"title": "Website planning",
"created_at": "2026-11-10T04:40:02+00:00"
}
Use this endpoint to start a conversation and get an EDN-generated ID for it. It’s optional: you can also choose your own
See Error handling.
session_id, and EDN creates the session the first time you use it.
What EDN does
Creates the session and returns its ID.Required headers
| Header | Value | Description |
|---|---|---|
Authorization | Bearer YOUR_API_KEY | Your EDN API key. Create keys in the Console. See Authentication |
Content-Type | application/json | The request body is JSON |
Request
| Field | Type | Required | Description |
|---|---|---|---|
title | string | No | A title for the session. Default: “New conversation”. Titles longer than 200 characters are cut to 200 |
curl -X POST "https://api.tensorpro.ai/api/v1/sessions" \
-H "Authorization: Bearer $EDN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Website planning"
}'
import os
import requests
resp = requests.post(
"https://api.tensorpro.ai/api/v1/sessions",
headers={"Authorization": f"Bearer {os.environ['EDN_API_KEY']}"},
json={
"title": "Website planning"
},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.tensorpro.ai/api/v1/sessions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.EDN_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"title": "Website planning"
}),
});
console.log(await resp.json());
Response
200 OK
{
"id": "1f6e3c2a-8b4d-4c7e-9a1f-5d3b7e9c2a4f",
"title": "Website planning",
"created_at": "2026-11-10T04:40:02+00:00"
}
| Field | Type | Description |
|---|---|---|
id | string | Identifier for the new session. Use it as session_id in other calls |
title | string | The session’s title |
created_at | string (date-time) | When the session was created |
Errors
| Status | Code | When |
|---|---|---|
401 | UNAUTHORIZED | The API key is missing, invalid or revoked |
422 | VALIDATION_ERROR | The request body isn’t valid JSON |
429 | RATE_LIMITED | Per-minute limit reached. Retry after Retry-After seconds |
500 | INTERNAL_ERROR | Something failed on EDN’s side. Retry later |
{
"id": "1f6e3c2a-8b4d-4c7e-9a1f-5d3b7e9c2a4f",
"title": "Website planning",
"created_at": "2026-11-10T04:40:02+00:00"
}
Authorizations
Body
application/json
