socialistic connector

Connector API

Sessions & Runs

A session is a conversation with a skill. Each message you send creates a run that the agent processes. The lifecycle is: create session → send messages (one or more runs) → stop session. Sessions you create today are served by the sandboxed runtime: they hold no resident agent, the platform winds idle ones down automatically, and DELETE is an idempotent acknowledgement rather than a stop — it does not interrupt an in-flight run (use the run cancel endpoint for that). Older sessions, created while the classic runtime was still serving, do keep a Goose agent in memory, so stop any of those you no longer need.

A skill’s MCP servers are told which session is calling them, and a server can verify it offline with a token signed per turn: see Session identity.

Create a session

curl -X POST https://connector.socialistic.ai/v1/sessions \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{ "skill_slug": "my-skill-ab12cd" }'

# → 200
{ "session_id": "…" }

The account that starts a session pays for every run in it, from its own wallet — on a skill you own as on anyone else’s. There is no mode to choose: the skill decides how it is served and what a run costs, and on your own skill the creator margin of each run comes back to you. Address the session by session_ideverywhere — it is the only session identifier this API exposes.

POST/v1/sessionssession:run

Start a session against a skill. Every run in the session is paid from your own wallet, on your own skills too (there the creator margin comes back to you).

Request
FieldTypeDescription
skill_slugstring
from_draft_idoptionalstring (uuid)
is_draft_sessionoptionalboolean
shape_skill_asset_idoptionalstring (uuid)
Response
FieldTypeDescription
session_idstring (uuid)

Send a message

curl -X POST https://connector.socialistic.ai/v1/sessions/$SESSION/runs \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{ "input": "Summarise this repo." }'

# → 200
{ "run_id": "…", "status": "started" }

Each message starts a run. The call answers once the agent has accepted it — on a cold session that can take a minute or two while its sandbox starts — and the run then executes asynchronously: poll its status or subscribe to the SSE stream (see Streaming tab). Send further messages in the same session for a multi-turn conversation. A session runs one at a time: while the previous run is still going, POST /runs answers 409 RUN_PENDING — retry once it has finished — unless you send "busy_policy": "enqueue". Then the run waits behind the session’s work and starts on its own, in order: the call answers { "run_id": "…", "status": "queued" }. A session holds up to 16 waiting runs (beyond that, 429 QUEUE_FULL); one still waiting after 30 minutes ends failed with QUEUE_EXPIRED, and cancelling a queued run takes it out of line.

Because the call can be slow, send an Idempotency-Keyheader (any string up to 255 characters, unique per message) if you may need to retry it. A re-send with the same key on the same session returns the run the first send started — even if that send timed out — instead of starting a second one. Use a new key for each new message.

POST/v1/sessions/:sessionId/runssession:run

Send a message into a session. Dispatches a run and answers once the runtime has accepted it (status: "started") — a cold session can take a minute or two while its sandbox starts; the run then executes asynchronously. Poll the run-status endpoint or subscribe to the events endpoint. One run per session at a time: while the previous run is still going this answers 409 RUN_PENDING — retry after it finishes — unless the body sets `busy_policy: "enqueue"`: the run then waits in the session queue behind the session's work (first in, first out; at most 16 waiting, else 429 QUEUE_FULL) and the answer is status: "queued". A queued run starts on its own, can be cancelled like any other, and one that does not start within 30 minutes fails with QUEUE_EXPIRED. A run also answers 409 PRIOR_RUN_UNSETTLED while one of your earlier runs (in any session) has ended without its usage reported yet — retry in a few minutes. A read-only session (it ran on the retired classic runtime) answers 409 SESSION_READ_ONLY — create a new session to continue. An optional Idempotency-Key header makes a re-send of the same message return the run the first send started, instead of starting another.

Request
FieldTypeDescription
inputstring
attachment_urlsoptionalarray<string (uri)>
busy_policyoptional"enqueue"
Response
FieldTypeDescription
run_idstring
status"started" | "queued"

Poll run status

curl https://connector.socialistic.ai/v1/sessions/$SESSION/runs/$RUN_ID \
  -H "Authorization: Bearer $KEY"

# → 200
{ "run_id": "…", "status": "running" }

Returns the run’s lifecycle state: (queued →) running → completed | failed | cancelled.

A run that can’t start for billing reasons (such as WALLET_COLD) is refused by the POST itself with that error code; a run that runs out of budget mid-way ends failed with its error_code.

GET/v1/sessions/:sessionId/runs/:runIdsession:run

Get a run's current state (queued | running | completed | failed | cancelled). Poll this instead of holding an SSE connection. Once the run has ended (current sessions; not legacy sidecar ones) it also carries `result`, the final reply text of a completed run, and `charge_credits` / `charge_usd`, what your wallet was debited for it, as soon as that is final (absent until then: poll again). Reading an ended run settles its charge if the runtime has reported it.

Request

No request body.

Response
FieldTypeDescription
run_idstring
status"queued" | "running" | "completed" | "failed" | "cancelled"
error_codeoptional"KEY_INVALID" | "KEY_EXPIRED" | "RATE_LIMIT" | "PROVIDER_CREDITS_EXHAUSTED" | "PROVIDER_ERROR" | "MODEL_IMAGE_UNSUPPORTED" | "STREAM_TIMEOUT" | "STREAM_DISCONNECTED" | "GATEWAY_TIMEOUT" | "GOOSE_ERROR" | "CANCELLED" | "RUN_PENDING" | "BUDGET_EXHAUSTED" | "ATTACHMENT_STAGING_FAILED" | "QUEUE_EXPIRED" | "UNKNOWN" | "WALLET_COLD" | "WALLET_HELD" | "SESSION_READ_ONLY" | "PRIOR_RUN_UNSETTLED" | "QUEUE_FULL"
error_stageoptional"agent" | "gateway" | "provider" | "network" | "unknown"
resultoptionalstringThe run's final reply text. Present once the run has completed (and produced one)
charge_creditsoptionalstringWhat your wallet was debited for this run, in platform credits (a decimal string; "0" when another party paid). Absent until the run's charge is final
charge_usdoptionalnumbercharge_credits in USD at the fixed credit rate. Present with charge_credits

Cancel a run

Cancels a running run via the agent. Idempotent.

curl -X POST https://connector.socialistic.ai/v1/sessions/$SESSION/runs/$RUN_ID/cancel \
  -H "Authorization: Bearer $KEY"
POST/v1/sessions/:sessionId/runs/:runId/cancelsession:run

Cancel a running or queued run. Idempotent.

Request

No request body.

Response

No response body.

Steer a run

Adds text to a run while it executes, without starting another: the agent takes it in at its next step. Text only. The run’s event stream reports it as steer events (see Streamingtab). A run that is not executing — queued, still starting, or finished — answers 409 RUN_NOT_STEERABLE; send a message instead.

curl -X POST https://connector.socialistic.ai/v1/sessions/$SESSION/runs/$RUN_ID/steer \
  -H "Authorization: Bearer $KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"text":"Use metric units"}'

# → 200
{ "run_id": "…", "steer_id": "…" }
POST/v1/sessions/:sessionId/runs/:runId/steersession:run

Add text to a run while it executes, without starting another run: the agent takes it in at its next step. Text only, on your own sessions. The run's events report it as `steer` events — accepted, then picked_up, or discarded when the run finished before taking it in. An optional Idempotency-Key header makes a resend answer instead of delivering twice. 409 RUN_NOT_STEERABLE: the run is not executing (starting, queued or finished); nothing is redirected to another run — send a message instead. 409 STEER_UNCONFIRMED: an earlier attempt under the key may have arrived; do not resend. 501 STEER_UNSUPPORTED: the runtime cannot steer yet. 404 RUN_NOT_FOUND: no such run in this session.

Request
FieldTypeDescription
textstring
Response
FieldTypeDescription
run_idstring
steer_idstring

Get session detail

Returns the full session: metadata, conversation history, and token usage.

GET/v1/sessions/:sessionIdsession:run

Get a session's full detail: metadata (owner, skill, Toscana session id), conversation history, and token usage — for a session your account runs (access: owner). `?history=false` skips reading the conversation: `messages` comes back empty with `history_complete: false` and `meta: null`. With `?history=false` the creator of the session's skill may also read a session on their skill (access: skill_creator): owner_id identifies the consumer, while seed_context is withheld as null and the conversation is never returned. An MCP server on a shared skill can check the X-Socialistic-Session header each of its requests carries, against its X-Socialistic-Skill-Slug. Anyone else gets 404 SESSION_NOT_FOUND.

Query parameters
FieldTypeDescription
historyoptional"true" | "false""false" skips the conversation (metadata only)
Request

No request body.

Response
FieldTypeDescription
session_idstring (uuid)
owner_idstring (uuid)The session's consumer, including when you read metadata as the skill's creator
access"owner" | "skill_creator"owner: your own session. skill_creator: a session on a skill you created, read with ?history=false — seed_context is withheld, while owner_id identifies the consumer
toscana_session_idstring | nullThe session's Toscana session id; null on a legacy session
goose_session_idstring | null
skill_slugstring
skill_display_namestring
skill_source_urlstring | null
seed_contextoptionalany | null
created_atstringISO 8601
messagesarray<object>
messages[].rolestring
messages[].contentarray<any>
messages[].created_timestampnumber
messages[].metadataobject | null
metaobject | null
meta.input_tokensnumber | null
meta.output_tokensnumber | null
meta.total_tokensnumber | null
history_completeoptionalboolean
read_onlyoptionalboolean

List sessions

Query params: ?skill_slug (filter), ?page (1-indexed), ?page_size (max 50).

GET/v1/sessionssession:run

List your sessions. Query params: ?skill_slug (filter), ?page (1-indexed, default 1), ?page_size (max 50, default 20).

Query parameters
FieldTypeDescription
skill_slugoptionalstringOnly sessions on this skill
pageoptionalinteger1-indexed, default 1
page_sizeoptionalintegerDefault 20, max 50
Request

No request body.

Response
FieldTypeDescription
sessionsarray<object>
sessions[].session_idstring (uuid)
sessions[].skill_slugstring
sessions[].skill_display_namestring
sessions[].created_atstringISO 8601
sessions[].first_messagestring | null<=200 char preview of the first user message
totalinteger
pageinteger
page_sizeinteger

Stop a session

When you are done, you can stop the session. Sessions created today reclaim their own capacity — the sandbox archives itself once idle — so stopping is an acknowledgement rather than a requirement, and returns 200 without doing any work. Older sessions hold a resident agent until stopped, and there stopping is what frees it.

curl -X DELETE https://connector.socialistic.ai/v1/sessions/$SESSION \
  -H "Authorization: Bearer $KEY"

# → 200
{ "ok": true, "session_id": "…" }

Stopping is lossless and idempotent: the session record and conversation history are preserved. Sending a new message to a stopped session transparently resumes the agent — except on a read-only session (one that ran on the retired classic runtime), which takes no new messages.

Calling it in teardown is still the safe habit for batch and CI workloads: it is harmless where it is a no-op, and it is the thing that releases capacity on any session that does hold an agent.

DELETE/v1/sessions/:sessionIdsession:run

End a session. Legacy sidecar sessions have their resident agent stopped; Toscana sessions have none to stop (idle sandboxes are archived by the runtime), so this is a no-op there. The session record and history are preserved, and a new message resumes the session — except on a read-only session (it ran on the retired classic runtime), which takes no new messages. Idempotent.

Request

No request body.

Response

No response body.

Search GitHub for a skill

Describe a whole task and the platform’s GitHub skill search looks for skills and runnable open-source code that can do it, verifies each candidate by reading its files, and returns a ranked shortlist. The search is a session on a built-in skill with you as its consumer: it reads GitHub as you, through a read-only token minted from your own GitHub App installation for each run, and its runs are paid from your wallet like any other. Without a connected GitHub App it answers 403 GITHUB_NOT_CONNECTED before anything is created or charged.

curl -X POST https://connector.socialistic.ai/v1/github-skill-search \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{ "task": "Turn my monthly PDF bank statements into one categorised CSV, offline." }'

# → 200
{ "session_id": "…", "run_id": "…", "skill_slug": "…" }

curl https://connector.socialistic.ai/v1/github-skill-search/$SESSION \
  -H "Authorization: Bearer $KEY"

# → 200 (once delivered)
{ "session_id": "…", "status": "completed", "task": "…",
  "result": { "framing": "…", "coverage": "…",
    "candidates": [ { "name": "…", "tier": "runnable-code", "kind": "cli",
      "repo": "owner/repo", "url": "https://github.com/owner/repo", "fit": "…",
      "evidence": ["…"], "requirements": [], "stars": 1200, "license": "MIT" } ] } }

Follow the run like any other (poll it, or stream its events — each GitHub request the search makes is a tool call) and read the shortlist once status leaves running. To refine, send another message into the same session; the read always returns the latest shortlist. A candidate is what the search observed on GitHub, not yet a platform skill: run one by importing its url with POST /v1/skills/github-import.

POST/v1/github-skill-searchsession:run

Search GitHub for skills and runnable open-source code that can complete a task. Body: { task, attachments? } — task: the whole task in your own words (2–4000 characters), not keywords; attachments (optional, up to 20): the files the task comes with, as { name, type, size } metadata only, so the search looks for a skill that takes that input (their contents are never sent). Starts a session on the platform's GitHub skill search skill with you as its consumer and dispatches its first run with the task; the search reads GitHub as YOU, through a read-only token minted from your own GitHub App installation for that run alone. You pay for the run from your own wallet, like any run. Answers { session_id, run_id, skill_slug } once the run is accepted; follow it like any run (GET /v1/sessions/:sessionId/runs/:runId, or its events) and read the shortlist with GET /v1/github-skill-search/:sessionId. To refine, send another message into the same session (POST /v1/sessions/:sessionId/runs). Refused before anything is created or charged: 403 GITHUB_NOT_CONNECTED (connect the GitHub App once at socialistic.ai, then retry) and 503 GITHUB_SKILL_SEARCH_DISABLED (not offered on this deployment). Otherwise the same refusals as sending a run, e.g. 422 WALLET_COLD when your balance cannot cover it. An optional Idempotency-Key header makes a retry (say, after a timeout while the sandbox starts) return the first attempt's { session_id, run_id } instead of starting and paying for another search; while that first attempt is still being created a retry answers 409 IDEMPOTENCY_IN_PROGRESS. A key is bound to its task: reusing it for a different task answers 422 IDEMPOTENCY_KEY_REUSED.

Request
FieldTypeDescription
taskstring
attachmentsoptionalarray<object>
attachments[].namestring
attachments[].typeoptionalstring
attachments[].sizeinteger
Response
FieldTypeDescription
session_idstring (uuid)
run_idstring
skill_slugstring
GET/v1/github-skill-search/:sessionIdsession:run

Where a GitHub skill search stands and what it found. status: running | completed | failed | stopped (the latest run's). task: the task as asked. result: null until the search delivers its shortlist, then { framing, candidates, coverage } — up to 10 candidates, ranked by verified task fit and execution readiness, each with name, tier (skill-native | runnable-code | composable-library), kind, repo, url (a canonical GitHub URL, with /tree/<branch>/<path> inside a monorepo), fit, evidence, requirements and observed stars / license / pushed_at. An empty candidates list with a coverage note means nothing qualified. Candidates are what the search observed on GitHub, not platform skills: to run one, import it with POST /v1/skills/github-import { url }. Poll every few seconds while running; 502 UPSTREAM_ERROR means the runtime did not confirm whether the run is still working — the search is not over, retry the read. A session that is not a search, or not yours, answers 404 SESSION_NOT_FOUND.

Request

No request body.

Response
FieldTypeDescription
session_idstring (uuid)
status"running" | "completed" | "failed" | "stopped"
taskstring | null
resultobject | null
result.framingoptionalstring
result.candidatesarray<object>
result.candidates[].namestring
result.candidates[].tier"skill-native" | "runnable-code" | "composable-library"
result.candidates[].kind"skill" | "mcp-server" | "cli" | "script" | "workflow" | "library" | "application"
result.candidates[].repostring
result.candidates[].urlstring
result.candidates[].default_branchoptionalstring | null
result.candidates[].fitstring
result.candidates[].evidenceoptionalarray<string>
result.candidates[].starsoptionalinteger | null
result.candidates[].licenseoptionalstring | null
result.candidates[].pushed_atoptionalstring | null
result.candidates[].recent_commitsoptionalinteger | null
result.candidates[].requirementsoptionalarray<string>
result.coverageoptionalstring