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

Projects

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

Projects group conversations with shared file context, instructions, and memory policies. Projects are ChatGPT upstream projects linked to your connected account.

List Projects

Terminal window
curl https://ghostmind.optdmsa.com/v1/projects \
-H "Authorization: Bearer $GHOSTMIND_API_KEY"

Response:

[
{
"id": "uuid",
"name": "My Project",
"slug": "my-project",
"status": "active",
"is_default": false,
"instructions": null,
"effective_memory_policy": "project_only",
"memory_policy_status": "verified",
"upstream_account_id": "uuid",
"conversation_count": 3,
"created_at": "2026-08-25T10:00:00Z",
"updated_at": "2026-08-25T10:00:00Z"
}
]

Query parameters:

  • search — Filter by name (substring match)
  • limit — Max results (default 50, max 200)
  • offset — Pagination offset

Get Project Detail

Terminal window
curl https://ghostmind.optdmsa.com/v1/projects/{project_id} \
-H "Authorization: Bearer $GHOSTMIND_API_KEY"

Returns project details including a sources array of uploaded files.

Create Project

Terminal window
curl -X POST https://ghostmind.optdmsa.com/v1/projects \
-H "Authorization: Bearer $GHOSTMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Research Assistant",
"instructions": "You are a research assistant. Be concise.",
"memory_policy": "project_only"
}'

Body:

  • name (required) — Project name
  • instructions (optional) — Project instructions for the AI
  • memory_policy (optional) — provider_default | account_connected | project_only
  • upstream_account_id (optional) — Specific account UUID. Auto-selected if omitted.

Response (201):

{
"id": "uuid",
"name": "Research Assistant",
"slug": "research-assistant",
"status": "active",
"effective_memory_policy": "project_only",
"memory_policy_status": "verified",
"upstream_account_id": "uuid",
"created_at": "2026-08-25T10:00:00Z"
}

Update Project

Terminal window
curl -X PATCH https://ghostmind.optdmsa.com/v1/projects/{project_id} \
-H "Authorization: Bearer $GHOSTMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Updated Name", "instructions": "New instructions"}'

At least one of name or instructions must be provided.

Delete Project

Terminal window
curl -X DELETE https://ghostmind.optdmsa.com/v1/projects/{project_id} \
-H "Authorization: Bearer $GHOSTMIND_API_KEY"

Returns 204 No Content. The project is deleted upstream on ChatGPT.

Upload File to Project

Terminal window
curl -X POST https://ghostmind.optdmsa.com/v1/projects/{project_id}/files \
-H "Authorization: Bearer $GHOSTMIND_API_KEY" \
-F "file=@document.pdf"

Limits: Max 10 MB per file.

Response (201):

{
"id": "uuid",
"source_type": "file",
"title": "document.pdf",
"status": "processing",
"mime_type": "application/pdf",
"size_bytes": 102400,
"created_at": "2026-08-25T10:00:00Z"
}

List Project Files

Terminal window
curl https://ghostmind.optdmsa.com/v1/projects/{project_id}/files \
-H "Authorization: Bearer $GHOSTMIND_API_KEY"

Delete Project File

Terminal window
curl -X DELETE https://ghostmind.optdmsa.com/v1/projects/{project_id}/files/{source_id} \
-H "Authorization: Bearer $GHOSTMIND_API_KEY"

Returns 204 No Content.

Using Projects in Chat

Projects created here are upstream (ChatGPT) projects. Two correct ways to chat inside one:

A. Create a conversation bound to the project (recommended):

Terminal window
curl -X POST https://ghostmind.optdmsa.com/v1/conversations \
-H "Authorization: Bearer $GHOSTMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Analysis chat", "upstream_project_id": "project-uuid"}'

Then send chat requests with X-GhostMind-Conversation-Id: <conversation id>.

B. Direct per-request routing via the project slug:

Terminal window
curl -X POST https://ghostmind.optdmsa.com/v1/chat/completions \
-H "Authorization: Bearer $GHOSTMIND_API_KEY" \
-H "Content-Type: application/json" \
-H "X-GhostMind-Upstream-Project: research-assistant" \
-d '{
"model": "auto",
"messages": [{"role": "user", "content": "Analyze the uploaded files."}]
}'

X-GhostMind-Upstream-Project takes the project slug (e.g. research-assistant), not the UUID. Do NOT use X-GhostMind-Project for this — that header addresses internal GhostMind projects and returns 422 wrong_project_header when given an upstream slug.

Projects created through POST /v1/projects are routable immediately — a tenant-level routing binding is granted automatically, so every API key in the tenant may select the new slug. Projects registered by other means (admin import, provider sync) need an explicit binding from a tenant admin (POST /admin/v1/tenants/{tenant_id}/bindings), otherwise explicit selection returns 403 upstream_project_out_of_scope.

The AI has access to project files from the first message.

Memory Policies

  • provider_default — Let ChatGPT choose its default memory scope
  • account_connected — Shared memory across all conversations on this account
  • project_only — Isolated memory scoped to this project only

Next Steps