Manual
Agent access manual
Automation keys let your own agents operate the Rivelo admin API. This manual issues a key, verifies it, and states exactly what the credential can reach.
Synced with rivelo@760b3c8
Issue a key
Automation keys are separate credentials for agents. They are not administrator sessions, and they do not expire.
- Open the agent pageSign in to the dashboard, then open /admin/agent in the Agent section. Agent access is served in managed mode only.
- Create a named keyName the workload, not the person. The response shows the rv_agent_ value once; the table keeps only its suffix.
- Store it outside the promptPut the value in the agent's environment as RIVELO_API_KEY. Do not paste it into a prompt, repository, or log.
- At most five active keys. Revoking a key releases its slot and keeps its metadata for audit.
- Revocation is immediate and irreversible. Requests that already succeeded are not rolled back.
- The value has no reveal path. If it is lost, revoke it and issue a replacement.
Prototype mode does not serve agent access. The dashboard shows an unavailable page instead of sample data.
Authoritative sourceapps/dashboard/app/features/agent/managed-page.tsx
Verify the connection
Make GET /api/admin/agent-brief the first call. It proves the origin, the key, and the delivered capabilities before any write.
export RIVELO_URL="https://rivelo.example.com"
export RIVELO_API_KEY="rv_agent_..."
curl -sS -H "Authorization: Bearer $RIVELO_API_KEY" \
"$RIVELO_URL/api/admin/agent-brief"| Field | Meaning |
|---|---|
| publicOrigin | Validated deployment origin. Do not derive another origin from proxies or redirects. |
| capabilities | Delivered API styles for this deployment. |
| modelsEndpoint | Model listing path, or empty when inference is not delivered. |
- 401 means the key is unknown, revoked, or malformed. 403 means the route is session-only; do not retry with another key.
- The endpoint reads validated gateway configuration. It does not accept a user-supplied origin.
Authoritative sourceinternal/admin/agent.go
Load the agent instructions
The dashboard embeds an agent skill and substitutes the deployment origin. Use that copy instead of rebuilding the operation list.
- Copy or download the skillThe Agent instructions block on /admin/agent renders the embedded skill with RIVELO_URL filled in.
- Give the agent two valuesRIVELO_URL and RIVELO_API_KEY. The skill verifies access before it performs writes.
- Keep one key per workloadSeparate keys keep revocation and last-used attribution narrow.
- Do not maintain a second recipeThe skill is the authoritative operation list. This manual covers setup and boundaries.
A key is an administrative credential for the routes it can reach. It is not read-only.
Authoritative sourceassets/agent-skill/rivelo/SKILL.md
Run common operations
The automation key reaches the working surface of the admin API. Every call uses $RIVELO_URL/api/admin/... with the same bearer header.
| Task | Call |
|---|---|
| List groups and providers | GET /api/admin/groups and GET /api/admin/providers |
| Create a project | POST /api/admin/projects with {"name":"..."} |
| Issue a Project Key | POST /api/admin/project-keys with the project, name, and allowed groups; the rv_proj_ value is returned once |
| Call the gateway | POST /v1/chat/completions with the Project Key, not the automation key |
| Read usage and cost | GET /api/admin/telemetry/summary?from=...&until=... |
| Query requests | GET /api/admin/requests?projectId=...&from=...&until=... |
| Change retention | GET and PATCH /api/admin/telemetry/settings |
- Model names in gateway calls are group aliases.
- Prefer one Project per agent workload so usage and cost stay attributable.
- Exact bodies and schemas live in api/admin.openapi.yaml; the skill carries the worked examples.
- Project Key reveal is session-only. An agent can create, replace, or revoke a Project Key but cannot read an existing value.
Authoritative sourceapi/admin.openapi.yaml
Know the boundary
The route policy is default deny. An operation accepts a bearer key only when the OpenAPI contract marks it with the automation security scheme.
| Surface | What an agent can do |
|---|---|
| Projects and Project Keys | Create, update, disable, enable, and delete projects; issue, replace, and revoke Project Keys. Reveal stays session-only. |
| Providers | List, inspect, create, update, verify, refresh models and usage, and read capacity. |
| Routing | Read and edit groups and candidates, edit middleware chains, and preview the routing decision. |
| Telemetry and logs | Summary, status, settings, request queries, usage settings, pricing, media jobs and prices, and cache affinity. |
| Runtime and extensions | Gateway status, extensions, discovery, and account resources. |
- Session-only: api-keys, session, security, codex OAuth, Project Key reveal, and group cache-affinity deletion.
- A key is not read-only. It carries administrator authority on every route it can reach.
- There is no TTL, rate limit, or budget. Revocation is the stop control.
- New admin routes stay closed until the contract is annotated and the route map is regenerated.
The generated allowlist is internal/admin/agent_routes_gen.go. Use api/admin.openapi.yaml as the readable contract and do not hand-maintain a second list.
Authoritative sourceinternal/admin/agent_routes_gen.go
Revoke and rotate
Revocation is the immediate stop control. Rotation is additive: issue the replacement, move the agent, then remove the old key.
- Check last usedThe table records the most recent authenticated call. An empty value means the key has not been used.
- Issue the replacementCreate a new key with a distinct workload name before the old one is removed.
- Verify the replacementRun the agent-brief call with the new value and expect 200.
- Revoke the old keyConfirm the irreversible action. The old bearer value is rejected on the next request.
- Confirm the table stateThe revoked row stays as metadata, the active count drops, and the slot is free.
Automation keys are independent of Projects. Deleting an agent workload does not revoke its key; revoke it explicitly.
Authoritative sourceinternal/apikeys/service.go
Authoritative source
This manual is a task-oriented guide. Authoritative contracts and defaults live in the repository docs.
- Agent access design and verification
docs/architecture/agent-access.md - Admin API contract
api/admin.openapi.yaml - Embedded agent skill
assets/agent-skill/rivelo/SKILL.md - Generated route policy
internal/admin/agent_routes_gen.go