Python
import honeyhive
from honeyhive.models import components, operations
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.session.start_session(request=operations.StartSessionRequestBody(
session=components.SessionStartRequest(
project='Simple RAG Project',
session_name='Playground Session',
source='playground',
session_id='caf77ace-3417-4da4-944d-f4a0688f3c23',
children_ids=[
'7f22137a-6911-4ed3-bc36-110f1dde6b66',
],
inputs={
'context': 'Hello world',
'question': 'What is in the context?',
'chat_history': [
{
'role': 'system',
'content': 'Answer the user\'s question only using provided context.
Context: Hello world',
},
{
'role': 'user',
'content': 'What is in the context?',
},
],
},
outputs={
'role': 'assistant',
'content': 'Hello world',
},
error=None,
duration=824.8056,
user_properties={
'user': 'google-oauth2|111840237613341303366',
},
metrics={
},
feedback={
},
metadata={
},
start_time=1712025501605,
end_time=1712025499832,
),
))
if res.object is not None:
# handle response
passimport { HoneyHive } from "honeyhive";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const res = await sdk.session.startSession({
session: {
project: "Simple RAG Project",
sessionName: "Playground Session",
source: "playground",
sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
childrenIds: [
"7f22137a-6911-4ed3-bc36-110f1dde6b66",
],
config: {
"key": "<value>",
},
inputs: {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user's question only using provided context.
Context: Hello world",
},
{
"role": "user",
"content": "What is in the context?",
},
],
},
outputs: {
"role": "assistant",
"content": "Hello world",
},
error: null,
duration: 824.8056,
userProperties: {
"user": "google-oauth2|111840237613341303366",
},
metrics: {
},
feedback: {
},
metadata: {
},
startTime: 1712025501605,
endTime: 1712025499832,
},
});
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request POST \
--url https://api.honeyhive.ai/session/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"session": {
"project": "Simple RAG Project",
"source": "playground",
"event_type": "session",
"session_name": "Playground Session",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"event_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"parent_id": null,
"children_ids": [
"7f22137a-6911-4ed3-bc36-110f1dde6b66"
],
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user's question only using provided context.\n\nContext: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"start_time": 1712025501605,
"end_time": 1712025499832,
"duration": 824.8056,
"metrics": {},
"feedback": {},
"metadata": {},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
}
EOFconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
session: {
project: 'Simple RAG Project',
source: 'playground',
event_type: 'session',
session_name: 'Playground Session',
session_id: 'caf77ace-3417-4da4-944d-f4a0688f3c23',
event_id: 'caf77ace-3417-4da4-944d-f4a0688f3c23',
parent_id: null,
children_ids: ['7f22137a-6911-4ed3-bc36-110f1dde6b66'],
inputs: {
context: 'Hello world',
question: 'What is in the context?',
chat_history: [
{
role: 'system',
content: 'Answer the user\'s question only using provided context.\n\nContext: Hello world'
},
{role: 'user', content: 'What is in the context?'}
]
},
outputs: {role: 'assistant', content: 'Hello world'},
error: null,
start_time: 1712025501605,
end_time: 1712025499832,
duration: 824.8056,
metrics: {},
feedback: {},
metadata: {},
user_properties: {user: 'google-oauth2|111840237613341303366'}
}
})
};
fetch('https://api.honeyhive.ai/session/start', 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.honeyhive.ai/session/start",
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([
'session' => [
'project' => 'Simple RAG Project',
'source' => 'playground',
'event_type' => 'session',
'session_name' => 'Playground Session',
'session_id' => 'caf77ace-3417-4da4-944d-f4a0688f3c23',
'event_id' => 'caf77ace-3417-4da4-944d-f4a0688f3c23',
'parent_id' => null,
'children_ids' => [
'7f22137a-6911-4ed3-bc36-110f1dde6b66'
],
'inputs' => [
'context' => 'Hello world',
'question' => 'What is in the context?',
'chat_history' => [
[
'role' => 'system',
'content' => 'Answer the user\'s question only using provided context.
Context: Hello world'
],
[
'role' => 'user',
'content' => 'What is in the context?'
]
]
],
'outputs' => [
'role' => 'assistant',
'content' => 'Hello world'
],
'error' => null,
'start_time' => 1712025501605,
'end_time' => 1712025499832,
'duration' => 824.8056,
'metrics' => [
],
'feedback' => [
],
'metadata' => [
],
'user_properties' => [
'user' => 'google-oauth2|111840237613341303366'
]
]
]),
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.honeyhive.ai/session/start"
payload := strings.NewReader("{\n \"session\": {\n \"project\": \"Simple RAG Project\",\n \"source\": \"playground\",\n \"event_type\": \"session\",\n \"session_name\": \"Playground Session\",\n \"session_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"event_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"parent_id\": null,\n \"children_ids\": [\n \"7f22137a-6911-4ed3-bc36-110f1dde6b66\"\n ],\n \"inputs\": {\n \"context\": \"Hello world\",\n \"question\": \"What is in the context?\",\n \"chat_history\": [\n {\n \"role\": \"system\",\n \"content\": \"Answer the user's question only using provided context.\\n\\nContext: Hello world\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is in the context?\"\n }\n ]\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"error\": null,\n \"start_time\": 1712025501605,\n \"end_time\": 1712025499832,\n \"duration\": 824.8056,\n \"metrics\": {},\n \"feedback\": {},\n \"metadata\": {},\n \"user_properties\": {\n \"user\": \"google-oauth2|111840237613341303366\"\n }\n }\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.honeyhive.ai/session/start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session\": {\n \"project\": \"Simple RAG Project\",\n \"source\": \"playground\",\n \"event_type\": \"session\",\n \"session_name\": \"Playground Session\",\n \"session_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"event_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"parent_id\": null,\n \"children_ids\": [\n \"7f22137a-6911-4ed3-bc36-110f1dde6b66\"\n ],\n \"inputs\": {\n \"context\": \"Hello world\",\n \"question\": \"What is in the context?\",\n \"chat_history\": [\n {\n \"role\": \"system\",\n \"content\": \"Answer the user's question only using provided context.\\n\\nContext: Hello world\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is in the context?\"\n }\n ]\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"error\": null,\n \"start_time\": 1712025501605,\n \"end_time\": 1712025499832,\n \"duration\": 824.8056,\n \"metrics\": {},\n \"feedback\": {},\n \"metadata\": {},\n \"user_properties\": {\n \"user\": \"google-oauth2|111840237613341303366\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/session/start")
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 \"session\": {\n \"project\": \"Simple RAG Project\",\n \"source\": \"playground\",\n \"event_type\": \"session\",\n \"session_name\": \"Playground Session\",\n \"session_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"event_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"parent_id\": null,\n \"children_ids\": [\n \"7f22137a-6911-4ed3-bc36-110f1dde6b66\"\n ],\n \"inputs\": {\n \"context\": \"Hello world\",\n \"question\": \"What is in the context?\",\n \"chat_history\": [\n {\n \"role\": \"system\",\n \"content\": \"Answer the user's question only using provided context.\\n\\nContext: Hello world\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is in the context?\"\n }\n ]\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"error\": null,\n \"start_time\": 1712025501605,\n \"end_time\": 1712025499832,\n \"duration\": 824.8056,\n \"metrics\": {},\n \"feedback\": {},\n \"metadata\": {},\n \"user_properties\": {\n \"user\": \"google-oauth2|111840237613341303366\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "<string>"
}Session
Start a new session (deprecated)
Deprecated. Use POST /v1/sessions instead. The legacy route wraps the session object under a session key; the v1 route accepts a bare session object.
POST
/
session
/
start
Python
import honeyhive
from honeyhive.models import components, operations
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.session.start_session(request=operations.StartSessionRequestBody(
session=components.SessionStartRequest(
project='Simple RAG Project',
session_name='Playground Session',
source='playground',
session_id='caf77ace-3417-4da4-944d-f4a0688f3c23',
children_ids=[
'7f22137a-6911-4ed3-bc36-110f1dde6b66',
],
inputs={
'context': 'Hello world',
'question': 'What is in the context?',
'chat_history': [
{
'role': 'system',
'content': 'Answer the user\'s question only using provided context.
Context: Hello world',
},
{
'role': 'user',
'content': 'What is in the context?',
},
],
},
outputs={
'role': 'assistant',
'content': 'Hello world',
},
error=None,
duration=824.8056,
user_properties={
'user': 'google-oauth2|111840237613341303366',
},
metrics={
},
feedback={
},
metadata={
},
start_time=1712025501605,
end_time=1712025499832,
),
))
if res.object is not None:
# handle response
passimport { HoneyHive } from "honeyhive";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const res = await sdk.session.startSession({
session: {
project: "Simple RAG Project",
sessionName: "Playground Session",
source: "playground",
sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
childrenIds: [
"7f22137a-6911-4ed3-bc36-110f1dde6b66",
],
config: {
"key": "<value>",
},
inputs: {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user's question only using provided context.
Context: Hello world",
},
{
"role": "user",
"content": "What is in the context?",
},
],
},
outputs: {
"role": "assistant",
"content": "Hello world",
},
error: null,
duration: 824.8056,
userProperties: {
"user": "google-oauth2|111840237613341303366",
},
metrics: {
},
feedback: {
},
metadata: {
},
startTime: 1712025501605,
endTime: 1712025499832,
},
});
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request POST \
--url https://api.honeyhive.ai/session/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"session": {
"project": "Simple RAG Project",
"source": "playground",
"event_type": "session",
"session_name": "Playground Session",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"event_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"parent_id": null,
"children_ids": [
"7f22137a-6911-4ed3-bc36-110f1dde6b66"
],
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user's question only using provided context.\n\nContext: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"start_time": 1712025501605,
"end_time": 1712025499832,
"duration": 824.8056,
"metrics": {},
"feedback": {},
"metadata": {},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
}
EOFconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
session: {
project: 'Simple RAG Project',
source: 'playground',
event_type: 'session',
session_name: 'Playground Session',
session_id: 'caf77ace-3417-4da4-944d-f4a0688f3c23',
event_id: 'caf77ace-3417-4da4-944d-f4a0688f3c23',
parent_id: null,
children_ids: ['7f22137a-6911-4ed3-bc36-110f1dde6b66'],
inputs: {
context: 'Hello world',
question: 'What is in the context?',
chat_history: [
{
role: 'system',
content: 'Answer the user\'s question only using provided context.\n\nContext: Hello world'
},
{role: 'user', content: 'What is in the context?'}
]
},
outputs: {role: 'assistant', content: 'Hello world'},
error: null,
start_time: 1712025501605,
end_time: 1712025499832,
duration: 824.8056,
metrics: {},
feedback: {},
metadata: {},
user_properties: {user: 'google-oauth2|111840237613341303366'}
}
})
};
fetch('https://api.honeyhive.ai/session/start', 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.honeyhive.ai/session/start",
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([
'session' => [
'project' => 'Simple RAG Project',
'source' => 'playground',
'event_type' => 'session',
'session_name' => 'Playground Session',
'session_id' => 'caf77ace-3417-4da4-944d-f4a0688f3c23',
'event_id' => 'caf77ace-3417-4da4-944d-f4a0688f3c23',
'parent_id' => null,
'children_ids' => [
'7f22137a-6911-4ed3-bc36-110f1dde6b66'
],
'inputs' => [
'context' => 'Hello world',
'question' => 'What is in the context?',
'chat_history' => [
[
'role' => 'system',
'content' => 'Answer the user\'s question only using provided context.
Context: Hello world'
],
[
'role' => 'user',
'content' => 'What is in the context?'
]
]
],
'outputs' => [
'role' => 'assistant',
'content' => 'Hello world'
],
'error' => null,
'start_time' => 1712025501605,
'end_time' => 1712025499832,
'duration' => 824.8056,
'metrics' => [
],
'feedback' => [
],
'metadata' => [
],
'user_properties' => [
'user' => 'google-oauth2|111840237613341303366'
]
]
]),
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.honeyhive.ai/session/start"
payload := strings.NewReader("{\n \"session\": {\n \"project\": \"Simple RAG Project\",\n \"source\": \"playground\",\n \"event_type\": \"session\",\n \"session_name\": \"Playground Session\",\n \"session_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"event_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"parent_id\": null,\n \"children_ids\": [\n \"7f22137a-6911-4ed3-bc36-110f1dde6b66\"\n ],\n \"inputs\": {\n \"context\": \"Hello world\",\n \"question\": \"What is in the context?\",\n \"chat_history\": [\n {\n \"role\": \"system\",\n \"content\": \"Answer the user's question only using provided context.\\n\\nContext: Hello world\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is in the context?\"\n }\n ]\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"error\": null,\n \"start_time\": 1712025501605,\n \"end_time\": 1712025499832,\n \"duration\": 824.8056,\n \"metrics\": {},\n \"feedback\": {},\n \"metadata\": {},\n \"user_properties\": {\n \"user\": \"google-oauth2|111840237613341303366\"\n }\n }\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.honeyhive.ai/session/start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session\": {\n \"project\": \"Simple RAG Project\",\n \"source\": \"playground\",\n \"event_type\": \"session\",\n \"session_name\": \"Playground Session\",\n \"session_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"event_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"parent_id\": null,\n \"children_ids\": [\n \"7f22137a-6911-4ed3-bc36-110f1dde6b66\"\n ],\n \"inputs\": {\n \"context\": \"Hello world\",\n \"question\": \"What is in the context?\",\n \"chat_history\": [\n {\n \"role\": \"system\",\n \"content\": \"Answer the user's question only using provided context.\\n\\nContext: Hello world\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is in the context?\"\n }\n ]\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"error\": null,\n \"start_time\": 1712025501605,\n \"end_time\": 1712025499832,\n \"duration\": 824.8056,\n \"metrics\": {},\n \"feedback\": {},\n \"metadata\": {},\n \"user_properties\": {\n \"user\": \"google-oauth2|111840237613341303366\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/session/start")
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 \"session\": {\n \"project\": \"Simple RAG Project\",\n \"source\": \"playground\",\n \"event_type\": \"session\",\n \"session_name\": \"Playground Session\",\n \"session_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"event_id\": \"caf77ace-3417-4da4-944d-f4a0688f3c23\",\n \"parent_id\": null,\n \"children_ids\": [\n \"7f22137a-6911-4ed3-bc36-110f1dde6b66\"\n ],\n \"inputs\": {\n \"context\": \"Hello world\",\n \"question\": \"What is in the context?\",\n \"chat_history\": [\n {\n \"role\": \"system\",\n \"content\": \"Answer the user's question only using provided context.\\n\\nContext: Hello world\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is in the context?\"\n }\n ]\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"error\": null,\n \"start_time\": 1712025501605,\n \"end_time\": 1712025499832,\n \"duration\": 824.8056,\n \"metrics\": {},\n \"feedback\": {},\n \"metadata\": {},\n \"user_properties\": {\n \"user\": \"google-oauth2|111840237613341303366\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Show child attributes
Show child attributes
Example:
{
"project": "Simple RAG Project",
"source": "playground",
"event_type": "session",
"session_name": "Playground Session",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"event_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"parent_id": null,
"children_ids": ["7f22137a-6911-4ed3-bc36-110f1dde6b66"],
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user's question only using provided context.\n\nContext: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"start_time": 1712025501605,
"end_time": 1712025499832,
"duration": 824.8056,
"metrics": {},
"feedback": {},
"metadata": {},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
Response
200 - application/json
Session successfully started
Was this page helpful?
⌘I

