Register your agent

Tell Sess where your agent runs and what it needs to start. Then prove the address is yours.

On this page

Before you start

  • A Sess API key. Create one in your developer account.
  • An HTTPS address for your agent, on a site where you can publish one small file.
  • A terminal with curl and jq.
Shell: set the API address and read the API key without echoing it
export SESS_API="https://api.sess.si"
read -rs SESS_API_KEY && export SESS_API_KEY   # paste the key, then press Enter

1. Register

Describe your agent: where Sess sends each run, what it needs to start, which websites may start it, and how much it can take on.

Shell: write target.json
cat > target.json <<'JSON'
{
  "type": "http",
  "endpoint": "https://agent.example.com/sess",
  "capability": {
    "name": "weekend.plan",
    "version": "1",
    "input_schema": {
      "type": "object",
      "properties": { "city": { "type": "string", "maxLength": 80 } },
      "required": ["city"],
      "additionalProperties": false
    }
  },
  "grant": { "audiences": ["https://agent.example.com"], "lifetime_seconds": 3600 },
  "budget": { "max_concurrent": 5, "max_starts_per_day": 100 }
}
JSON
  • endpoint: where Sess sends each run. An https:// address on the standard port. It cannot change later; register again for a new address.
  • capability: a name for what your agent does, and the JSON Schema of what it needs to start.
  • grant: the websites allowed to start your agent, and how long each permission to start lasts, in seconds.
  • budget: how many runs at once, and how many starts a day.
Shell: register
curl -sS -X POST "$SESS_API/v1/targets" \
  -H "Authorization: Bearer $SESS_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @target.json \
  -o registered.json -w '%{http_code}\n'
export TARGET_ID="$(jq -r .id registered.json)"

Expected result: 201. Your agent is registered, but no one can start it until you prove the address is yours.

2. Prove the address is yours

The answer tells you which file to publish and where:

Shell: show the verification details
jq .verification registered.json
Output
{
  "status": "pending",
  "token": "sess_tv_…",
  "well_known_url": "https://agent.example.com/.well-known/sess-target/tgt_….json",
  "verified_at": null,
  "expires_at": null
}

Publish a JSON file with your target ID and the token at that exact address:

Shell: write the file to publish
jq '{target_id: .id, token: .verification.token}' registered.json > "$TARGET_ID.json"

The token is not a secret: anyone can read this file. When it is online, ask Sess to check it:

Shell: verify
curl -sS -X POST "$SESS_API/v1/targets/$TARGET_ID/verify" \
  -H "Authorization: Bearer $SESS_API_KEY" \
  -o verified.json -w '%{http_code}\n'
jq -r .verification.status verified.json

Expected result: 200, then verified. Sess only reads that file; it does not call your agent to check.

Verification lasts 30 days. Verify again before then, with the same file, to keep it. If it lapses, no one can start your agent until you verify again.

3. Read and change it

Read one agent, or all of yours:

Shell: read
curl -sS "$SESS_API/v1/targets/$TARGET_ID" -H "Authorization: Bearer $SESS_API_KEY"
curl -sS "$SESS_API/v1/targets" -H "Authorization: Bearer $SESS_API_KEY"

Send only what you want to change. This raises the budget:

Shell: change the budget
curl -sS -X PATCH "$SESS_API/v1/targets/$TARGET_ID" \
  -H "Authorization: Bearer $SESS_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{"budget": {"max_concurrent": 10, "max_starts_per_day": 500}}'

To pause your agent, send {"enabled": false}; to turn it back on, {"enabled": true}. While it is paused, no one can start it, and runs still waiting to be sent to your agent are stopped. A run already being sent to your agent, or already running, may still arrive or carry on.

Every start is tied to the settings your agent had when permission to start was given. When you change what it needs to start, which websites may start it, or its budget, earlier permissions can no longer start new runs, and runs still waiting to be sent are stopped. A run already being sent to your agent, or already running, may still arrive or carry on under the earlier settings.

Sharing

Coming soon One link to share your agent, so anyone can start it.

How it works

Versions, checks and error codes
  • Each agent has a version, starting at 1. A change to capability, grant or budget adds one; enabled and default_expires_in do not. A start grant is issued for one version: a start with a grant from an older version is refused with 409 TARGET_VERSION_CONFLICT, and runs still in status admitted fail with reason stale_binding (pausing fails them with target_disabled). The check happens when Sess claims a run for sending; a run already claimed (status dispatching or later) is sent as it was admitted, and an API call already sent may reach your endpoint after the change.
  • Start grants: POST /v1/targets/{id}/grants with an audience from grant.audiences returns the grant secret once. It answers 409 ACTION_NOT_ALLOWED with reason unverified or disabled until the agent is verified and on. See the API reference.
  • Present the grant secret as Authorization: Bearer on POST /v1/invocations from the grant's audience origin.
  • When your agent creates a Session for a run, send the run's invocation_id with POST /v1/sessions. The run must be in your workspace and still open: an unknown run answers 422 VALIDATION_FAILED (reason unknown_invocation), and a run that has ended answers 409 INVOCATION_TERMINAL. Without it, the Session is not tied to a run.
  • Verification: one GET of well_known_url, which is /.well-known/sess-target/<target id>.json on your endpoint's origin. HTTPS on port 443, public addresses only, no redirects followed, a 10-second timeout. It passes on a 2xx answer of at most 4,096 bytes whose JSON has the exact target_id and token; other fields are ignored. Verifying again renews it for 30 days from then; the token stays the same.
  • A failed check answers 422 TARGET_VERIFICATION_FAILED with a reason: redirect, rejected (not a 2xx answer), bad_answer (too large, not JSON or not matching), timeout, connection, dns or egress_refused.
  • Registration refuses an endpoint it cannot use with 400 TARGET_INVALID_URL, and an input schema outside the supported subset with 400 TARGET_INVALID_CAPABILITY. Both carry a reason.
  • Registering takes an optional Idempotency-Key. If you cannot tell whether a register call went through, send it again with the same key and body: you get the agent you registered, not a second one. Changes take no If-Match.
  • default_expires_in is optional: the link lifetime your agent is asked to give the Sessions it creates for a run. See the API reference.
  • default_expires_in is copied into each admitted run and sent in the dispatch message as limits.expires_in. An agent that sets its own expires_in, calls the API directly or uses an SDK that does not apply it is not governed by it, and creating the Session checks the value against the creating key's plan again. It is not part of the versioned binding: changing it changes no version and leaves grants and admitted runs as they are.

Where next

  • API reference: every field, limit and error code for agents, grants and starts.
  • Concepts: what a request is, revisions, results and receipts.

Was this page useful?

Tell us more

Thanks for telling us.

You’ve sent a lot of answers in the last hour. Please try again later.

This couldn’t be sent right now. Please try again later.

That didn’t go through. Keep your note under 280 characters and send it again.

No account needed. We keep your answer, your note and this page’s address for a year, with a one-way code of your network address to stop abuse. Please leave out personal details.