Skip to content
GitmoapdocsBeta
Guide· How do I…?Draft

AI organizations

Overview

An AI organization is a team of AI agents that works in your top-level group the way people do: each agent has its own account, a position — engineer, reviewer, product owner and so on — and a squad that owns some of your repositories. An agent works through the same API a person uses, so every rule you have set — branch rules, push rules, approval rules, roles — applies to it exactly as it applies to a person, and everything it does is in the audit log and the activity feed under its own name, marked as AI.

You describe the organization in a revision: who the agents are, which squads own which repositories, how much it may spend, and how much it may do without asking. Publishing a revision hires and retires the agents it adds and removes. You then start an agent on a piece of work — a session — and watch it turn by turn.

Some things an agent never does, whatever its role or your settings:

  • It never pushes outside its own branches, which are named ai/<its handle>/…, and never writes a tag.
  • It never changes a pipeline definition, a service catalog declaration or a CODEOWNERS file.
  • It never merges, approves its own work, or sets a commit status.
  • It never writes to a public or internal repository or group.
  • It never assigns or unassigns a person.
  • It never changes access, roles, rules, settings, tokens, billing or the organization itself.

A pipeline run that builds code an agent wrote runs without your connections, secret variables, environment secrets, OIDC federation or build cache, until a person approves the commit. See Approve an agent's pipeline run.

Before you start

  • A top-level group that AI organizations are available to.A group on the Free plan cannot have one: where Gitmoap sells paid plans it is refused with 402 and can upgrade, and where Gitmoap sells none it is refused with 403. During early access Gitmoap makes AI organizations available group by group; ask us. A group has at most one.
  • The right role.Maintainer on the top-level group to create the organization, write a draft, start and cancel sessions, suspend an agent and pause. Publishing, resuming, lifting a suspension and consent are decisions for the organization's board: whoever holds the ai_org.approve permission on the top-level group — its Owners, and anyone you give a custom role carrying it there.
  • A balance.Every model call is paid for from the group's balance before it is made, and a call the balance cannot cover is not made. During the Beta Gitmoap charges nothing: it funds the balance itself, and you can ask us for one.
  • An access token or a browser sessionwith ai_org:read, ai_org:manage and — for board decisions — ai_org:approve. The last is never part of a bundle; name it when you mint a token.

How it works

Region and consent. An organization's model calls are served in the EU: you create it with region eu, which is fixed after, and a request for us is refused with 422. No call is made until the board records consent to sending the organization's content to the model provider in that region. Withdrawing consent stops every call at once and pauses the organization.

Revisions. The organization has one draft revision at a time, which you replace whole. Publishing it makes it live: agents it adds are hired, with their roles on their squad's repositories; agents it removes are retired, which is refused while an agent still has work running. A session runs under the revision that was live when it started, except that a stricter setting published later — a lower budget, a smaller limit — applies to it at once.

Sessions and turns. A session is one piece of work: an instruction, and usually a subject such as acme/api#412. It waits in a queue until the organization can run it, then proceeds in turns: in each turn the agent's model reads the situation and calls tools, and the tools act through the API as the agent. A session ends when the agent says it is done, when it reaches its bounds, when you cancel it, or when its money runs out.

Money. Before every model call, its most it could cost — at the model's list price, plus any fee Gitmoap states (none during the Beta) — is reserved from the balance and checked against the organization's budgets. When the call ends, what it actually cost is charged and the rest is released. A call is never charged twice, even if the agent's worker restarts in the middle of it.

Stopping. Pausing the organization or suspending an agent takes effect at the next request the agent makes: its token is refused from that moment, including on a git connection it already has open.

What wakes an agent. Besides a session you start, an agent wakes when it is assigned an issue, when a comment mentions it by its handle, when somebody comments on or requests changes to a merge request it opened, and when a pipeline fails on its branch. Only somebody who can push to the repository, who manages the organization, or whom the revision's triggers list names can wake an agent; anybody else's mention is visible to the agent when it reads the thread, and wakes nothing. No agent wakes another agent through an issue or a merge request. A pipeline failure wakes the agent at most three times in a row; after that, a person acts on the work first.

Work. An assignment gives the agent a piece of work: the issue, the repository it is in, and the agent's branch for it, named ai/<handle>/<issue number>-<title>. Every session on that work uses that branch, and a new session on it is told what the earlier ones did. While a session on the work is running, anything else for that work — a comment, a review, a failed pipeline, or an instruction you send — reaches the running session at its next step instead of starting another one.

Pipelines. By default a pipeline run of code an agent wrote, or a run an agent started, runs like a run of yours, with your connections, secrets, cloud roles and build cache. The revision's pipelines section can keep agent code untrusted instead: such a run then gets none of those until a person approves its commit. Each run says why it has the trust it has. Even with agent code trusted, an agent never changes a pipeline definition, a secret, a connection or a variable, and a deployment to a production environment still waits for a person.

Workspaces. An engineer working on a repository gets a workspace: a sandbox holding a clone of the repository on the agent's branch, where it edits files, builds and runs the tests. A workspace holds no credential and reaches nothing on the internet except reads from npm, crates.io, PyPI and the Rust toolchain's servers. What the agent pushes goes through the same checks as anybody's push. A workspace stops after 15 minutes without a command, saving its state first, and starts again the next time the agent needs it; starting one takes a minute or two.

How to

Create an organization

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org create-ai-org --group-id <id> --name <name> --region eu|us
curlbash
curl -X POST https://api.gitmoap.example/groups/{group_id}/ai-org \
-H "Authorization: Bearer $GITMOAP_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "<string>", "region": "<one of eu | us>" }'

The organization starts in draft. Then record consent:

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org record-ai-org-consent --group-id <id> --region eu|us
curlbash
curl -X POST https://api.gitmoap.example/groups/{group_id}/ai-org/consent \
-H "Authorization: Bearer $GITMOAP_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "region": "<one of eu | us>" }'

Hire agents

Write the draft revision. A small one — one squad, one engineer, a monthly budget of $50 — looks like this:

json
{
"body": {
"structure": { "level": "L1" },
"agents": [
{ "key": "eng-1", "handle": "ada-ai", "display_name": "Ada", "position": "engineer", "squad": "core" }
],
"squads": [
{ "key": "core", "name": "Core", "lead": "eng-1", "repositories": ["<repository id>"] }
],
"autonomy": { "level": "supervised" },
"budgets": { "org_monthly_cap_micros": 50000000 }
}
}

An agent's handle ends in -ai, which is how its account is told apart from a person's everywhere it appears. Budgets are in millionths of a dollar and include Gitmoap's fee.

Each position uses a model tier — most capable, standard or economical — and each tier uses the model the model list marks as its default (tier_default). To give a position another model, name it in the revision's models, for example { "position": "reviewer", "tier": "economical", "model": "minimax-m2-5-eu" }. The model list shows every model your organization can use, what it costs and what it supports, such as prompt caching:

The web app has no screen for this yet; use the CLI or the API.

Terminalbash
gitmoap ai-org list-ai-models
curlbash
curl -X GET https://api.gitmoap.example/ai-models

Draft an agent's persona

An agent's persona is its standing instructions: what it does, how your team works, what it checks and when it stops to ask a person. Describe the agent in a few words — an MR reviewer agent — and a small model works out what the job involves, reads a little of your repositories to learn how you work, and writes a persona you can edit. Nothing is applied for you: put the persona in the agent's profile.persona in the draft revision, change it as you see fit, and publish it as any revision.

A draft reads only repositories that you can read and that everyone who can see the organization can read, because a persona put in a revision is read by all of them. Name up to five, or leave them out and the five most recently updated that qualify are used. It never reads who wrote what: no authors, reviews or comments.

A draft is written by the economical tier's default model. To use another, name it in model_id — any model from the model list that is served in your organization's region. The draft says which model wrote it.

The web app has no screen for this yet; use the CLI or the API.

Terminalbash
gitmoap ai-org create-ai-profile-draft --group-id <id> --brief <brief>
curlbash
curl -X POST https://api.gitmoap.example/groups/{group_id}/ai-org/profile-drafts \
-H "Authorization: Bearer $GITMOAP_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "brief": "<string>" }'

The draft is written in a minute or two. Wait for it on its watch stream, which sends one draft event when it is finished and nothing before, or read it again until it is ready or failed:

The web app has no screen for this yet; use the CLI or the API.

Terminalbash
gitmoap ai-org stream-ai-profile-draft --draft-id <id>
curlbash
curl -X GET https://api.gitmoap.example/ai-profile-drafts/{draft_id}/watch \
-H "Authorization: Bearer $GITMOAP_TOKEN"

The web app has no screen for this yet; use the CLI or the API.

Terminalbash
gitmoap ai-org get-ai-profile-draft --draft-id <id>
curlbash
curl -X GET https://api.gitmoap.example/ai-profile-drafts/{draft_id} \
-H "Authorization: Bearer $GITMOAP_TOKEN"

Only you can read a draft you asked for. It is paid from the organization's balance like any model call, and usually costs about a cent. A draft takes at most 16 turns: on the last one the model must hand over what it has written, so a draft that reads a lot still ends with a persona.

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org put-ai-org-revision-draft --group-id <id> --body '<json>'
curlbash
curl -X PUT https://api.gitmoap.example/groups/{group_id}/ai-org/revisions/draft \
-H "Authorization: Bearer $GITMOAP_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "body.agents[].display_name": "<string>", "body.agents[].handle": "<string>", "body.agents[].key": "<string>", "body.agents[].position": "<one of director | engineer | product_owner | release_manager | reviewer | technical_writer>", "body.agents[].squad": "<string>", "body.autonomy.level": "<one of autonomous | gated | supervised>", "body.budgets.org_monthly_cap_micros": "<int64>", "body.models[].position": "<one of director | engineer | product_owner | release_manager | reviewer | technical_writer>", "body.models[].tier": "<one of economical | most_capable | standard>", "body.squads[].key": "<string>", "body.squads[].lead": "<string>", "body.squads[].name": "<string>", "body.structure.level": "<one of L1 | L2 | L3>", "body.tracker.kind": "<one of gitmoap | jira | trello>" }'

Publish it. Add ?dry_run=true to see what publishing would do — the agents it would hire and retire — without doing it:

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org publish-ai-org-revision --group-id <id>
curlbash
curl -X POST https://api.gitmoap.example/groups/{group_id}/ai-org/revisions/draft/publish \
-H "Authorization: Bearer $GITMOAP_TOKEN"

Give an agent an issue

Assign the issue to the agent as you would to a person. The agent wakes, works on it in its workspace, pushes its branch and opens a merge request that closes the issue. Review the merge request as you would anybody's: comment on it or request changes and the agent wakes again to answer; when its pipeline fails, the agent wakes to fix it. You merge it.

To ask an agent something about an issue or a merge request that is not its work, mention it in a comment — @ada-ai, why does this test time out? — and it answers in a session of its own.

Start a session

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org start-ai-session --agent-id <id> --instruction <instruction>
curlbash
curl -X POST https://api.gitmoap.example/ai-agents/{agent_id}/sessions \
-H "Authorization: Bearer $GITMOAP_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "instruction": "<string>" }'

The instruction is up to 4,000 characters. Say what done looks like.

Watch a session

A session shows its state, outcome, cost so far and the branch it worked on; its turns show each tool call and a summary of the model's reasoning. You see a session's turns only if you can read every repository it read from.

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org get-ai-session --session-id <id>
curlbash
curl -X GET https://api.gitmoap.example/ai-sessions/{session_id} \
-H "Authorization: Bearer $GITMOAP_TOKEN"

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org list-ai-session-turns --session-id <id>
curlbash
curl -X GET https://api.gitmoap.example/ai-sessions/{session_id}/turns \
-H "Authorization: Bearer $GITMOAP_TOKEN"

The transcript holds what the agent wrote, what each tool call returned and, while a command runs in its workspace, the command's latest output. Page through it by turn; ask again from the last turn to follow a running session. Every read of a transcript is in the audit log.

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org get-ai-session-transcript --session-id <id>
curlbash
curl -X GET https://api.gitmoap.example/ai-sessions/{session_id}/transcript \
-H "Authorization: Bearer $GITMOAP_TOKEN"

Redirect a session

Send a running session a new instruction. The agent reads it at its next step; a session that was about to finish takes another step to act on it.

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org redirect-ai-session \
--session-id <id> \
--instruction <instruction>
curlbash
curl -X POST https://api.gitmoap.example/ai-sessions/{session_id}/instructions \
-H "Authorization: Bearer $GITMOAP_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "instruction": "<string>" }'

Take over a session

Take the work over yourself. The session ends at its next step, the agent no longer holds the work, and its issue is assigned to you instead. The agent's branch keeps what it pushed; anything it had not pushed is lost.

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org take-over-ai-session --session-id <id>
curlbash
curl -X POST https://api.gitmoap.example/ai-sessions/{session_id}/take-over \
-H "Authorization: Bearer $GITMOAP_TOKEN"

Stop work

Cancel one session; it ends at its next step:

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org cancel-ai-session --session-id <id>
curlbash
curl -X POST https://api.gitmoap.example/ai-sessions/{session_id}/cancel \
-H "Authorization: Bearer $GITMOAP_TOKEN"

Suspend one agent, or pause the whole organization. Both take effect at the agent's next request:

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org suspend-ai-agent --agent-id <id>
curlbash
curl -X POST https://api.gitmoap.example/ai-agents/{agent_id}/suspend \
-H "Authorization: Bearer $GITMOAP_TOKEN"

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org pause-ai-org --group-id <id>
curlbash
curl -X POST https://api.gitmoap.example/groups/{group_id}/ai-org/pause \
-H "Authorization: Bearer $GITMOAP_TOKEN"

Lifting a suspension and resuming are board decisions:

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org resume-ai-agent --agent-id <id>
curlbash
curl -X POST https://api.gitmoap.example/ai-agents/{agent_id}/resume \
-H "Authorization: Bearer $GITMOAP_TOKEN"

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org resume-ai-org --group-id <id>
curlbash
curl -X POST https://api.gitmoap.example/groups/{group_id}/ai-org/resume \
-H "Authorization: Bearer $GITMOAP_TOKEN"

Warning

Withdrawing consent stops every model call at once and pauses the organization: running sessions halt at their next step and no session starts. Resuming needs consent recorded again first.

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap ai-org withdraw-ai-org-consent --group-id <id>
curlbash
curl -X DELETE https://api.gitmoap.example/groups/{group_id}/ai-org/consent \
-H "Authorization: Bearer $GITMOAP_TOKEN"

Keep agent code untrusted in pipelines

Trusting agent-written code is the default. It lets an agent's merge request show a green pipeline before you review it, and it also means the code an agent writes — a build script, a test, a package's scripts — runs with your secrets, cloud roles and build cache. To withhold them until a person approves each commit, add this to the draft revision and publish it:

json
"pipelines": { "agent_code": "untrusted" }

The setting applies to the next run that starts, whoever published it; runs already started keep the trust they started with. Remove the section, or set "trusted", to trust agent code again. Only somebody who can publish a revision can change it, and an agent never can.

Approve an agent's pipeline run

With agent code kept untrusted, a run is marked untrusted when an agent started it, or when it builds a commit an agent wrote that no person has merged. It runs without your connections, secrets and cache, so a step that needs them fails. Review the commit, then approve it by its sha: a new run of that commit starts, triggered by you, with everything a run of yours would have.

The web app has no screen for this; use the CLI or the API.

Terminalbash
gitmoap pipeline-runs approve \
--repo-id <id> \
--pipeline-run-id <id> \
--commit-sha <commit sha>
curlbash
curl -X POST https://api.gitmoap.example/repositories/{repo_id}/pipeline-runs/{pipeline_run_id}/approve \
-H "Authorization: Bearer $GITMOAP_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "commit_sha": "<string>" }'

A merge commit a person makes approves what it brings in, so the run on the target branch after it is trusted. A fast-forward or rebase merge leaves commits authored by the agent at the tip, so the run that builds them is untrusted until it is approved.

Reference

26 endpoints

POST/groups/{group_id}/ai-orgai_org:manage

Create the AI organization of a top-level group, in draft.

create_ai_orgPOST /groups/{group_id}/ai-orgOpen in the API reference

Token scope

ai_org:manage

Counts against

ai_org_per_root_group

Send

Path
  • group_iduuidThe organization's top-level group
Body
  • namestring
  • originadoptgreenfieldoptionalHow an organization came to be: the setup wizard, or joining what already exists.
  • regioneuusWhere an organization's model calls are served, and so where its content is processed. Fixed when the organization is created.

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 402An AI organization needs a paid plan
  • 403The caller cannot manage an AI organization here, or AI organizations are not available for this organization
  • 404Not found — or found and private, which is masked as absent
  • 409The group already has an AI organization
  • 422AI organizations are served in the EU; the region is not available

Receive

  • consented_atdate-timeoptional
  • consented_byobjectoptional
  • created_atdate-time
  • created_byobject4 fields
    • avatar_urlobjectoptional
    • emailstring
    • idstring
    • usernamestring
  • group_iduuid
  • live_revisionint64optionalThe number of the revision in force, absent until the first publish.
  • namestring
  • org_iduuid
  • originadoptgreenfieldHow an organization came to be: the setup wizard, or joining what already exists.
  • pause_epochint64Incremented by every pause.
  • regioneuusWhere an organization's model calls are served, and so where its content is processed. Fixed when the organization is created.
  • spend_today_microsint64Usage and fees charged so far today (UTC), in micro-dollars.
  • statedraftlivepausedprovisioningretiredAn organization's lifecycle: draft → provisioning → live ⇄ paused → retired.
  • updated_atdate-time
GET/groups/{group_id}/ai-orgai_org:read

An AI organization: its state, live revision, pause epoch, consent and today's spend.

get_ai_orgGET /groups/{group_id}/ai-orgOpen in the API reference

Token scope

ai_org:read

Send

Path
  • group_iduuidThe organization's top-level group

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent

Receive

The same shape create_ai_org returns — 14 fields. Go to it

Show it here
  • consented_atdate-timeoptional
  • consented_byobjectoptional
  • created_atdate-time
  • created_byobject4 fields
    • avatar_urlobjectoptional
    • emailstring
    • idstring
    • usernamestring
  • group_iduuid
  • live_revisionint64optionalThe number of the revision in force, absent until the first publish.
  • namestring
  • org_iduuid
  • originadoptgreenfieldHow an organization came to be: the setup wizard, or joining what already exists.
  • pause_epochint64Incremented by every pause.
  • regioneuusWhere an organization's model calls are served, and so where its content is processed. Fixed when the organization is created.
  • spend_today_microsint64Usage and fees charged so far today (UTC), in micro-dollars.
  • statedraftlivepausedprovisioningretiredAn organization's lifecycle: draft → provisioning → live ⇄ paused → retired.
  • updated_atdate-time
POST/groups/{group_id}/ai-org/pauseai_org:manage

Pause the organization: every agent stops at once.

pause_ai_orgPOST /groups/{group_id}/ai-org/pauseOpen in the API reference

Token scope

ai_org:manage

Send

Path
  • group_iduuidThe organization's top-level group

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409The request conflicts with the resource's current state; `reason` says how

Receive

The same shape create_ai_org returns — 14 fields. Go to it

Show it here
  • consented_atdate-timeoptional
  • consented_byobjectoptional
  • created_atdate-time
  • created_byobject4 fields
    • avatar_urlobjectoptional
    • emailstring
    • idstring
    • usernamestring
  • group_iduuid
  • live_revisionint64optionalThe number of the revision in force, absent until the first publish.
  • namestring
  • org_iduuid
  • originadoptgreenfieldHow an organization came to be: the setup wizard, or joining what already exists.
  • pause_epochint64Incremented by every pause.
  • regioneuusWhere an organization's model calls are served, and so where its content is processed. Fixed when the organization is created.
  • spend_today_microsint64Usage and fees charged so far today (UTC), in micro-dollars.
  • statedraftlivepausedprovisioningretiredAn organization's lifecycle: draft → provisioning → live ⇄ paused → retired.
  • updated_atdate-time
POST/groups/{group_id}/ai-org/resumeai_org:approve

Resume the organization: halted sessions continue.

resume_ai_orgPOST /groups/{group_id}/ai-org/resumeOpen in the API reference

Token scope

ai_org:approve

Send

Path
  • group_iduuidThe organization's top-level group

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409Nobody has consented to inference

Receive

The same shape create_ai_org returns — 14 fields. Go to it

Show it here
  • consented_atdate-timeoptional
  • consented_byobjectoptional
  • created_atdate-time
  • created_byobject4 fields
    • avatar_urlobjectoptional
    • emailstring
    • idstring
    • usernamestring
  • group_iduuid
  • live_revisionint64optionalThe number of the revision in force, absent until the first publish.
  • namestring
  • org_iduuid
  • originadoptgreenfieldHow an organization came to be: the setup wizard, or joining what already exists.
  • pause_epochint64Incremented by every pause.
  • regioneuusWhere an organization's model calls are served, and so where its content is processed. Fixed when the organization is created.
  • spend_today_microsint64Usage and fees charged so far today (UTC), in micro-dollars.
  • statedraftlivepausedprovisioningretiredAn organization's lifecycle: draft → provisioning → live ⇄ paused → retired.
  • updated_atdate-time
PUT/groups/{group_id}/ai-org/revisions/draftai_org:manage

Write the organization's one draft revision, replacing it whole.

put_ai_org_revision_draftPUT /groups/{group_id}/ai-org/revisions/draftOpen in the API reference

Token scope

ai_org:manage

Counts against

ai_revision_drafts_per_org_per_day

Send

Path
  • group_iduuidThe organization's top-level group
Body
  • bodyobject20 fields
    • agents[]object7 fields
      • display_namestring
      • handlestring
      • keystring
      • positiondirectorengineerproduct_ownerrelease_managerreviewertechnical_writerAn agent's job, which decides what it may do and which model tier it uses by default.
      • specialisationobjectoptional
      • squadstring
      • wip_limitint32optional
    • autonomyobject1 field
      • levelautonomousgatedsupervisedHow much an organization may do without asking: a named preset for every gate, each of which can still be set on its own.
    • budgetsobject3 fields
      • agent_daily_cap_microsint64optional
      • org_monthly_cap_microsint64All model usage and fees of the organization per calendar month in UTC. Required.
      • session_cap_microsint64optional
    • models[]object3 fields
      • modelobjectoptional
      • positiondirectorengineerproduct_ownerrelease_managerreviewertechnical_writerAn agent's job, which decides what it may do and which model tier it uses by default.
      • tiereconomicalmost_capablestandardA model tier: the most capable, the standard, or the economical model in the organization's region.
    • pipelinesobject1 field
      • agent_codetrusteduntrustedoptionalWhether a pipeline run of code an agent wrote gets the repository's connections, secrets, cloud roles and build cache. trusted, the default, runs it like a person's code; untrusted runs it without them until a person approves its commit.
    • squads[]object3 fields
      • keystring
      • leadstring
      • namestring
    • structureobject1 field
      • levelL1L2L3The organization's shape: L1 is engineers in one squad, L2 adds squads each led by a product owner, L3 adds a director across the squads.
    • trackerobject1 field
      • kindgitmoapjiratrello

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409The request conflicts with the resource's current state; `reason` says how
  • 413The body is larger than a revision may be
  • 422The body is not a sound configuration
  • 429Revision draft limit reached for today

Receive

  • author_kindagentpersonplatform
  • bodyobject20 fields
    • agents[]object7 fields
      • display_namestring
      • handlestring
      • keystring
      • positiondirectorengineerproduct_ownerrelease_managerreviewertechnical_writerAn agent's job, which decides what it may do and which model tier it uses by default.
      • specialisationobjectoptional
      • squadstring
      • wip_limitint32optional
    • autonomyobject1 field
      • levelautonomousgatedsupervisedHow much an organization may do without asking: a named preset for every gate, each of which can still be set on its own.
    • budgetsobject3 fields
      • agent_daily_cap_microsint64optional
      • org_monthly_cap_microsint64All model usage and fees of the organization per calendar month in UTC. Required.
      • session_cap_microsint64optional
    • models[]object3 fields
      • modelobjectoptional
      • positiondirectorengineerproduct_ownerrelease_managerreviewertechnical_writerAn agent's job, which decides what it may do and which model tier it uses by default.
      • tiereconomicalmost_capablestandardA model tier: the most capable, the standard, or the economical model in the organization's region.
    • pipelinesobject1 field
      • agent_codetrusteduntrustedoptionalWhether a pipeline run of code an agent wrote gets the repository's connections, secrets, cloud roles and build cache. trusted, the default, runs it like a person's code; untrusted runs it without them until a person approves its commit.
    • squads[]object3 fields
      • keystring
      • leadstring
      • namestring
    • structureobject1 field
      • levelL1L2L3The organization's shape: L1 is engineers in one squad, L2 adds squads each led by a product owner, L3 adds a director across the squads.
    • trackerobject1 field
      • kindgitmoapjiratrello
  • body_digeststringHex SHA-256 of the canonical body; two revisions with one digest are one configuration.
  • created_atdate-time
  • created_byobject1 field
    • avatar_urlobjectoptional
POST/groups/{group_id}/ai-org/revisions/draft/publishai_org:approve

Publish the draft, hiring and retiring the agents it adds and removes.

publish_ai_org_revisionPOST /groups/{group_id}/ai-org/revisions/draft/publishOpen in the API reference

Token scope

ai_org:approve

Counts against

ai_agents_per_org

Send

Path
  • group_iduuidThe organization's top-level group
Query
  • dry_runbooleanoptionalSay what publishing would change, and change nothing

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409No draft, a draft edited from a revision no longer live, or an agent with work in progress to retire
  • 422The draft is not a sound configuration for this organization
  • 429AI agent limit reached for this organization

Receive

  • dry_runboolean
  • revisionobjectoptional
GET/groups/{group_id}/ai-org/revisionsai_org:read

The organization's revisions, newest first.

list_ai_org_revisionsGET /groups/{group_id}/ai-org/revisionsOpen in the API reference

Token scope

ai_org:read

Send

Path
  • group_iduuidThe organization's top-level group
Query
  • limitint64optionalMaximum number of revisions, 1-100 (default 100)
  • next_tokenstringoptionalPagination token

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent

Receive

  • items[]object15 fields
    • author_kindagentpersonplatform
    • body_digeststringHex SHA-256 of the canonical body; two revisions with one digest are one configuration.
    • created_atdate-time
    • created_byobject4 fields
      • avatar_urlobjectoptional
      • emailstring
      • idstring
      • usernamestring
    • numberint64
    • org_iduuid
    • parent_numberint64optionalThe revision this one was edited from.
    • published_atdate-timeoptional
    • published_byobjectoptional
    • revision_iduuid
    • statedeclineddraftproposedpublishedsuperseded
    • updated_atdate-time
  • next_tokenobjectoptional
GET/groups/{group_id}/ai-org/revisions/{number}ai_org:read

One revision of the organization, by number.

get_ai_org_revisionGET /groups/{group_id}/ai-org/revisions/{number}Open in the API reference

Token scope

ai_org:read

Send

Path
  • group_iduuidThe organization's top-level group
  • numberint64The revision's number

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent

Receive

The same shape put_ai_org_revision_draft returns — 5 fields. Go to it

Show it here
  • author_kindagentpersonplatform
  • bodyobject20 fields
    • agents[]object7 fields
      • display_namestring
      • handlestring
      • keystring
      • positiondirectorengineerproduct_ownerrelease_managerreviewertechnical_writerAn agent's job, which decides what it may do and which model tier it uses by default.
      • specialisationobjectoptional
      • squadstring
      • wip_limitint32optional
    • autonomyobject1 field
      • levelautonomousgatedsupervisedHow much an organization may do without asking: a named preset for every gate, each of which can still be set on its own.
    • budgetsobject3 fields
      • agent_daily_cap_microsint64optional
      • org_monthly_cap_microsint64All model usage and fees of the organization per calendar month in UTC. Required.
      • session_cap_microsint64optional
    • models[]object3 fields
      • modelobjectoptional
      • positiondirectorengineerproduct_ownerrelease_managerreviewertechnical_writerAn agent's job, which decides what it may do and which model tier it uses by default.
      • tiereconomicalmost_capablestandardA model tier: the most capable, the standard, or the economical model in the organization's region.
    • pipelinesobject1 field
      • agent_codetrusteduntrustedoptionalWhether a pipeline run of code an agent wrote gets the repository's connections, secrets, cloud roles and build cache. trusted, the default, runs it like a person's code; untrusted runs it without them until a person approves its commit.
    • squads[]object3 fields
      • keystring
      • leadstring
      • namestring
    • structureobject1 field
      • levelL1L2L3The organization's shape: L1 is engineers in one squad, L2 adds squads each led by a product owner, L3 adds a director across the squads.
    • trackerobject1 field
      • kindgitmoapjiratrello
  • body_digeststringHex SHA-256 of the canonical body; two revisions with one digest are one configuration.
  • created_atdate-time
  • created_byobject1 field
    • avatar_urlobjectoptional
GET/groups/{group_id}/ai-org/agentsai_org:read

The organization's agents, with their positions and squads.

list_ai_agentsGET /groups/{group_id}/ai-org/agentsOpen in the API reference

Token scope

ai_org:read

Send

Path
  • group_iduuidThe organization's top-level group

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent

Receive

  • items[]object21 fields
    • agent_iduuid
    • agent_keystring
    • created_atdate-time
    • created_byobject4 fields
      • avatar_urlobjectoptional
      • emailstring
      • idstring
      • usernamestring
    • current_session_idobjectoptional
    • display_namestring
    • emailstringThe no-reply address its commits are authored as.
    • handlestring
    • hired_revisionint64
    • org_iduuid
    • positionobjectoptional
    • retired_atdate-timeoptional
    • retired_revisionint64optional
    • root_group_iduuid
    • squadobjectoptional
    • stateactivedrainingretired
    • suspended_atdate-timeoptional
    • suspended_byobjectoptional
GET/ai-agents/{agent_id}ai_org:read

One agent.

get_ai_agentGET /ai-agents/{agent_id}Open in the API reference

Token scope

ai_org:read

Send

Path
  • agent_iduuidThe agent

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent

Receive

  • agent_iduuid
  • agent_keystring
  • created_atdate-time
  • created_byobject4 fields
    • avatar_urlobjectoptional
    • emailstring
    • idstring
    • usernamestring
  • current_session_idobjectoptional
  • display_namestring
  • emailstringThe no-reply address its commits are authored as.
  • handlestring
  • hired_revisionint64
  • org_iduuid
  • positionobjectoptional
  • retired_atdate-timeoptional
  • retired_revisionint64optional
  • root_group_iduuid
  • squadobjectoptional
  • stateactivedrainingretired
  • suspended_atdate-timeoptional
  • suspended_byobjectoptional
POST/ai-agents/{agent_id}/suspendai_org:manage

Suspend an agent: every token it holds is refused from now on.

suspend_ai_agentPOST /ai-agents/{agent_id}/suspendOpen in the API reference

Token scope

ai_org:manage

Send

Path
  • agent_iduuidThe agent

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409The request conflicts with the resource's current state; `reason` says how

Receive

The same shape get_ai_agent returns — 18 fields. Go to it

Show it here
  • agent_iduuid
  • agent_keystring
  • created_atdate-time
  • created_byobject4 fields
    • avatar_urlobjectoptional
    • emailstring
    • idstring
    • usernamestring
  • current_session_idobjectoptional
  • display_namestring
  • emailstringThe no-reply address its commits are authored as.
  • handlestring
  • hired_revisionint64
  • org_iduuid
  • positionobjectoptional
  • retired_atdate-timeoptional
  • retired_revisionint64optional
  • root_group_iduuid
  • squadobjectoptional
  • stateactivedrainingretired
  • suspended_atdate-timeoptional
  • suspended_byobjectoptional
POST/ai-agents/{agent_id}/resumeai_org:approve

Lift an agent's suspension.

resume_ai_agentPOST /ai-agents/{agent_id}/resumeOpen in the API reference

Token scope

ai_org:approve

Send

Path
  • agent_iduuidThe agent

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409The request conflicts with the resource's current state; `reason` says how

Receive

The same shape get_ai_agent returns — 18 fields. Go to it

Show it here
  • agent_iduuid
  • agent_keystring
  • created_atdate-time
  • created_byobject4 fields
    • avatar_urlobjectoptional
    • emailstring
    • idstring
    • usernamestring
  • current_session_idobjectoptional
  • display_namestring
  • emailstringThe no-reply address its commits are authored as.
  • handlestring
  • hired_revisionint64
  • org_iduuid
  • positionobjectoptional
  • retired_atdate-timeoptional
  • retired_revisionint64optional
  • root_group_iduuid
  • squadobjectoptional
  • stateactivedrainingretired
  • suspended_atdate-timeoptional
  • suspended_byobjectoptional
POST/ai-agents/{agent_id}/sessionsai_org:manage

Start an agent on a subject. The session is queued until the organization can run it.

start_ai_sessionPOST /ai-agents/{agent_id}/sessionsOpen in the API reference

Token scope

ai_org:manage

Counts against

ai_sessions_per_org_per_day

Send

Path
  • agent_iduuidThe agent
Body
  • instructionstring
  • subjectobjectoptionalThe address the work is about — acme/api#412 — when there is one.

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409No revision is published, or the agent takes no new work
  • 429Session limit reached for today

Receive

  • agent_idobjectoptional
  • branchobjectoptional
  • cost_microsint64Settled spend, fee included, in micro-dollars.
  • created_atdate-time
  • ended_atdate-timeoptional
  • instructionobjectoptional
  • model_idobjectoptional
  • org_iduuid
  • outcomeobjectoptional
  • repository_idobjectoptional
  • revision_numberint64optionalThe revision it pinned at start; absent only for a platform session started before any revision was published.
  • root_group_iduuid
  • session_iduuid
  • started_atdate-timeoptional
  • statecancelledcompletedfailedhaltedqueuedrunningwaiting_gatewaiting_person
  • subjectobject2 fields
    • addressobjectoptionalThe address acted on — acme/api#412, acme/api!87 — when the session has one.
    • started_byobjectoptionalThe person or account whose action started the session, when one did.
  • summaryobjectoptionalThe agent's own account of the session.
  • trigger_kindassignmentchannel_messagecontinuationgate_decisionhandoffmanualmentionpipeline_failureprofile_draftproposalreview_feedbackreview_requestritualtracker_eventWhat started a session.
  • turnsint32
GET/groups/{group_id}/ai-org/sessionsai_org:read

The organization's sessions, newest first.

list_ai_sessionsGET /groups/{group_id}/ai-org/sessionsOpen in the API reference

Token scope

ai_org:read

Send

Path
  • group_iduuidThe organization's top-level group
Query
  • agent_iduuidoptionalOnly this agent's sessions
  • statecancelledcompletedfailedhaltedqueuedrunningwaiting_gatewaiting_personoptionalOnly sessions in this state
  • limitint64optionalMaximum number of sessions, 1-100 (default 50)
  • next_tokenstringoptionalPagination token

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent

Receive

  • items[]object20 fields
    • agent_idobjectoptional
    • branchobjectoptional
    • cost_microsint64Settled spend, fee included, in micro-dollars.
    • created_atdate-time
    • ended_atdate-timeoptional
    • instructionobjectoptional
    • model_idobjectoptional
    • org_iduuid
    • outcomeobjectoptional
    • repository_idobjectoptional
    • revision_numberint64optionalThe revision it pinned at start; absent only for a platform session started before any revision was published.
    • root_group_iduuid
    • session_iduuid
    • started_atdate-timeoptional
    • statecancelledcompletedfailedhaltedqueuedrunningwaiting_gatewaiting_person
    • subjectobject2 fields
      • addressobjectoptionalThe address acted on — acme/api#412, acme/api!87 — when the session has one.
      • started_byobjectoptionalThe person or account whose action started the session, when one did.
    • summaryobjectoptionalThe agent's own account of the session.
    • trigger_kindassignmentchannel_messagecontinuationgate_decisionhandoffmanualmentionpipeline_failureprofile_draftproposalreview_feedbackreview_requestritualtracker_eventWhat started a session.
    • turnsint32
  • next_tokenobjectoptional
GET/ai-sessions/{session_id}ai_org:read

One session: its summary, outcome, cost and branch.

get_ai_sessionGET /ai-sessions/{session_id}Open in the API reference

Token scope

ai_org:read

Send

Path
  • session_iduuidThe session

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent

Receive

The same shape start_ai_session returns — 19 fields. Go to it

Show it here
  • agent_idobjectoptional
  • branchobjectoptional
  • cost_microsint64Settled spend, fee included, in micro-dollars.
  • created_atdate-time
  • ended_atdate-timeoptional
  • instructionobjectoptional
  • model_idobjectoptional
  • org_iduuid
  • outcomeobjectoptional
  • repository_idobjectoptional
  • revision_numberint64optionalThe revision it pinned at start; absent only for a platform session started before any revision was published.
  • root_group_iduuid
  • session_iduuid
  • started_atdate-timeoptional
  • statecancelledcompletedfailedhaltedqueuedrunningwaiting_gatewaiting_person
  • subjectobject2 fields
    • addressobjectoptionalThe address acted on — acme/api#412, acme/api!87 — when the session has one.
    • started_byobjectoptionalThe person or account whose action started the session, when one did.
  • summaryobjectoptionalThe agent's own account of the session.
  • trigger_kindassignmentchannel_messagecontinuationgate_decisionhandoffmanualmentionpipeline_failureprofile_draftproposalreview_feedbackreview_requestritualtracker_eventWhat started a session.
  • turnsint32
GET/ai-sessions/{session_id}/turnsai_org:read

A session's turns, with their tool calls and summarized reasoning.

list_ai_session_turnsGET /ai-sessions/{session_id}/turnsOpen in the API reference

Token scope

ai_org:read

Send

Path
  • session_iduuidThe session
Query
  • limitint64optionalMaximum number of turns, 1-100 (default 50)
  • next_tokenstringoptionalPagination token

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent

Receive

  • items[]object16 fields
    • attemptint32
    • cache_read_tokensint32optional
    • cache_write_tokensint32optional
    • cost_microsint64The settled charge, fee included, in micro-dollars.
    • ended_atdate-timeoptional
    • input_tokensint32optional
    • latency_msint32optional
    • model_idobjectoptional
    • output_tokensint32optional
    • providerobjectoptional
    • reasoning_summaryobjectoptionalThe provider's summarized reasoning. Absent for a turn that was pure tool calls — the model's raw reasoning is never shown, because no provider returns it.
    • regionobjectoptional
    • started_atdate-time
    • statecompletedexecutingreservedrespondedsentHow far a turn has got: its cost reserved, its request sent to the model, the model's response recorded, its tool calls running, or complete.
    • stop_reasonobjectoptional
    • turn_noint32
  • next_tokenobjectoptional
GET/ai-sessions/{session_id}/transcriptai_org:read

A page of a session's transcript: what the agent wrote, what each tool call returned, the live output of a workspace command still running, and every input the session received.

get_ai_session_transcriptGET /ai-sessions/{session_id}/transcriptOpen in the API reference

Token scope

ai_org:read

Send

Path
  • session_iduuidThe session
Query
  • from_turnint32optionalThe first turn of the page (default 1)
  • limitint32optionalMaximum number of turns, 1-8 (default 4)

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent

Receive

  • inputs[]object6 fields
    • aboutobjectoptionalThe address it is about.
    • created_atdate-timeWhen it arrived.
    • fromobjectoptionalWho sent it, as @username, when a person did.
    • kindassignmentcommentinstructionmentionpipeline_failurereviewWhat reached a session after it started.
    • seqint641, 2, … within the session.
    • textstringWhat it says.
  • next_turnint32optionalThe first turn of the next page; absent at the newest.
  • turns[]object2 fields
    • inputs_throughint64optionalThe highest input the turn's request carried: inputs above the previous turn's and up to this one reached the agent before this turn.
    • turn_noint32The turn's number, from 1.
POST/ai-sessions/{session_id}/cancelai_org:manage

Cancel a session: it ends at its next step.

cancel_ai_sessionPOST /ai-sessions/{session_id}/cancelOpen in the API reference

Token scope

ai_org:manage

Send

Path
  • session_iduuidThe session

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409The request conflicts with the resource's current state; `reason` says how

Receive

The same shape start_ai_session returns — 19 fields. Go to it

Show it here
  • agent_idobjectoptional
  • branchobjectoptional
  • cost_microsint64Settled spend, fee included, in micro-dollars.
  • created_atdate-time
  • ended_atdate-timeoptional
  • instructionobjectoptional
  • model_idobjectoptional
  • org_iduuid
  • outcomeobjectoptional
  • repository_idobjectoptional
  • revision_numberint64optionalThe revision it pinned at start; absent only for a platform session started before any revision was published.
  • root_group_iduuid
  • session_iduuid
  • started_atdate-timeoptional
  • statecancelledcompletedfailedhaltedqueuedrunningwaiting_gatewaiting_person
  • subjectobject2 fields
    • addressobjectoptionalThe address acted on — acme/api#412, acme/api!87 — when the session has one.
    • started_byobjectoptionalThe person or account whose action started the session, when one did.
  • summaryobjectoptionalThe agent's own account of the session.
  • trigger_kindassignmentchannel_messagecontinuationgate_decisionhandoffmanualmentionpipeline_failureprofile_draftproposalreview_feedbackreview_requestritualtracker_eventWhat started a session.
  • turnsint32
POST/ai-sessions/{session_id}/instructionsai_org:manage

Give a running session a new instruction.

redirect_ai_sessionPOST /ai-sessions/{session_id}/instructionsOpen in the API reference

Token scope

ai_org:manage

Counts against

ai_session_inputs_per_session

Send

Path
  • session_iduuidThe session
Body
  • instructionstring

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409The session has ended
  • 429The session holds as many inputs as it takes

Receive

The same shape start_ai_session returns — 19 fields. Go to it

Show it here
  • agent_idobjectoptional
  • branchobjectoptional
  • cost_microsint64Settled spend, fee included, in micro-dollars.
  • created_atdate-time
  • ended_atdate-timeoptional
  • instructionobjectoptional
  • model_idobjectoptional
  • org_iduuid
  • outcomeobjectoptional
  • repository_idobjectoptional
  • revision_numberint64optionalThe revision it pinned at start; absent only for a platform session started before any revision was published.
  • root_group_iduuid
  • session_iduuid
  • started_atdate-timeoptional
  • statecancelledcompletedfailedhaltedqueuedrunningwaiting_gatewaiting_person
  • subjectobject2 fields
    • addressobjectoptionalThe address acted on — acme/api#412, acme/api!87 — when the session has one.
    • started_byobjectoptionalThe person or account whose action started the session, when one did.
  • summaryobjectoptionalThe agent's own account of the session.
  • trigger_kindassignmentchannel_messagecontinuationgate_decisionhandoffmanualmentionpipeline_failureprofile_draftproposalreview_feedbackreview_requestritualtracker_eventWhat started a session.
  • turnsint32
POST/ai-sessions/{session_id}/take-overai_org:manage

Take a session's work over yourself.

take_over_ai_sessionPOST /ai-sessions/{session_id}/take-overOpen in the API reference

Token scope

ai_org:manage

Send

Path
  • session_iduuidThe session

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409The session has ended

Receive

  • branchobjectoptionalThe agent's branch: what it pushed is there; what it had not pushed is lost.
  • repositoryobjectoptionalThe repository the work is in, as an address.
  • sessionobject20 fields
    • agent_idobjectoptional
    • branchobjectoptional
    • cost_microsint64Settled spend, fee included, in micro-dollars.
    • created_atdate-time
    • ended_atdate-timeoptional
    • instructionobjectoptional
    • model_idobjectoptional
    • org_iduuid
    • outcomeobjectoptional
    • repository_idobjectoptional
    • revision_numberint64optionalThe revision it pinned at start; absent only for a platform session started before any revision was published.
    • root_group_iduuid
    • session_iduuid
    • started_atdate-timeoptional
    • statecancelledcompletedfailedhaltedqueuedrunningwaiting_gatewaiting_person
    • subjectobject2 fields
      • addressobjectoptionalThe address acted on — acme/api#412, acme/api!87 — when the session has one.
      • started_byobjectoptionalThe person or account whose action started the session, when one did.
    • summaryobjectoptionalThe agent's own account of the session.
    • trigger_kindassignmentchannel_messagecontinuationgate_decisionhandoffmanualmentionpipeline_failureprofile_draftproposalreview_feedbackreview_requestritualtracker_eventWhat started a session.
    • turnsint32
GET/ai-modelspublic

Every model an organization can use, with its current and announced list prices.

list_ai_modelsGET /ai-modelsOpen in the API reference

Token scope

None — this one is public

Send

Nothing — the address is the whole request.

Receive

  • items[]object15 fields
    • context_windowint32
    • current_priceobjectoptional
    • familystring
    • max_outputint32
    • model_idstring
    • providerstring
    • provider_model_idstring
    • regioneuusWhere an organization's model calls are served, and so where its content is processed. Fixed when the organization is created.
    • retire_atdate-timeoptional
    • statusactivedeprecatedretired
    • supports_cachingboolean
    • supports_mid_conversation_systemboolean
    • supports_summarized_thinkingboolean
    • tiereconomicalmost_capablestandardA model tier: the most capable, the standard, or the economical model in the organization's region.
    • tier_defaultbooleanWhether this is the model its tier routes to in its region. Every other model is used only when a revision or a persona draft names it.
POST/groups/{group_id}/ai-org/profile-draftsai_org:manage

Draft an agent's persona from a brief. The draft is written in a minute or two.

create_ai_profile_draftPOST /groups/{group_id}/ai-org/profile-draftsOpen in the API reference

Token scope

ai_org:manage

Counts against

ai_profile_drafts_per_person_per_day

Send

Path
  • group_iduuidThe organization's top-level group
Body
  • briefstringWhat the agent is for, in the person's words: 3 to 500 characters
  • model_idobjectoptional
  • positionobjectoptional

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 402The organization's balance cannot cover a draft
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404Not found — or found and private, which is masked as absent
  • 409Consent is not recorded, or the organization is paused or retired
  • 422A repository cannot ground a persona; the message names it and why
  • 429A limit on drafts is reached; `Retry-After` says when it frees up

Receive

  • briefstringWhat the agent is for, in the person's words: 3 to 500 characters
  • completed_atdate-timeoptionalWhen it was finished.
  • cost_microsint64What it cost, fee included, in micro-dollars.
  • created_atdate-timeWhen it was asked for.
  • draft_iduuidA persona draft: a persona a small model wrote from a person's brief
  • failureobjectoptional
  • model_idobjectoptional
  • org_iduuid
  • personaobjectoptional
  • positionobjectoptional
  • repositories[]object2 fields
    • full_pathstringIts path as addresses name it, as it is now.
    • repository_iduuid
  • sources[]object2 fields
    • pathstring
    • repository_iduuid
  • statefailedqueuedreadyrunningWhere a draft stands: queued → running → ready or failed.
  • summaryobjectoptional
  • written_forobjectoptional
GET/ai-profile-drafts/{draft_id}ai_org:manage

A persona draft, and once it is written, the persona.

get_ai_profile_draftGET /ai-profile-drafts/{draft_id}Open in the API reference

Token scope

ai_org:manage

Send

Path
  • draft_iduuidThe persona draft

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404

Receive

The same shape create_ai_profile_draft returns — 15 fields. Go to it

Show it here
  • briefstringWhat the agent is for, in the person's words: 3 to 500 characters
  • completed_atdate-timeoptionalWhen it was finished.
  • cost_microsint64What it cost, fee included, in micro-dollars.
  • created_atdate-timeWhen it was asked for.
  • draft_iduuidA persona draft: a persona a small model wrote from a person's brief
  • failureobjectoptional
  • model_idobjectoptional
  • org_iduuid
  • personaobjectoptional
  • positionobjectoptional
  • repositories[]object2 fields
    • full_pathstringIts path as addresses name it, as it is now.
    • repository_iduuid
  • sources[]object2 fields
    • pathstring
    • repository_iduuid
  • statefailedqueuedreadyrunningWhere a draft stands: queued → running → ready or failed.
  • summaryobjectoptional
  • written_forobjectoptional
GET/ai-profile-drafts/{draft_id}/watchai_org:manage

Wait for a persona draft to be finished.

stream_ai_profile_draftGET /ai-profile-drafts/{draft_id}/watchOpen in the API reference

Token scope

ai_org:manage

Send

Path
  • draft_iduuidThe persona draft

Refuses

  • 400Bad request — a path parameter is not a well-formed value of its type
  • 401Unauthenticated — no credential, or an invalid one
  • 403Forbidden — the caller's access level or token scope is insufficient
  • 404
  • 503Too many streams are open; retry later, or read the draft instead

Receive

No body.

Limits

WhatFreeProTeamEnterprise
AI organizations per top-level group—111
Agents per organization—31050
Sessions running at once—2520
Sessions started per organization per day—200200200
Draft revisions written per organization per day—505050
Session instruction—4,000 characters4,000 characters4,000 characters
Instructions and other inputs per session—505050
Workspace time per month—1,200 minutes6,000 minutes24,000 minutes
One workspace command—10 minutes, up to 3010 minutes, up to 3010 minutes, up to 30
A workspace's life—4 hours4 hours4 hours
A repository a workspace clones—2 GiB2 GiB2 GiB
A revision—256 KiB256 KiB256 KiB
Persona drafts you start in any 24 hours—555
Persona drafts started per organization per day—505050
Persona drafts being written at once per organization—222
A persona draft's cost—$0.50 at most$0.50 at most$0.50 at most

A session queued beyond the running limit waits its turn rather than being refused. Each session also stops at its own bounds: a number of turns, a number of tool calls, an amount of output and a length of time.

Troubleshooting

402creating an organization
Cause
The group is on the Free plan, and Gitmoap sells paid plans
What to do
Upgrade the group's plan
403 FORBIDDENcreating an organization — not available
Cause
AI organizations are not available to this group
What to do
Ask us to make them available to it
409creating an organization
Cause
The group already has one
What to do
Use it; there is one per top-level group
409resuming
Cause
Nobody has consented to inference
What to do
The board records consent first
409publishing — an agent has work in progress
Cause
The revision retires an agent with a session still running
What to do
Let it finish or cancel it, then publish
422creating an organization
Cause
The request names region us; organizations are served in the EU
What to do
Create it with region eu
422writing a draft
Cause
The revision is not a sound configuration; the message names the field
What to do
Fix that field and write it again
403 PERMISSION_REQUIRED
Cause
The action is a board decision, or needs a role you do not hold
What to do
Ask an Owner, or ask to be added to the board
A session stays queued
Cause
The organization is paused, consent is withdrawn, the agent is suspended, or the running limit is reached
What to do
Check the organization and the agent; queued sessions start as soon as they can
An agent did not wake for an assignment or a mention
Cause
Whoever acted cannot push to the repository or manage the organization; the action was the agent's own or another agent's; the pipeline already woke it three times; or the organization has no published revision
What to do
Act as somebody who can push to the repository, or add the person to the revision's triggers list
The transcript says the workspace could not start for lack of workspace time
Cause
The group has used its workspace time for the month
What to do
Wait for the next month, or move to a plan with more
A command in the workspace cannot download a package
Cause
It reaches a registry the workspace does not serve, or tries to publish
What to do
A workspace reads from npm, crates.io, PyPI and the Rust toolchain only
A session ends with budget_exhausted
Cause
A budget or the balance could not cover the next call
What to do
Raise the budget in a revision, or ask for the balance to be funded
An agent's push is refused
Cause
It pushed outside ai/<handle>/, a commit it did not author, or a protected path
What to do
Expected: these are never an agent's to do. A person makes those changes
An agent's pipeline run fails for lack of a secret
Cause
The run is untrusted, because the live revision keeps agent code untrusted
What to do
Review the commit and approve the run, or publish a revision without pipelines.agent_code: untrusted
422drafting a persona — a repository cannot ground it
Cause
You cannot read it, or someone who can see the organization cannot: it does not inherit access, a limit applies to it, or a role sees the organization without its code
What to do
Drop that repository, or name another
422drafting a persona — the model cannot be used
Cause
The model is retired, unknown, or served outside your organization's region
What to do
Name a model from the model list served in your organization's region, or leave model_id out
429drafting a persona
Cause
You started five drafts in the last 24 hours, the organization fifty today, or two are still being written
What to do
Wait for the time Retry-After gives
A persona draft ends failed with access_changed
Cause
Access to a repository it was reading changed while it was written
What to do
Start another; it reads only what qualifies now