Skip to content

Dedicated Agent

A per-user, always-on agent with its own gateway, available to accounts with the dedicated_agent flag. Chat with it, inspect its activity, manage its scheduled jobs and autonomous runs, and replay its console history.

Endpoints

MethodPathPurpose
POST/microservices/dedicated-agent/chat/streamSend a message (streamed reply over the socket)
POST/microservices/dedicated-agent/chat/Send a message (synchronous)
GET/microservices/dedicated-agent/messages/Console history
GET/microservices/dedicated-agent/activity/Activity log and spend
POST/microservices/dedicated-agent/kill/Pause the agent
GET/microservices/dedicated-agent/jobs/Scheduled jobs
GET/microservices/dedicated-agent/jobs/{job_id}/One job
DELETE/microservices/dedicated-agent/jobs/{job_id}/Delete a job
POST/microservices/dedicated-agent/jobs/{job_id}/{action}/Pause, resume or run a job now
POST/microservices/dedicated-agent/runs/Start an autonomous run
GET/microservices/dedicated-agent/runs/{run_id}/Run status
GET/microservices/dedicated-agent/runs/{run_id}/events/Run event stream
POST/microservices/dedicated-agent/runs/{run_id}/{action}/Approve a tool call, or stop the run

POST /microservices/dedicated-agent/chat/stream

Send a message (streamed reply over the socket)

Starts a turn on your dedicated agent and returns immediately with 202. The agent's progress and answer arrive on the WebSocket ws/dedicated-agent/{agent_id}/ (same stage:* telemetry envelope as Chat AI — see Streaming & WebSockets) and the answer is also persisted to the chat session, so it survives a closed tab. The agent handles one turn at a time: a second message while it is busy answers 409.

Auth: Session token · In the app: Dedicated Agent console

Request body (application/json)

FieldTypeRequiredDescription
messagestringyes
chat_session_idintegernoA sessions/ row of type dedicated-agent owned by the caller; created for you when omitted.
attached_filesobject[]noFiles from My Data, as in Chat AI.
json
{
  "message": "Draft a reply to the supplier about the late delivery.",
  "chat_session_id": 9310
}

Response 202 — Turn started; listen on the socket.

FieldTypeDescription
statusstring ("started")
chat_session_idinteger
session_idstring, nullableThe gateway's conversation id.
json
{
  "status": "started",
  "chat_session_id": 9310,
  "session_id": "sess_91ab"
}

Response 400message missing or bad chat_session_id.

json
{
  "detail": "Authentication credentials were not provided."
}

Response 403 — The session is not yours.

Response 404 — You have no dedicated agent.

json
{
  "detail": "no dedicated agent for this user"
}

Response 409 — The agent is paused/stopped, or busy with another turn (busy_chat_session_id names it).

json
{
  "detail": "agent is busy in another conversation",
  "busy_chat_session_id": 9302
}

Example

bash
curl -X POST "https://api.example.com/microservices/dedicated-agent/chat/stream" \
  -H "Authorization: Token $FINBLADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"message":"Draft a reply to the supplier about the late delivery.","chat_session_id":9310}'

POST /microservices/dedicated-agent/chat/

Send a message (synchronous)

Waits for the agent's answer (up to 5 minutes) and returns it. Prefer the streaming endpoint from interactive clients.

Auth: Session token

Request body (application/json)

FieldTypeRequiredDescription
messagestringyes
attached_filesobject[]no

Response 200 — The answer.

FieldTypeDescription
answerstring
session_idstring, nullable
generated_files_urlsstring[]

Response 404 — No dedicated agent.

Response 409 — Agent not running.

Response 502 — Gateway error.

Example

bash
curl -X POST "https://api.example.com/microservices/dedicated-agent/chat/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

GET /microservices/dedicated-agent/messages/

Console history

The stored conversation with the agent (oldest first within the window).

Auth: Session token · In the app: Dedicated Agent console (on open)

Query parameters

FieldTypeRequiredDescription
limitintegernoDefault: 100.

Response 200 — Messages.

FieldTypeDescription
agent_idstring
messagesobject[]
messages[].idinteger
messages[].rolestring ("user", "assistant")
messages[].messagestring
messages[].created_atstring (date-time)

Example

bash
curl -X GET "https://api.example.com/microservices/dedicated-agent/messages/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

GET /microservices/dedicated-agent/activity/

Activity log and spend

Every platform tool the agent called (newest first) and its LLM spend against the budget.

Auth: Session token · In the app: Dedicated Agent → Activity

Query parameters

FieldTypeRequiredDescription
limitintegernoDefault: 50.

Response 200 — Activity.

FieldTypeDescription
agent_idstring
statusstring ("running", "paused", "stopped", "provisioning")
activityobject[]
activity[].tool_namestring
activity[].successboolean
activity[].duration_msinteger
activity[].tsstring (date-time)
spendobject, nullable
spend.spendnumber
spend.soft_budgetnumber, nullable
json
{
  "agent_id": "agt_42",
  "status": "running",
  "activity": [
    {
      "tool_name": "send_email",
      "success": true,
      "duration_ms": 812,
      "ts": "2026-09-22T08:03:10Z"
    }
  ],
  "spend": {
    "spend": 12.4,
    "soft_budget": 50
  }
}

Response 404 — No dedicated agent.

Example

bash
curl -X GET "https://api.example.com/microservices/dedicated-agent/activity/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

POST /microservices/dedicated-agent/kill/

Pause the agent

Soft pause — the console stops routing to the agent and the gateway is asked to stop. Resuming is done by an operator.

Auth: Session token · In the app: Dedicated Agent → Pause

Response 200 — Paused.

FieldTypeDescription
successboolean
statusstring
notestring

Response 404 — No dedicated agent.

Example

bash
curl -X POST "https://api.example.com/microservices/dedicated-agent/kill/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

GET /microservices/dedicated-agent/jobs/

Scheduled jobs

Auth: Session token · In the app: Dedicated Agent → Jobs

Query parameters

FieldTypeRequiredDescription
include_disabledbooleanno

Response 200 — Jobs (gateway response).

FieldTypeDescription
jobsobject[]
jobs[].idstring
jobs[].namestring
jobs[].promptstringWhat the agent does when the job fires.
jobs[].scheduleobjectMachine schedule (kind: interval, cron or once, …).
jobs[].schedule_displaystringHuman-readable, e.g. every day 9am.
jobs[].enabledboolean
jobs[].statestring ("scheduled", "paused", "completed", "error")
jobs[].next_run_atstring (date-time), nullable
jobs[].last_run_atstring (date-time), nullable
jobs[].last_statusstring, nullable
jobs[].last_errorstring, nullable
jobs[].repeatobject
jobs[].repeat.timesinteger, nullablenull = forever.
jobs[].repeat.completedinteger
jobs[].latest_executionobject, nullableThe most recent run (status, timestamps).

Response 502 — Agent unreachable.

Example

bash
curl -X GET "https://api.example.com/microservices/dedicated-agent/jobs/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

GET /microservices/dedicated-agent/jobs/{job_id}/

One job

Auth: Session token

Path parameters

FieldTypeRequiredDescription
job_idstringyes

Response 200 — The job.

FieldTypeDescription
idstring
namestring
promptstringWhat the agent does when the job fires.
scheduleobjectMachine schedule (kind: interval, cron or once, …).
schedule_displaystringHuman-readable, e.g. every day 9am.
enabledboolean
statestring ("scheduled", "paused", "completed", "error")
next_run_atstring (date-time), nullable
last_run_atstring (date-time), nullable
last_statusstring, nullable
last_errorstring, nullable
repeatobject
repeat.timesinteger, nullablenull = forever.
repeat.completedinteger
latest_executionobject, nullableThe most recent run (status, timestamps).
json
{
  "id": "job_7a1",
  "name": "Morning briefing",
  "prompt": "Summarise overnight emails and today's calendar.",
  "schedule": {
    "kind": "cron",
    "expr": "0 9 * * 1-5"
  },
  "schedule_display": "every weekday 9am",
  "enabled": true,
  "state": "scheduled",
  "next_run_at": "2026-09-23T09:00:00+03:00",
  "last_run_at": "2026-09-22T09:00:00+03:00",
  "last_status": "completed",
  "last_error": null,
  "repeat": {
    "times": null,
    "completed": 14
  },
  "latest_execution": {
    "status": "completed"
  }
}

Example

bash
curl -X GET "https://api.example.com/microservices/dedicated-agent/jobs/<job_id>/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

DELETE /microservices/dedicated-agent/jobs/{job_id}/

Delete a job

Auth: Session token

Path parameters

FieldTypeRequiredDescription
job_idstringyes

Response 200 — Deleted.

Example

bash
curl -X DELETE "https://api.example.com/microservices/dedicated-agent/jobs/<job_id>/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

POST /microservices/dedicated-agent/jobs/{job_id}/{action}/

Pause, resume or run a job now

Auth: Session token

Path parameters

FieldTypeRequiredDescription
job_idstringyes
actionstring ("pause", "resume", "run")yes

Response 200 — Done (gateway response).

Response 400 — Unknown action, or the gateway refused (e.g. resuming a one-shot whose time has passed — error explains).

Example

bash
curl -X POST "https://api.example.com/microservices/dedicated-agent/jobs/<job_id>/run/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

POST /microservices/dedicated-agent/runs/

Start an autonomous run

Hands the agent a task to complete on its own. Follow it with GET …/runs/{run_id}/ or the event stream; approve tool use when it pauses in waiting_for_approval.

Auth: Session token · In the app: Dedicated Agent → Runs → New

Request body (application/json)

FieldTypeRequiredDescription
inputstringyesThe task.
instructionsstringnoExtra guidance.
modelstringno
json
{
  "input": "Audit last month's invoices for duplicates and prepare a report."
}

Response 200 — The run (gateway response; the id is run_id or id).

FieldTypeDescription
idstringAlso returned as run_id.
statusstring ("started", "queued", "running", "waiting_for_approval", "stopping", "completed", "failed", "cancelled")
inputstring
instructionsstring
modelstring
outputstring, nullableFinal answer when completed.
created_atstring (date-time)
updated_atstring (date-time)
json
{
  "id": "run_3f2e",
  "status": "running",
  "input": "Audit last month's invoices for duplicates and prepare a report.",
  "model": "default",
  "output": null,
  "created_at": "2026-09-22T08:00:00Z",
  "updated_at": "2026-09-22T08:03:10Z"
}

Response 502 — Agent unreachable.

Example

bash
curl -X POST "https://api.example.com/microservices/dedicated-agent/runs/" \
  -H "Authorization: Token $FINBLADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"input":"Audit last month's invoices for duplicates and prepare a report."}'

GET /microservices/dedicated-agent/runs/{run_id}/

Run status

Auth: Session token

Path parameters

FieldTypeRequiredDescription
run_idstringyes

Response 200 — The run.

FieldTypeDescription
idstringAlso returned as run_id.
statusstring ("started", "queued", "running", "waiting_for_approval", "stopping", "completed", "failed", "cancelled")
inputstring
instructionsstring
modelstring
outputstring, nullableFinal answer when completed.
created_atstring (date-time)
updated_atstring (date-time)
json
{
  "id": "run_3f2e",
  "status": "running",
  "input": "Audit last month's invoices for duplicates and prepare a report.",
  "model": "default",
  "output": null,
  "created_at": "2026-09-22T08:00:00Z",
  "updated_at": "2026-09-22T08:03:10Z"
}

Response 404 — Unknown run.

Example

bash
curl -X GET "https://api.example.com/microservices/dedicated-agent/runs/<run_id>/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

GET /microservices/dedicated-agent/runs/{run_id}/events/

Run event stream

Server-Sent Events from the gateway for one run (tool calls, approvals, output). Open with EventSource or any SSE client.

Auth: Session token

Path parameters

FieldTypeRequiredDescription
run_idstringyes

Response 200 — SSE stream.

Content type: text/event-stream

Example

bash
curl -X GET "https://api.example.com/microservices/dedicated-agent/runs/<run_id>/events/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

POST /microservices/dedicated-agent/runs/{run_id}/{action}/

Approve a tool call, or stop the run

approval answers a pending approval with choice (once, session, always or deny; add all: true to apply to every pending request). stop cancels the run.

Auth: Session token

Path parameters

FieldTypeRequiredDescription
run_idstringyes
actionstring ("approval", "stop")yes

Request body (application/json, optional)

FieldTypeRequiredDescription
choicestring ("once", "session", "always", "deny")no
allbooleanno
json
{
  "choice": "once"
}

Response 200 — Done (gateway response).

Response 400 — Unknown action.

Example

bash
curl -X POST "https://api.example.com/microservices/dedicated-agent/runs/<run_id>/<action>/" \
  -H "Authorization: Token $FINBLADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"choice":"once"}'

Finblade documentation