تخطَّ إلى المحتوى

API Reference Overview

هذا المحتوى غير متوفر بلغتك بعد.

GhostMind exposes an OpenAI-compatible API for a subset of capabilities, plus GhostMind-specific conversation, project, asset, audio-job and Action APIs. It is not a drop-in implementation of every OpenAI API.

Source inventory reviewed: 2026-09-10, revision 9a6a273. This is a source snapshot, not confirmation that this revision is deployed. Check the deployed specification and feature availability before integrating.

API surfaces

SurfacePrefixAuthenticationIntended audience
Product API/v1/*Workspace API key in Authorization: Bearer …Applications and developers
User App BFF/me/v1/*Login cookie; CSRF for mutationsGhostMind web app
Control Plane/admin/v1/*JWT and role checksAuthorized administrators/operators

The API origin is https://ghostmind.optdmsa.com. Append the full paths below. For the OpenAI SDK, use https://ghostmind.optdmsa.com/v1 as base_url. Never ship an administrator token or a provider session cookie in client code.

Public endpoint inventory

The reviewed specification contains 41 paths / 51 method-and-path operations. Multiple methods in one row are distinct operations. Auth, ownership, feature flags, quotas and provider availability still apply.

Chat, conversations and assets — 22 operations

PathMethodsPurpose
/v1/chat/completionsPOSTChat, including SSE when stream: true
/v1/modelsGETModel discovery
/v1/conversationsGET, POSTList or explicitly create conversations
/v1/conversations/{conversation_id}GET, PATCH, DELETEInspect, update or soft-delete
/v1/conversations/{conversation_id}/messagesGETMessage history
/v1/conversations/{conversation_id}/attachmentsPOSTMultipart upload
/v1/conversations/{conversation_id}/syncPOSTSynchronize upstream state
/v1/conversations/{conversation_id}/archivePOSTArchive
/v1/conversations/{conversation_id}/restorePOSTRestore
/v1/conversations/{conversation_id}/sharePOSTGrant participant access
/v1/conversations/{conversation_id}/participantsGETList participants
/v1/conversations/{conversation_id}/participants/{user_id}PATCH, DELETEChange or revoke participant access
/v1/conversations/{conversation_id}/transferPOSTTransfer ownership, subject to authorization
/v1/conversations/{conversation_id}/assetsGETList conversation assets
/v1/messages/{message_id}GETMessage and asset state
/v1/assets/{asset_id}GETAsset metadata/state
/v1/assets/{asset_id}/retryPOSTRequest failed-asset recovery
/v1/assets/{asset_id}/downloadGETAuthenticated binary download

Projects — 8 operations

PathMethodsPurpose
/v1/projectsGET, POSTList or create upstream projects
/v1/projects/{project_id}GET, PATCH, DELETERead, update or delete a project
/v1/projects/{project_id}/filesGET, POSTList or upload project sources
/v1/projects/{project_id}/files/{source_id}DELETEDelete a project source

Audio — 11 operations

PathMethodsPurpose
/v1/audio/transcriptionsPOSTAudio-to-text multipart request
/v1/audio/providersGETProvider discovery
/v1/audio/providers/{provider}/capabilitiesGETProvider capabilities
/v1/audio/providers/{provider}/voicesGETVoice catalog
/v1/audio/generationsGET, POSTList or create asynchronous speech jobs
/v1/audio/generations/{job_id}GETJob state
/v1/audio/generations/{job_id}/contentGETCompleted audio content
/v1/audio/generations/{job_id}/cancelPOSTRequest cancellation
/v1/audio/generations/{job_id}/retryPOSTRetry a failed job
/v1/audio/speechPOSTBounded synchronous speech request

Discovery and usage — 3 operations

PathMethodsPurpose
/v1/capabilitiesGETCapability manifest
/v1/connectionsGETRead-only account inventory and projected health
/v1/usageGETAggregated request/token counters scoped to the calling API key (?period=24h|7d|30d)

Health and capability values are projections, not a successful live probe for every feature. In particular, an active account or enabled: true does not prove that a particular image, project-file or audio request will succeed.

Actions and runs — 9 operations

PathMethodsRequired scopePurpose
/v1/actionsGETactions:readPublished/active catalog
/v1/actions/{slug}GETactions:readAction details
/v1/actions/{slug}/assetsGETactions:readList uploaded run assets
/v1/actions/{slug}/assetsPOSTactions:runMultipart file upload; returns asset_id
/v1/actions/{slug}/runsGETactions:readRun history
/v1/actions/{slug}/runsPOSTactions:runSubmit execution; returns HTTP 202
/v1/actions/{slug}/runs/{run_id}GETactions:readRun result/state
/v1/actions/{slug}/runs/{run_id}/eventsGETactions:readExecution events
/v1/actions/{slug}/runs/{run_id}/cancelPOSTactions:runRequest cancellation

Execution requires an enabled UAC service, an authorized beta-cohort workspace, a published Action version, appropriate risk policy and any required connection. Catalog visibility alone does not prove execution eligibility.

The run request accepts input (object), optional connection_id (UUID string), and optional idempotency_key (string). Obtain the Action’s required input contract from its publisher: the current public Action response does not expose a full input/output schema.

Terminal window
curl "https://ghostmind.optdmsa.com/v1/actions/$ACTION_SLUG/runs" \
-H "Authorization: Bearer $GHOSTMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": {}, "idempotency_key": "replace-with-your-operation-id"}'

This example requires an Action whose input accepts {}; it is not a universal payload. Use a new key for a new intended operation and reuse the same key when reconciling that operation. Audio jobs instead accept an Idempotency-Key header. Chat requests do not have a documented equivalent guarantee.

HTTP 202 means accepted, not business success. Poll the run resource and inspect status, verdict, output and error fields. needs_review is not success. Cancellation does not undo external effects that already occurred. Never blindly resubmit a write after an uncertain timeout.

File inputs (Actions that accept uploads)

Some published Actions declare file inputs (for example a photo upload Action). For each file input, upload the bytes first, then reference the returned asset_id in the run input:

Terminal window
# 1) Upload the file (multipart). Max 20 MiB by default.
curl -X POST "https://ghostmind.optdmsa.com/v1/actions/$ACTION_SLUG/assets" \
-H "Authorization: Bearer $GHOSTMIND_API_KEY" \
-F "file=@photo.png;type=image/png"
# → {"asset_id": "...", "filename": "photo.png", ...}
# 2) Reference it in the run input — one asset is consumed by exactly one run.
curl -X POST "https://ghostmind.optdmsa.com/v1/actions/$ACTION_SLUG/runs" \
-H "Authorization: Bearer $GHOSTMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": {"photo": {"asset_id": "<asset_id>"}, "caption": "hello"}}'

Assets are scoped to the calling workspace and that Action, expire (default 24 h), are checksum-verified at execution, and are consumed on use — a second run with the same asset_id fails with ASSET_INPUT_INVALID. Missing, expired, foreign-workspace or corrupt assets fail the run loudly; an empty file is never sent upstream.

Features not exposed as public developer APIs

There are currently no /v1 routes for workspace/key/invitation management, account connect/reconnect/capture, or the complete UAC teach/compile/verify/publish journey. These use the User App or authorized Control Plane. Usage IS exposed at GET /v1/usage — key-scoped aggregates only. Do not invent routes or use administrator credentials to work around gaps.

Generic browser execution and AI repair are not generally enabled execution features. Human login, MFA and CAPTCHA remain human-mediated.

OpenAPI and compatibility

Use public OpenAPI at https://ghostmind.optdmsa.com/openapi-public.json and the interactive https://ghostmind.optdmsa.com/docs-public. The full /openapi.json and /redoc include internal surfaces.

The current public schema is incomplete: Bearer security metadata and several response, SSE and binary schemas are missing. Configure authorization explicitly in generated clients and validate against the deployed API. See Errors for envelope variations and Rate Limits for the current throttling contract.

Integration checklist

  1. Use a workspace API key and least-privilege scopes; never provider credentials.
  2. Discover models and capabilities, then handle runtime refusal explicitly.
  3. Preserve X-GhostMind-Conversation-Id for chat continuity.
  4. Send uploads as multipart without manually setting the multipart boundary.
  5. Stop on response.failed in SSE; verify asset readiness before downloading.
  6. Bound polling/retries and distinguish acceptance from completion.
  7. Record response correlation IDs without recording credentials or sensitive content.
  8. Test invalid/expired keys, insufficient scopes, wrong-workspace resources, rate limits, timeouts, cancellation and provider reconnection in a sandbox.