Skip to content
Documentation menu

Prepare a workspace for API runs

A checklist for your workspace admin: store the model key, activate an agent and create an API key, so a developer can run it over the API.

The Quickstart assumes a model key, an activated agent and an API key. A person signed in to the web workspace sets up all three; an API key cannot. Hand this checklist to your workspace admin. It ends with a check you run yourself.

1. Who can do this

A workspace admin stores the model key, approves and activates agents, creates API keys, sets budgets and pauses or revokes agents. Other members can build an agent and submit it for review, unless their access profile is Business Owner. Roles are managed in the Team card and access profiles in the App access profiles card, both under Settings → Team & access.

2. Add the model key

Runs call models through the workspace's own OpenRouter account. Without a stored key a run returns 400 no_model_key.

  1. Open Settings → Models. In the Bring your own model card, paste the key into OpenRouter API key and select Save key. The key is checked with OpenRouter first, and a rejected key is not stored.
  2. The card now shows Key set. Test validates the stored key with OpenRouter again, without calling a model.
  3. Optionally choose a Default model, used for any agent that does not name its own.

3. Get an agent to an active version

A new agent runs only from a version that a workspace admin has reviewed and activated. In Agent Catalog, select New agent, or Edit on an existing agent. The builder has six steps: Define, Knowledge, Runtime, Skills, Review & Test and Govern & Publish.

  1. Configure. In Define, describe the outcome and set the Model, then complete the other steps.
  2. Submit. On Review & Test, select Submit for review.
  3. Approve. On Govern & Publish, a workspace admin leaves Approve selected under Reviewer decision and selects Approve agent. The agent cannot run yet.
  4. Capture. The Active version and draft card now appears on the same step. Select Prepare current draft for review. This captures the draft's behavior, permissions, connections and model as a candidate.
  5. Review. Check the candidate under Review this exact candidate. Models must name a model: the capture takes the agent's own, or the workspace default when the agent names none. If it reads None, set one and prepare the draft again. The Connections line ends with the number of write grants, and a first capture has none. If the agent must create or change records in a connected system, open Propose connection write access, tick the connection, which is listed by its id, and select Prepare current draft for review again. Without a write grant the version can only read from its connections: a write is refused, never held for approval.
  6. Activate. Under Finite retention policy, a workspace admin fills in Inactive payload retention (days, 1–365) and Purpose for retaining these records, then selects Activate reviewed version.

Approval and activation each run the required containment checks; a failed check refuses the change. If the draft, or a workspace setting such as the default model, changes after Capture, activation is refused: prepare the draft again.

Later edits to the draft do not change the active version: repeat Capture, Review and Activate to put them into effect. A new version keeps the earlier limits on authority, data classes, local access and connections unless Prepare a replacement restriction ceiling from this draft is ticked before the draft is prepared again.

What the API reports

GET /api/agents shows where each agent stands. Of these stages, only the last can run.

Stage`status``grantLifecycle``activeGrant.state`
Draftdraftmanagednot_active
Submitted for reviewin_reviewmanagednot_active
Approvedapprovedmanagednot_active
Activatedpublishedmanagedavailable

4. Adopt agents created before activation

An agent created before managed activation reports grantLifecycle as legacy_unadopted and has no activeGrant field. Agent Catalog marks it Legacy · adoption needed. Until it is adopted it runs with a plain POST /api/run, without a launch ticket.

To adopt it, a workspace admin opens its Govern & Publish step and does Capture, Review and Activate as in section 3; a legacy draft goes through Submit and Approve first. Before activating, the admin also ticks the confirmation that legacy traffic has stopped and its in-flight runs and approvals are reconciled. Adoption is refused while background runs of the agent are in progress or held for approval, or earlier operations of it are unresolved.

An admin can also require activated agents for the whole workspace: in the Active version and draft card, open Workspace adoption and final enforcement and select Review workspace inventory. Once no legacy agents, ongoing legacy runs or unresolved legacy outcomes remain, tick the confirmation and select Enforce managed-only execution. GET /api/tenant/config then reports the key agentGrants.enforceManaged as true. The web workspace cannot switch this off again.

5. Create the API key and hand it over

  1. Open Settings → API access. In the API keys card, enter a Name that says where the key will run.
  2. Under Scopes, tick run. It includes read, which is all the Quickstart needs. Leave admin unticked.
  3. Select Create key, then Copy. The key starts with ak_ and is shown only once. Select Done when it is stored.
  • Create one key for each developer or service, and pass it on through a secret manager or a CI secret store, not by email or chat.
  • A key depends on the admin who created it and stops working when that person leaves the workspace.
  • The admin who creates a key cannot approve the tool calls that jobs started with that key hold for review. If the key will run background jobs that need approval, a second workspace admin has to create the key or do the approving.
  • If a key may have leaked, select Revoke in the same card. Revocation applies from the next request and cannot be undone.

The developer exports the key. Authentication covers key handling in full.

Shell
export COA_API_KEY="ak_..."

6. Optional: set a spend budget

Under Settings → Budgets, the Monthly spend budget card takes a Monthly cap (USD) for the workspace and optional Per-authority-tier caps (USD/month); select Save. A cap can be saved only while receipt retention is unset or at least 32 days. With no cap, nothing is enforced.

A run that would take this month's recorded spend past a cap is refused before the model is called: HTTP 200, decision is deny, reasonCode is SPEND_OVER_BUDGET, and a receipt records the refusal. The check uses recorded spend and an estimate, so it is not a hard ceiling. See Budgets and spend refusals.

7. Pause or revoke an agent

These controls are on the agent's Govern & Publish step and need a workspace admin.

ControlEffect`GET /api/agents` reports
Pause new executionStops runs until an admin selects Make available.activeGrant.state is paused.
Revoke active grantsWithdraws the active version. Running again takes a new capture, review and activation.activeGrant.state is revoked; status stays published.
Revoke package, under Package actionsDoes the same and also marks the agent as revoked.status and activeGrant.state are both revoked.

API callers see the same in all three cases: a launch ticket request is refused with 409 agent_admission_unavailable, a ticket issued earlier no longer starts a run, and a background job in progress does not continue past its next call. A revoked legacy agent, which uses no ticket, returns HTTP 200: decision is deny, reasonCode is PKG_REVOKED.

Verify from the developer's side

These calls confirm the checklist. They only read, need curl and jq, and work with the read scope.

Shell
# 1. The key works and belongs to the expected workspace.
curl -sS https://centerofagentic.com/api/me \
  -H "Authorization: Bearer $COA_API_KEY" \
  | jq 'if .error then . else {userId, workspace: .tenant.slug} end'

# 2. A model key is stored.
curl -sS https://centerofagentic.com/api/tenant/settings \
  -H "Authorization: Bearer $COA_API_KEY" \
  | jq 'if .error then . else {hasOpenRouterKey, defaultModel} end'

# 3. Agents that can run now.
curl -sS https://centerofagentic.com/api/agents \
  -H "Authorization: Bearer $COA_API_KEY" \
  | jq 'if .error then . else [.agents[] | select(.activeGrant.state == "available")
         | {id, name, status, grantLifecycle}] end'

# 4. The active version of one of them. Use an id from call 3.
AGENT_ID="3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11"
curl -sS "https://centerofagentic.com/api/agents/$AGENT_ID/grants" \
  -H "Authorization: Bearer $COA_API_KEY" \
  | jq 'if .error then . else {lifecycle, paused, revoked,
         models: .active.capture.behavior.modelPolicy.allowedModelIds} end'
CallReady when
1userId starts with api-key: and workspace is yours, for example example-workspace.
2hasOpenRouterKey is true.
3The list is not empty.
4paused and revoked are false, and models names a model id.

If a call prints an object with error, the call itself failed: see Troubleshooting. If a check fails, point your admin to the matching section. Otherwise continue with the Quickstart.

Next steps

Something missing or unclear? Tell us and we will improve this page.