Create Session
POST
/v1/openai-agents/sessionsPOST
/v1/openai-agents/sessionsYour instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Request Body
JSON request bodies are capped at 2 MiB.
| Property | Type | Required | Description |
|---|---|---|---|
connection_id | string | Yes | |
idempotency_key | string | Yes | |
model | string | Yes | |
instructions | string | No | |
environment | object | Yes | |
input | object | No | |
tools | object[] | No |
Responses
201 Success
| Property | Type | Description |
|---|---|---|
id | string | |
provider | string | |
connection_id | string | |
conversation_id | string | |
upstream_session_id | string | |
upstream_environment_id | string | |
sandbox_id | string | |
model | string | |
environment | object | |
status | string | |
readiness | string | |
cleanup_status | string | |
environment_cleanup_status | string | |
last_error | string | |
created_at | string | |
updated_at | string |
400 Invalid request
| Property | Type | Description |
|---|---|---|
error | object |
403 Permission denied
| Property | Type | Description |
|---|---|---|
error | object |
404 Not found
| Property | Type | Description |
|---|---|---|
error | object |
409 Creation outcome is pending recovery
| Property | Type | Description |
|---|---|---|
error | object |
500 Internal error
| Property | Type | Description |
|---|---|---|
error | object |
503 Unavailable
| Property | Type | Description |
|---|---|---|
error | object |
Request
curl -X POST "http://localhost:8089/v1/openai-agents/sessions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"connection_id":"string","idempotency_key":"string","model":"string","instructions":"string","environment":{"type":"none","workspace_directory":"string"},"tools":[{"type":"string","resource_id":"string","name":"string"}]}'const response = await fetch("http://localhost:8089/v1/openai-agents/sessions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"connection_id": "string",
"idempotency_key": "string",
"model": "string",
"instructions": "string",
"environment": {
"type": "none",
"workspace_directory": "string"
},
"tools": [
{
"type": "string",
"resource_id": "string",
"name": "string"
}
]
}),
});
const data = await response.json();import requests
response = requests.post(
"http://localhost:8089/v1/openai-agents/sessions",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"connection_id": "string",
"idempotency_key": "string",
"model": "string",
"instructions": "string",
"environment": {
"type": "none",
"workspace_directory": "string"
},
"tools": [
{
"type": "string",
"resource_id": "string",
"name": "string"
}
]
},
)
data = response.json()Response
{
"id": "string",
"provider": "string",
"connection_id": "string",
"conversation_id": "string",
"upstream_session_id": "string",
"upstream_environment_id": "string",
"sandbox_id": "string",
"model": "string",
"environment": {
"type": "none",
"workspace_directory": "string"
},
"status": "string",
"readiness": "string",
"cleanup_status": "string",
"environment_cleanup_status": "string",
"last_error": "string",
"created_at": "string",
"updated_at": "string"
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}
