---
slug: developer-api-published-method
title: Publish a workspace method as an API
category: capability
status: published
tags: [publish api, sell api, customer key, task policy, company skill, skill revision, runtime, harness, model, allocation, 发布 API, 客户密钥, 技能, 模型, 执行器, 把 workspace 的 Skill 发布成客户可以调用的 API]
aliases: []
lastEditAt: 2026-08-03
---
## Publish a workspace method as an API

Any workspace `OWNER` or `ADMIN` can use the same developer-key endpoint to
package one current, Markdown-only Company Skill as a customer-callable Task
API. Software Team is the first intended use, not a hard-coded exception: a
marketing, research, operations, or other workspace can publish its own method
through the identical backend contract. This release does not add a workspace
UI, marketplace, checkout, payout, revenue share, or customer-account system.

```http
POST /api/developer/api-keys
Content-Type: application/json

{
  "companyId": "<seller-workspace-id>",
  "name": "Acme Software Team API — customer A",
  "task_policy": {
    "skill_id": "<company-skill-id>",
    "max_task_budget_usd": 5,
    "credit_usd": 100,
    "runtime": {
      "harness": "ClaudeCode",
      "model": "ClaudeFable5",
      "reason": "This published service uses our verified coding runtime.",
      "catalogVersion": "<from-runtime-catalog>",
      "catalogDigest": "<from-runtime-catalog>"
    }
  }
}
```

The returned `tyc_...` token is shown once. Give that token to the customer;
they call the normal `/api/public/tasks` endpoints. The policy freezes the
selected Skill revision and optional runtime receipt at issuance. Each call
creates a fresh isolated task-bound workspace, copies that exact pinned Skill
revision there, and binds it to the canonical Task. The customer's bearer key
cannot select another workspace, Skill, runtime, or cadence, and has only
`tasks:read` and `tasks:write` scope.

`credit_usd` is a Task-budget allocation, not a payment collected by Tycoon.
The seller charges their customer however they choose. On each accepted call,
Tycoon atomically reserves the caller's requested Task budget (or the
per-Task maximum when omitted) from that key's allocation; a request cannot
exceed either bound. Actual model/runtime/media/connector usage is still
metered against the seller workspace. Allocation is not an automatic refund or
revenue ledger in this release; revoke and replace a key to stop future work.

Use `GET /api/developer/api-keys?companyId=<seller-workspace-id>` to inspect a
key's pinned revision, allocation, and reserved amount without exposing its
token. The issuing browser session is required for this management endpoint.

## Choose a runtime

An ordinary workspace key may choose a currently supported execution profile
per Task. Read the live, content-addressed catalog first:

```bash
curl -sS https://tycoon.us/api/public/task-runtime-catalog \
  -H "Authorization: Bearer $TYCOON_API_KEY"
```

Pass the returned `version` and `digest` with the desired `harness`, model, and
a short reason in `runtime` on `POST /tasks`. Tycoon rejects a stale catalog,
unknown model, or unavailable employee instead of silently substituting a
different runtime. A published-method key fixes this choice at issuance, so its
customer cannot override it.

## Next steps

- [Authentication and workspace billing](/help/developer-api-authentication-billing)
- [Create and read Tasks](/help/developer-api-create-read-tasks)
- [Idempotency, retries, errors, and limits](/help/developer-api-reliability-errors)
