Skip to main content
POST
/
session
Create a session
curl --request POST \
  --url https://litellm-rust.onrender.com/session \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "agent": "<string>",
  "agent_id": "<string>",
  "harness": "<string>",
  "runtime": "cursor",
  "prompt": "<string>",
  "environment": {
    "repository": "https://github.com/your-org/your-repo",
    "ref": "main",
    "auto_create_pr": false
  },
  "timezone": "America/Los_Angeles",
  "tz": "America/Los_Angeles"
}
'
import requests

url = "https://litellm-rust.onrender.com/session"

payload = {
"title": "<string>",
"agent": "<string>",
"agent_id": "<string>",
"harness": "<string>",
"runtime": "cursor",
"prompt": "<string>",
"environment": {
"repository": "https://github.com/your-org/your-repo",
"ref": "main",
"auto_create_pr": False
},
"timezone": "America/Los_Angeles",
"tz": "America/Los_Angeles"
}
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: '<string>',
agent: '<string>',
agent_id: '<string>',
harness: '<string>',
runtime: 'cursor',
prompt: '<string>',
environment: {
repository: 'https://github.com/your-org/your-repo',
ref: 'main',
auto_create_pr: false
},
timezone: 'America/Los_Angeles',
tz: 'America/Los_Angeles'
})
};

fetch('https://litellm-rust.onrender.com/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "id": "<string>",
  "title": "<string>",
  "agent": "<string>",
  "agent_id": "<string>",
  "harness": "<string>",
  "runtime": "<string>",
  "runtime_agent_ref_id": "<string>",
  "provider_session_id": "<string>",
  "provider_run_id": "<string>",
  "status": "idle",
  "environment": {},
  "time": {
    "created": 123,
    "updated": 123
  }
}

Authorizations

Authorization
string
header
required

Your LITELLM_MASTER_KEY. Default for local Docker Compose: sk-local

Body

application/json
title
string
agent
string

Agent ID or configured harness ID. For local DB agents, use agent_id or agent.

agent_id
string
harness
string
runtime
string

Built-in runtime ID or runtime harness alias. When present, creates a runtime-backed session.

Example:

"cursor"

prompt
string

Optional initial prompt. If present, the runtime session starts immediately.

environment
object

Runtime-specific environment settings

timezone
string
Example:

"America/Los_Angeles"

tz
string
Example:

"America/Los_Angeles"

Response

Session created

id
string
title
string
agent
string
agent_id
string
harness
string
runtime
string
runtime_agent_ref_id
string | null
provider_session_id
string | null
provider_run_id
string | null
status
enum<string>
Available options:
pending,
running,
idle,
error
Example:

"idle"

environment
object
time
object