service-public-api
How to act on this Organization's Agents, Skills and Projects through the Opsiforce Public API (`public-api`), as the human who created this Project.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-05
- Stars
- ★ 43
- Forks
- 9
01 前言 Front Matter
- name
- service-public-api
- description
- How to act on this Organization's Agents, Skills and Projects through the Opsiforce Public API (`public-api`), as the human who created this Project.
02 资源文件 4
- 资产文件icon.svg234 B
- 参考文档service.json3.5 KB
- 脚本service.ts246 B
- 脚本service.types.ts1.2 KB
03 SKILL.md 正文
Opsiforce Public API
public-api is the platform's own API: Opsiforce Public API v1, documented at /api/v1/docs on
the main host. Call its real paths on its Service host with this Project's key in a header:
curl -s "https://public-api.$EXTERNAL_SERVICES_HOST/api/v1/me" -H "Authorization: Bearer $SERVICE_GATEWAY_API_KEY"
How it differs from calling the API as a person
- Every call acts as the human who created this Project, with that human's permissions as they stand
at the call, in this Project's Organization only.
GET /mesays who that is. - Projects, Skills and Agents you create are stamped as made by this Project. You see and reach those Projects and the ones this Project's configuration lists under Other Projects, and no others. You change only the Skills and Agents you created, besides the one a Builder chat is about; every other Skill and Agent is read-only to you.
- Other Projects are not yours: you may read, open (
connect) and restart them, but never delete them. - Reads are open to every connected Project. Each write is one setting of this Project's Opsiforce
Public API configuration, all off until someone turns them on: Edit Skills and Agents, Create
Agents (with Agent limit), Create Projects (with Project limit, and possibly Allowed
Agents, which lists the only Agents you may create Projects of, and Workspace for new Projects,
where they all go), Open and restart Projects (
connect,restart, and a Test Project'supdateandreset), and Delete Projects. GET /.well-known/opsiforceon the Service host lists its routes, the setting each write needs and this Project's settings. Any other path answers404withOpsiforce-Outcome: not supported.
Answers and refusals
- An answer is the API's own JSON, a refusal its
application/problem+json: atypeending in the reason (project-not-found,permission-denied,validation-error,name-unavailable, …) and adetailthat says what to change. Read thedetail. 403withOpsiforce-Outcome: not allowed: the setting named inOpsiforce-Settingis off. Thedetailnames it, links to it and says who can change it. Tell the user that in plain words, with the link; do not retry or look for another way round.403not allowedwithOpsiforce-Setting: createdProjectAgentsonPOST /projects: this Project may create Projects only of the Agents listed there. Use one of those, or tell the user who can add the Agent. WithcreatedProjectsWorkspace, leaveworkspaceIdout: your Projects go to the chosen Workspace.409max-created-agents: this Project already has as many Agents as Agent limit allows. Tell the user who can raise it.409max-created-projects: this Project already has as many Projects as Project limit allows. Delete one you created, or tell the user who can raise it.409chain-too-deeponPOST /projects: this Project was itself made by a chain of Projects as deep as the platform allows. Do not retry; do the work in this Project or ask the user.404project-not-foundfor a Project the user named: this Project neither created it nor lists it under Other Projects, or its creator cannot see it. Tell the user what thedetailsays; do not look for another way in.permission-deniedwithout that header: the creator lacks thepermissionit names, or the Skill or Agent was not made by this Project. Tell the user which permission their account needs, or that this Project may only read that one.
Talking to a Project you can open
POST /projects/<id>/environments/<environmentId>/connect answers baseUrl, openapiUrl,
sessionId and build. For this Project, baseUrl is a full URL on the runtime proxy, not on this
Service host: call it exactly as returned, with the same key. Behind it is opencode's own API, and
openapiUrl documents it.
curl -s -X POST "$BASE_URL/api/session/$SESSION_ID/prompt" -H "Authorization: Bearer $SERVICE_GATEWAY_API_KEY" \
-H 'Content-Type: application/json' -d '{"id":"msg_…","text":"Research example-org"}'
curl -s "$BASE_URL/api/session/$SESSION_ID/message?limit=50&order=desc" -H "Authorization: Bearer $SERVICE_GATEWAY_API_KEY"
- Give every prompt your own
id: sending the sameidand text again is harmless. GET $BASE_URL/api/eventstreams events. A prompt is done atsession.execution.succeeded,session.execution.failedorsession.execution.interruptedfor your Session.- It needs Open and restart Projects, as Connect does; with it off the runtime proxy answers
403. A Project you neither created nor list under Other Projects answers404. /api/proxy/...on this Service host answers404not supported: that is the wrong host, not a missing feature. UsebaseUrl.
Habits
- List before you create:
GET /skills,GET /agents,GET /projects; page withcursoruntilnextCursoris null. - After
POST /projects, pollGET /projects/<id>until the Development environment is active, or callPOST /projects/<id>/environments/<environmentId>/connect, which waits for it. - Delete the Projects you made for a test once you have what you needed from them.
04 同仓库更多 Skills
figma-use
**MANDATORY prerequisite** — you MUST invoke this skill BEFORE every `use_figma` tool call. NEVER call `use_figma` directly without loading this skill first. Skipping it causes common, hard-to-debug failures. Trigger whenever the user wants to perform a write action or a unique read action that requires JavaScript execution in the Figma file context — e.g. create/edit/delete nodes, set up variables or tokens, build components and variants, modify auto-layout or fills, bind variables to properties, or inspect file structure programmatically.
figma-use-slides
This skill helps agents use Figma's use_figma MCP tool in the Slides context. Can be used alongside figma-use which has foundational context for using the use_figma tool.
figma-use-motion
Motion / animation context for the `use_figma` MCP tool — animating Figma nodes via manual keyframes, animation styles, easing, and timeline duration. Load alongside figma-use whenever a task involves adding, editing, or inspecting animation on a node.
figma-use-figjam
This skill helps agents use Figma's use_figma MCP tool in the FigJam context. Can be used alongside figma-use which has foundational context for using the use_figma tool.
figma-swiftui
SwiftUI ↔ Figma translation. Use whenever the user mentions Swift, SwiftUI, iOS, iPhone, or iPad — in EITHER direction — translating a Figma design into SwiftUI (design → code), or pushing SwiftUI views / screens / tokens back into a Figma file (code → design). Triggers on phrases like 'implement this Figma design in SwiftUI', 'build this screen in Swift', 'push this SwiftUI view to Figma', 'mirror my Swift code in a Figma file', or whenever a Figma URL appears alongside `.swift` files / an `.xcodeproj`. Routes to a direction-specific reference doc; loads alongside `figma-use` for the code → design path.
figma-shaders
**MANDATORY prerequisite** — load this skill before calling `create_shader` or `update_shader`. Use when the user asks to create, author, change, fix, or iterate on a shader effect, shader fill, custom effect, custom fill, or procedural shader in Figma.