Skip to main content
SONZAI
Api

Workbench

Advance simulated time in the workbench

POST
/workbench/advance-time
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/workbench/advance-time"
null
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Get async advance-time job status

GET
/workbench/advance-time/jobs/{jobId}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

jobId*string

Async advance-time job UUID

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/workbench/advance-time/jobs/string"
{
  "$schema": "/api/v1/schemas/WorkbenchAdvanceTimeJobBody.json",
  "agent_id": "string",
  "error": "string",
  "job_id": "string",
  "result": {
    "consolidation_processed": 0,
    "consolidation_ran": true,
    "days_processed": 0,
    "diary_entries": [
      {
        "content": "string",
        "date": "string",
        "mood": "string",
        "topics": [
          "string"
        ]
      }
    ],
    "diary_entries_created": 0,
    "wakeups_executed": [
      {
        "agent_id": "string",
        "check_type": "string",
        "generated_message": "string",
        "intent": "string",
        "user_id": "string",
        "wakeup_id": "string"
      }
    ],
    "weekly_consolidations": 0
  },
  "started_at": "string",
  "status": "string",
  "updated_at": "string",
  "user_id": "string"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Workbench chat (SSE streaming)

POST
/workbench/chat

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

text/event-stream

application/problem+json

curl -X POST "https://loading/api/v1/workbench/chat"
Empty
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Generate agent bio

POST
/workbench/generate-bio
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/workbench/generate-bio"
{
  "$schema": "/api/v1/schemas/WorkbenchGenerateBioBody.json",
  "bio": "string",
  "confidence": 0.1,
  "tone": "string"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Generate a full character (personality + bio + seed memories)

POST
/workbench/generate-character
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/workbench/generate-character"
{
  "$schema": "/api/v1/schemas/WorkbenchGenerateCharacterBody.json",
  "agent_id": "string",
  "existing": true,
  "generated": {
    "behaviors": {
      "conflict_approach": "string",
      "empathy_style": "string",
      "question_frequency": "string",
      "response_length": "string"
    },
    "big5": {
      "agreeableness": 0.1,
      "confidence": 0.1,
      "conscientiousness": 0.1,
      "extraversion": 0.1,
      "neuroticism": 0.1,
      "openness": 0.1
    },
    "bio": "string",
    "dimensions": null,
    "initial_goals": [
      {
        "description": "string",
        "priority": 0,
        "title": "string",
        "type": "string"
      }
    ],
    "origin_prompt_instructions": "string",
    "personality_prompt": "string",
    "preferences": {
      "conversation_pace": "string",
      "emotional_expression": "string",
      "formality": "string",
      "humor_style": "string"
    },
    "primary_traits": [
      "string"
    ],
    "speech_patterns": [
      "string"
    ],
    "true_dislikes": [
      "string"
    ],
    "true_interests": [
      "string"
    ],
    "world_description": "string"
  },
  "usage": {
    "completionTokens": 0,
    "model": "string",
    "promptTokens": 0,
    "totalTokens": 0
  }
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Generate agent seed memories

POST
/workbench/generate-seed-memories
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/workbench/generate-seed-memories"
{
  "$schema": "/api/v1/schemas/WorkbenchGenerateSeedMemoriesBody.json",
  "memories": [
    {
      "content": "string",
      "entities": [
        "string"
      ],
      "factType": "string",
      "importance": 0.1
    }
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Prepare the workbench for a run

POST
/workbench/prepare

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/workbench/prepare"
{
  "$schema": "/api/v1/schemas/WorkbenchPrepareBody.json",
  "agent_id": "string",
  "ready": true,
  "run_id": "string",
  "warm": true
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Reset the workbench agent's data

POST
/workbench/reset-agent

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/workbench/reset-agent"
{
  "$schema": "/api/v1/schemas/WorkbenchResetAgentBody.json",
  "agent_id": "string",
  "message": "string",
  "success": true
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Trigger session-end processing

POST
/workbench/session-end

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/workbench/session-end"
{
  "$schema": "/api/v1/schemas/WorkbenchSessionEndBody.json",
  "ok": true
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Generate a simulated user turn

POST
/workbench/simulate-user
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/workbench/simulate-user"
{
  "$schema": "/api/v1/schemas/WorkbenchSimulateUserBody.json",
  "end_session": true,
  "message": "string"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Get current workbench state

POST
/workbench/state

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*unknown

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/workbench/state"
{
  "$schema": "/api/v1/schemas/WorkbenchStateResponse.json",
  "big5": {
    "agreeableness": 0.1,
    "conscientiousness": 0.1,
    "extraversion": 0.1,
    "neuroticism": 0.1,
    "openness": 0.1
  },
  "diary_entries": [
    {
      "content": "string",
      "date": "string",
      "mood": "string",
      "topics": [
        "string"
      ]
    }
  ],
  "dimensions": {
    "aesthetic": 0.1,
    "assertiveness": 0.1,
    "compassion": 0.1,
    "enthusiasm": 0.1,
    "industriousness": 0.1,
    "intellect": 0.1,
    "orderliness": 0.1,
    "politeness": 0.1,
    "volatility": 0.1,
    "withdrawal": 0.1
  },
  "facts": [
    {
      "entities": [
        "string"
      ],
      "fact_type": "string",
      "importance": 0.1,
      "sentiment": "string",
      "text": "string",
      "topic_tags": [
        "string"
      ]
    }
  ],
  "habits": [
    {
      "category": "string",
      "formed": true,
      "name": "string",
      "strength": 0.1
    }
  ],
  "interests": [
    {
      "category": "string",
      "confidence": 0.1,
      "topic": "string"
    }
  ],
  "mood": {
    "affiliation": 0.1,
    "arousal": 0.1,
    "label": "string",
    "tension": 0.1,
    "valence": 0.1
  },
  "next_event_hours": 0.1,
  "relationship": {
    "agent_to_user": 0,
    "user_to_agent": 0
  }
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}