curl --request POST \
--url https://api.mixpeek.com/v1/agents/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Namespace: <api-key>' \
--data '
{
"agent_config": {
"available_tools": [
"search_retrievers",
"execute_retriever",
"list_collections"
],
"max_tokens": 4096,
"model": "claude-3-5-sonnet-20241022",
"system_prompt": "You are a helpful video search assistant.",
"temperature": 0.7
},
"quotas": {
"max_messages": 100,
"max_tokens_total": 100000,
"max_tool_calls": 50
},
"user_id": "user_123",
"user_memory": {
"preferences": {
"domain": "tech",
"language": "en"
}
}
}
'import requests
url = "https://api.mixpeek.com/v1/agents/sessions"
payload = {
"agent_config": {
"available_tools": ["search_retrievers", "execute_retriever", "list_collections"],
"max_tokens": 4096,
"model": "claude-3-5-sonnet-20241022",
"system_prompt": "You are a helpful video search assistant.",
"temperature": 0.7
},
"quotas": {
"max_messages": 100,
"max_tokens_total": 100000,
"max_tool_calls": 50
},
"user_id": "user_123",
"user_memory": { "preferences": {
"domain": "tech",
"language": "en"
} }
}
headers = {
"Authorization": "Bearer <token>",
"X-Namespace": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Namespace': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agent_config: {
available_tools: ['search_retrievers', 'execute_retriever', 'list_collections'],
max_tokens: 4096,
model: 'claude-3-5-sonnet-20241022',
system_prompt: 'You are a helpful video search assistant.',
temperature: 0.7
},
quotas: {max_messages: 100, max_tokens_total: 100000, max_tool_calls: 50},
user_id: 'user_123',
user_memory: {preferences: {domain: 'tech', language: 'en'}}
})
};
fetch('https://api.mixpeek.com/v1/agents/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.mixpeek.com/v1/agents/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([
'agent_config' => [
'available_tools' => [
'search_retrievers',
'execute_retriever',
'list_collections'
],
'max_tokens' => 4096,
'model' => 'claude-3-5-sonnet-20241022',
'system_prompt' => 'You are a helpful video search assistant.',
'temperature' => 0.7
],
'quotas' => [
'max_messages' => 100,
'max_tokens_total' => 100000,
'max_tool_calls' => 50
],
'user_id' => 'user_123',
'user_memory' => [
'preferences' => [
'domain' => 'tech',
'language' => 'en'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Namespace: <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.mixpeek.com/v1/agents/sessions"
payload := strings.NewReader("{\n \"agent_config\": {\n \"available_tools\": [\n \"search_retrievers\",\n \"execute_retriever\",\n \"list_collections\"\n ],\n \"max_tokens\": 4096,\n \"model\": \"claude-3-5-sonnet-20241022\",\n \"system_prompt\": \"You are a helpful video search assistant.\",\n \"temperature\": 0.7\n },\n \"quotas\": {\n \"max_messages\": 100,\n \"max_tokens_total\": 100000,\n \"max_tool_calls\": 50\n },\n \"user_id\": \"user_123\",\n \"user_memory\": {\n \"preferences\": {\n \"domain\": \"tech\",\n \"language\": \"en\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Namespace", "<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.mixpeek.com/v1/agents/sessions")
.header("Authorization", "Bearer <token>")
.header("X-Namespace", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_config\": {\n \"available_tools\": [\n \"search_retrievers\",\n \"execute_retriever\",\n \"list_collections\"\n ],\n \"max_tokens\": 4096,\n \"model\": \"claude-3-5-sonnet-20241022\",\n \"system_prompt\": \"You are a helpful video search assistant.\",\n \"temperature\": 0.7\n },\n \"quotas\": {\n \"max_messages\": 100,\n \"max_tokens_total\": 100000,\n \"max_tool_calls\": 50\n },\n \"user_id\": \"user_123\",\n \"user_memory\": {\n \"preferences\": {\n \"domain\": \"tech\",\n \"language\": \"en\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/agents/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Namespace"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_config\": {\n \"available_tools\": [\n \"search_retrievers\",\n \"execute_retriever\",\n \"list_collections\"\n ],\n \"max_tokens\": 4096,\n \"model\": \"claude-3-5-sonnet-20241022\",\n \"system_prompt\": \"You are a helpful video search assistant.\",\n \"temperature\": 0.7\n },\n \"quotas\": {\n \"max_messages\": 100,\n \"max_tokens_total\": 100000,\n \"max_tool_calls\": 50\n },\n \"user_id\": \"user_123\",\n \"user_memory\": {\n \"preferences\": {\n \"domain\": \"tech\",\n \"language\": \"en\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"namespace_id": "<string>",
"internal_id": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"session_name": "<string>"
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Create Session
Create a new agent session.
A session represents a stateful conversation with an AI agent that can call tools to search data, filter results, and perform multi-step reasoning.
Args: request: FastAPI request with tenant context payload: Session creation request
Returns: CreateSessionResponse with session metadata
Example:
curl -X POST http://localhost:8000/v1/agents/sessions \
-H "Authorization: Bearer {api_key}" \
-H "X-Namespace: {namespace_id}" \
-H "Content-Type: application/json" \
-d '{
"agent_config": {
"model": "claude-3-5-sonnet-20241022",
"temperature": 0.7,
"available_tools": ["search_retrievers", "execute_retriever"]
},
"quotas": {
"max_messages": 100,
"max_tokens_total": 100000
}
}'
curl --request POST \
--url https://api.mixpeek.com/v1/agents/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Namespace: <api-key>' \
--data '
{
"agent_config": {
"available_tools": [
"search_retrievers",
"execute_retriever",
"list_collections"
],
"max_tokens": 4096,
"model": "claude-3-5-sonnet-20241022",
"system_prompt": "You are a helpful video search assistant.",
"temperature": 0.7
},
"quotas": {
"max_messages": 100,
"max_tokens_total": 100000,
"max_tool_calls": 50
},
"user_id": "user_123",
"user_memory": {
"preferences": {
"domain": "tech",
"language": "en"
}
}
}
'import requests
url = "https://api.mixpeek.com/v1/agents/sessions"
payload = {
"agent_config": {
"available_tools": ["search_retrievers", "execute_retriever", "list_collections"],
"max_tokens": 4096,
"model": "claude-3-5-sonnet-20241022",
"system_prompt": "You are a helpful video search assistant.",
"temperature": 0.7
},
"quotas": {
"max_messages": 100,
"max_tokens_total": 100000,
"max_tool_calls": 50
},
"user_id": "user_123",
"user_memory": { "preferences": {
"domain": "tech",
"language": "en"
} }
}
headers = {
"Authorization": "Bearer <token>",
"X-Namespace": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Namespace': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agent_config: {
available_tools: ['search_retrievers', 'execute_retriever', 'list_collections'],
max_tokens: 4096,
model: 'claude-3-5-sonnet-20241022',
system_prompt: 'You are a helpful video search assistant.',
temperature: 0.7
},
quotas: {max_messages: 100, max_tokens_total: 100000, max_tool_calls: 50},
user_id: 'user_123',
user_memory: {preferences: {domain: 'tech', language: 'en'}}
})
};
fetch('https://api.mixpeek.com/v1/agents/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.mixpeek.com/v1/agents/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([
'agent_config' => [
'available_tools' => [
'search_retrievers',
'execute_retriever',
'list_collections'
],
'max_tokens' => 4096,
'model' => 'claude-3-5-sonnet-20241022',
'system_prompt' => 'You are a helpful video search assistant.',
'temperature' => 0.7
],
'quotas' => [
'max_messages' => 100,
'max_tokens_total' => 100000,
'max_tool_calls' => 50
],
'user_id' => 'user_123',
'user_memory' => [
'preferences' => [
'domain' => 'tech',
'language' => 'en'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Namespace: <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.mixpeek.com/v1/agents/sessions"
payload := strings.NewReader("{\n \"agent_config\": {\n \"available_tools\": [\n \"search_retrievers\",\n \"execute_retriever\",\n \"list_collections\"\n ],\n \"max_tokens\": 4096,\n \"model\": \"claude-3-5-sonnet-20241022\",\n \"system_prompt\": \"You are a helpful video search assistant.\",\n \"temperature\": 0.7\n },\n \"quotas\": {\n \"max_messages\": 100,\n \"max_tokens_total\": 100000,\n \"max_tool_calls\": 50\n },\n \"user_id\": \"user_123\",\n \"user_memory\": {\n \"preferences\": {\n \"domain\": \"tech\",\n \"language\": \"en\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Namespace", "<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.mixpeek.com/v1/agents/sessions")
.header("Authorization", "Bearer <token>")
.header("X-Namespace", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_config\": {\n \"available_tools\": [\n \"search_retrievers\",\n \"execute_retriever\",\n \"list_collections\"\n ],\n \"max_tokens\": 4096,\n \"model\": \"claude-3-5-sonnet-20241022\",\n \"system_prompt\": \"You are a helpful video search assistant.\",\n \"temperature\": 0.7\n },\n \"quotas\": {\n \"max_messages\": 100,\n \"max_tokens_total\": 100000,\n \"max_tool_calls\": 50\n },\n \"user_id\": \"user_123\",\n \"user_memory\": {\n \"preferences\": {\n \"domain\": \"tech\",\n \"language\": \"en\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/agents/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Namespace"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_config\": {\n \"available_tools\": [\n \"search_retrievers\",\n \"execute_retriever\",\n \"list_collections\"\n ],\n \"max_tokens\": 4096,\n \"model\": \"claude-3-5-sonnet-20241022\",\n \"system_prompt\": \"You are a helpful video search assistant.\",\n \"temperature\": 0.7\n },\n \"quotas\": {\n \"max_messages\": 100,\n \"max_tokens_total\": 100000,\n \"max_tool_calls\": 50\n },\n \"user_id\": \"user_123\",\n \"user_memory\": {\n \"preferences\": {\n \"domain\": \"tech\",\n \"language\": \"en\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"namespace_id": "<string>",
"internal_id": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"session_name": "<string>"
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Authorizations
Mixpeek API key, sent as Authorization: Bearer mxp_sk_.... Create one in Studio under Settings → API Keys, or with an admin key via POST /v1/organizations/users/{user_email}/api-keys. A missing header returns 403; an invalid or revoked key returns 401.
Namespace id (ns_...), not the namespace name. This scopes the request rather than authenticating it, and it is required on every operation marked x-mixpeek-namespace-scoped.
Body
Request payload for creating a new agent session.
Attributes: agent_config: Agent configuration (model, temperature, tools, etc.) quotas: Optional session quotas and rate limits user_id: Optional user identifier user_memory: Optional initial user memory/preferences metadata: Optional session metadata
Example:
python request = CreateSessionRequest( agent_config=AgentConfig( model="claude-3-5-sonnet-20241022", temperature=0.7, available_tools=["search_retrievers", "execute_retriever"] ), quotas=SessionQuotas( max_messages=100, max_tokens_total=100000 ), user_id="user_123", user_memory={"preferences": {"language": "en"}} )
Agent configuration (REQUIRED)
Show child attributes
Show child attributes
{
"available_tools": [
"list_retrievers",
"get_retriever",
"execute_retriever",
"list_collections",
"get_collection"
],
"max_tokens": 4096,
"model": "claude-sonnet-4-5-20250929",
"system_prompt": "You are a video analysis assistant that helps users find and analyze video content.",
"temperature": 0.7
}
{
"available_tools": ["list_retrievers", "execute_retriever"],
"max_tokens": 2048,
"model": "claude-3-haiku-20240307",
"system_prompt": "You are a quick search assistant. Be concise.",
"temperature": 0.3
}
Session quotas and rate limits (OPTIONAL)
Show child attributes
Show child attributes
{
"max_messages": 100,
"max_tokens_total": 100000,
"max_tool_calls": 50,
"rate_limit_messages_per_minute": 10
}
User identifier (OPTIONAL)
Initial user memory/preferences (OPTIONAL)
Session metadata (OPTIONAL)
Enable semantic memory for conversation context (OPTIONAL, default: True)
Response
Successful Response
Response for session creation.
Attributes: session_id: Unique session identifier namespace_id: Namespace identifier internal_id: Organization internal ID session_name: Auto-generated session name (null until first message) status: Session status created_at: Session creation timestamp expires_at: Session expiration timestamp
Example:
python response = CreateSessionResponse( session_id="ses_abc123", namespace_id="ns_xyz789", internal_id="int_abc123", session_name=None, # Will be set after first message status="active", created_at=current_time(), expires_at=current_time() + timedelta(days=7) )
Unique session identifier
Namespace identifier
Organization internal ID
Session status
active, idle, archived, terminated Session creation timestamp
Session expiration timestamp
Auto-generated session name based on first conversation (set after first message)
Was this page helpful?

