Access requests
Access requests turn the Admin UI into a self-serve workflow. An internal user asks for a new key, access to more models, a seat on a team, more budget, or higher rate limits, with a short justification. A budget or rate limit raise can be temporary, and the gateway puts the old limit back by itself when it runs out. An approver reviews the request in the Admin UI or through the API, and on approval the gateway applies the change itself, through the same management functions an admin would call by hand. Nothing changes until someone approves. Access requests are an enterprise feature, and every /access_request route returns 403 without a license.
When you would use this
A developer on the NLP team needs a key with 25 dollars a month for a nightly evaluation run. Instead of messaging an admin, they file a request from the Admin UI with the models, budget and a one line reason. The team admin sees it in the review queue the next morning, approves it with a note, and the gateway creates the key under the developer's account. The developer sees the new key in their request's outcome and on the Virtual Keys page.
A second example. A developer runs a load test and their key starts answering 429 with Rate limit exceeded. The error body carries a request_increase hint that names the rate_limit_increase request type and the rpm_limit field to raise. The developer files a request for 600 requests per minute that lasts 7 days. The approvers see an access_request_created notice in Slack, a proxy admin approves it, and a week later the gateway sets the key back to its old limit without anyone having to remember.
Before you start
The license has to include access_requests. Requesters need an Admin UI account. Approvers are proxy admins, or admins of the team a request targets, and team budget and team rate limit increases are reviewed by proxy admins only. When email is configured, the requester is emailed the outcome. When alerting is set up, approvers get a notice for every new request.
Request types
Each request carries a typed payload, discriminated by request_type.
request_type | Payload fields | What approval does |
|---|---|---|
virtual_key | models (at least one), optional max_budget, budget_duration, team_id, key_alias | Generates a new key for the requester with those settings. |
model_access | models, and exactly one of key (the token id or alias of one of the requester's keys) or team_id | Adds the models to the key, or widens the requester's model scope in the team. A key with no model restriction is left unchanged. |
team_membership | team_id of a team that is open to join, role (user or admin, default user) | Adds the requester to the team with that role. |
budget_increase | max_budget (greater than zero), exactly one of key or team_id, optional expires_after | Raises max_budget on the key or the team. |
rate_limit_increase | rpm_limit (requests per minute), tpm_limit (tokens per minute) or both, each a whole number above zero, exactly one of key or team_id, optional expires_after | Raises the key's or the team's limits. A limit left out stays as it is. |
A request may only target the caller's own key, and a team the caller is allowed to ask about. Only a team admin can ask for that team's budget or rate limits to be raised. A rate limit request must raise a limit the key or team already has. A key with no rpm_limit has no requests per minute limit at all, so there is nothing to raise and the request is refused with 400. A team is open to join when an admin lists it under default_internal_user_params.available_teams in the config, the same list GET /team/available returns, and a join request for any other team is refused with 403.
Name a key by its token id (the token_id the Virtual Keys page shows) or its alias, never by the secret sk-... value. If a caller sends the secret anyway, the gateway stores and audits only the hashed token id, so the secret never reaches the request table, the audit log or the review queue.
A request about a key goes to the admins of the team that owns the key, and to proxy admins. A request about a key that belongs to no team goes to proxy admins only.
Ask from an error
When a request is refused because a key or a team reached its budget or its rate limit, the error body tells the caller how to ask for more. Next to the usual message, type and code fields, the error object carries request_increase:
{
"error": {
"message": "Rate limit exceeded for api_key: 5b2c.... Limit type: requests. Current limit: 60, Remaining: 0. Limit resets at: 2026-11-24 10:01:00 UTC",
"type": "rate_limit_error",
"param": null,
"code": "429",
"request_increase": {
"request_type": "rate_limit_increase",
"limit": "rpm_limit",
"target": "key",
"route": "/access_request/new",
"docs": "https://docs.spanway.ai/docs/proxy/enterprise/access_requests#ask-from-an-error"
}
}
}
The fields mean the following. request_type is the type to file, budget_increase or rate_limit_increase. limit is the payload field to raise, max_budget, rpm_limit or tpm_limit. target says whether the key's or the team's limit was reached, and team_id names the team when it was the team's. route is where to file it. To act on the example above, file a request for your own key, naming it by its alias or token id:
curl -X POST http://localhost:4000/access_request/new \
-H "Authorization: Bearer $MEMBER_KEY" \
-H "Content-Type: application/json" \
-d '{
"payload": {"request_type": "rate_limit_increase", "rpm_limit": 600, "key": "eval-harness", "expires_after": "7d"},
"justification": "Load test of the summarizer before launch"
}'
The hint appears only when the license includes access_requests, so nobody is pointed at a route that would refuse them. It is added to budget refusals of a key or a team, and to 429 answers from a key's or team's requests per minute or tokens per minute limit. Other refusals carry no hint, because no request type raises them: user, end user, organization, project, tag and model access group budgets, per model limits, and the limit on parallel requests. Budget windows set through budget_limits also carry the max_budget hint, but raising max_budget does not change a window, so ask an admin to change the window instead. The hint is part of the OpenAI style error body. Routes that answer in the Anthropic error shape, such as /v1/messages, do not carry it.
Temporary raises
Set expires_after on a budget_increase or rate_limit_increase to make the raise temporary. It takes a length such as 12h, 7d, 2w or 1mo, longer than zero and at most 366d. The time counts from the approval, not from when the request was filed. Leave it out to keep the raise for good.
On approval the gateway records the old value of every limit it raised in applied_result.reverts and the end time in applied_result.expires_at and in the request's expires_at. A job runs every 5 minutes. For each approved raise whose time is up, it puts back each old value, through the same key and team update code an admin uses, so the key or team gets its own audit row and its cached limits are refreshed. A limit that had no value before becomes unset again, which means unlimited. The request then moves to expired, and applied_result.reverted_at records when. The job runs on gateways without Redis too. With Redis, a lock keeps it to one instance at a time. A raise whose restore fails stays approved and moves to the back of the queue, so it never holds up the others, and the job tries it again on the next run.
When a new raise on the same limit of the same key or team is approved while an earlier temporary raise is still running, the new raise takes over that limit. It keeps the value from before the first raise as the one to put back, and the earlier raise stops changing that limit when it runs out. For example, a key at 100 requests per minute gets 600 for one day and then 1000 for seven days. After the first day the key stays at 1000, and after the seventh day it goes back to 100. The earlier request gets an updated audit row showing the limit it handed over. A raise on a different limit, for example tpm_limit while the earlier one raised rpm_limit, leaves the earlier raise alone.
The job leaves a limit alone when someone changed it after the approval, for example an admin who raised it further by hand, so a later decision is never undone. Such limits are listed in applied_result.kept. When the key or team was deleted in the meantime, there is nothing to put back and every limit is listed in kept. When putting a value back fails, for example because the database is down, the request stays approved and the job tries again on its next run.
Approver alerts
Every new request sends an access_request_created notice to the alerting destinations in general_settings.alerting, such as Slack, Microsoft Teams or a webhook, so approvers know a request is waiting without opening the Admin UI. The notice names the request id, the requester's user id, what is asked for with the amounts, and the team, for example Access request req-6a1f from user_id=user-123 is waiting for review: rpm_limit raised to 600 for 7d, for one of their keys. Review it on the Access Requests page of the Admin UI. It never carries the justification or any other text the requester typed, so nobody can put a link or a misleading message into the approvers' channel, and it names a key only as "one of their keys". The alert is sent after the request is saved, so a slow or failing alert destination never delays or fails the request. To turn the notice off, leave access_request_created out of alert_types.
Step by step
-
Raise a request. In the Admin UI open Access Requests and click + New Request. Pick the Request Type, fill in the fields it shows, for a key the Models, Max Budget (USD), Budget Resets, Team and Key Alias, add a Justification and click Submit Request. For a rate limit raise pick Rate limit increase, fill in New Requests per Minute, New Tokens per Minute or both, choose Apply to and the Key or Team, and pick how long it Lasts For, or Keep the raise to make it permanent. A budget raise has the same Lasts For choice. Over the API call
POST /access_request/newwith your own key or session.curl -X POST http://localhost:4000/access_request/new \-H "Authorization: Bearer $MEMBER_KEY" \-H "Content-Type: application/json" \-d '{"payload": {"request_type": "virtual_key","models": ["claude-sonnet-5-5"],"max_budget": 25,"budget_duration": "30d","team_id": "team-nlp","key_alias": "eval-harness"},"justification": "Nightly evaluation runs for the summarizer"}'{"request_id": "req-6a1f","request_type": "virtual_key","status": "pending","requester_user_id": "user-123","team_id": "team-nlp","target_key_token": null,"payload": {"request_type": "virtual_key", "models": ["claude-sonnet-5-5"], "max_budget": 25, "budget_duration": "30d", "team_id": "team-nlp", "key_alias": "eval-harness"},"justification": "Nightly evaluation runs for the summarizer","reviewer_user_id": null,"review_note": null,"applied_result": null,"created_at": "2026-11-01T10:02:11Z","updated_at": "2026-11-01T10:02:11Z","resolved_at": null} -
Follow it. The My Requests tab lists your requests with a status badge, and Cancel withdraws a pending one. Over the API call
GET /access_request/listwithrequester_user_id, orGET /access_request/info?request_id=..., andPOST /access_request/cancelto withdraw.curl -X POST http://localhost:4000/access_request/cancel \-H "Authorization: Bearer $MEMBER_KEY" -H "Content-Type: application/json" \-d '{"request_id": "req-6a1f"}' -
Review as an approver. Open Access Requests and the Review Queue tab, which lists the pending requests you may decide with their requester, type, summary and justification. Over the API list them with
GET /access_request/list.curl "http://localhost:4000/access_request/list?status=pending&team_id=team-nlp&page=1&page_size=25" \-H "Authorization: Bearer $SPANWAY_API_KEY"The list returns
requests,total,page,page_sizeandtotal_pages, and acceptsstatus,request_type,team_idandrequester_user_idfilters. -
Approve or reject. Click Approve, optionally type a Review note and confirm Approve this request?, or click Reject and confirm Reject this request?. Over the API call
POST /access_request/approveorPOST /access_request/reject.curl -X POST http://localhost:4000/access_request/approve \-H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \-d '{"request_id": "req-6a1f", "review_note": "Approved for Q4 evals"}'curl -X POST http://localhost:4000/access_request/reject \-H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \-d '{"request_id": "req-6a1f", "review_note": "Use the shared evals key instead"}'
What you should see
The approved request's status becomes approved and applied_result records what was changed, for example the token_id and key_alias of a generated key, the models granted, the new max_budget, rpm_limit or tpm_limit, or the membership_role. A temporary raise also shows expires_at and, once it ran out, reverted_at. The requester's My Requests tab shows Approved with the outcome, and the new key appears on their Virtual Keys page, or the team seat on their Teams page. A rejected request shows Rejected with the reviewer's note and nothing changed. Every action is written to the audit log, and the requester is emailed when email is configured. The email is sent after the answer goes back to the approver, so a slow or failing mailer never delays or blocks the review.
Lifecycle
A request starts as pending. While an approval is being applied it is applying, which stops two approvers from applying the same request twice. The second approver gets a 409. It ends as approved, rejected, or cancelled (withdrawn by the requester). A temporary raise moves on from approved to expired once its time is up and the old limits are back. If the management code refuses the change, for example because it would exceed the team's budget, the request goes back to pending and the approver sees the refusal. Only pending requests can be approved, rejected or cancelled, other states return 400. Nobody but a proxy admin can approve their own request, so a team admin who asks for something gets 403 on approve and the request waits for another admin of the team or a proxy admin. The review queue leaves a team admin's own requests out.
A request can stay in applying if the gateway stops in the middle of an approval, or if the change was applied but the final status could not be saved. From then on approve, reject and cancel all answer 400, because only pending requests can be decided, and no route moves it back. To recover, first check whether the change happened (the key, team seat or budget the request asked for), then ask a database administrator to set the row back. If the change did not happen, set status to pending so it can be reviewed again. If it did, set it to approved. For example UPDATE "Spanway_AccessRequestTable" SET status = 'pending' WHERE request_id = 'req-6a1f' AND status = 'applying';. Automatic recovery of a stuck request is planned.
Audit
Every step writes a row to the audit log under Spanway_AccessRequestTable. Filing writes created. Cancel, approve and reject write updated with the request before and after, naming the person who did it. When a temporary raise runs out, the expiry job writes updated with the changed by user access_request_expiry, showing the status going from approved to expired and which limits came back or were kept. The limit change itself, on approval and on expiry, also writes the key's or team's own updated row.
From an agent
The admin MCP server exposes the review flow as tools, list_access_requests, get_access_request, approve_access_request and reject_access_request, under the same visibility and reviewer rules as the routes on this page.
Retention
Settled requests are kept until maximum_access_request_retention_period is set in general_settings, for example 90d. The cleanup job then deletes requests whose last change is older than that period. Pending requests are always kept, and so are approved temporary raises that have not run out yet, because the expiry job needs them to put the old limits back. A request stuck in applying counts as settled, so fix it before the period runs out if you need the record. See the settings reference.
Who can see and review requests
Requesters see their own requests. Proxy admins and admin viewers see every request. Team admins see requests that target teams they administer. Reviewing needs a proxy admin, or an admin of the team the request targets. Team budget and team rate limit increases are reviewed by proxy admins only.
| Method | Path | Summary |
|---|---|---|
| POST | /access_request/new | Ask for a key, model access, a team seat, more budget or higher rate limits |
| GET | /access_request/list | List access requests |
| GET | /access_request/info | Get one access request |
| POST | /access_request/cancel | Withdraw your own access request |
| POST | /access_request/approve | Approve an access request and apply it |
| POST | /access_request/reject | Reject an access request |
Errors
Every error body has the shape {"detail": {"error": "<message>"}}.
| Status and message | Cause | Fix |
|---|---|---|
403 naming the access_requests feature | The license does not include access requests. | Add the feature to the license. |
400 access requests need a key bound to a user | The key you called with belongs to no user, for example a service key. This answers every route, list and info included. | Call with your own key or your Admin UI session. |
400 model_access targets exactly one of key or team_id (or budget_increase ...) | The payload names both key and team_id, or neither. | Send exactly one of them. |
422 on payload | The payload misses a field for its type, has an unknown request_type, or sets max_budget to zero or less. | Send the fields in the request types table. |
403 the key is not one the requester owns | The key does not exist or is not yours. | Pick one of your own keys by its token id or alias. |
403 requester is not a member of team_id=<id> | A key or model access request names a team you are not in. | Pick a team you belong to. |
403 team_id=<id> is not open to join, ask a team admin to add you | A team membership request names a team that is not listed in available_teams. | Ask a team admin to add you, or an admin to open the team for joining. |
403 only an admin of team_id=<id> can request its budget be raised | Only team admins may ask for more team budget. | Ask a team admin to raise the request. |
400 requester is already a member of team_id=<id> | You are already in that team. | Nothing to do. |
400 max_budget=<n> does not raise the key's current max_budget=<m> (or the team's) | The budget asked for is not higher than the current one. | Ask for a higher amount. |
400 rpm_limit=<n> does not raise the key's current rpm_limit=<m> (or tpm_limit, or the team's) | The rate limit asked for is not higher than the current one. | Ask for a higher number. |
400 the key has no rpm_limit, so there is no limit to raise (or tpm_limit, or the team) | The key or team has no such limit, so it is already unlimited. | Leave that limit out of the request. If you got a 429, look at the hint, it names the limit that was reached. |
400 rate_limit_increase targets exactly one of key or team_id | The payload names both key and team_id, or neither. | Send exactly one of them. |
403 only an admin of team_id=<id> can request its rate limits be raised | Only team admins may ask for higher team rate limits. | Ask a team admin to raise the request. |
422 rate_limit_increase needs rpm_limit, tpm_limit or both | The rate limit request names no limit. | Send rpm_limit, tpm_limit or both. |
422 expires_after must be longer than zero and at most 366d, or Invalid duration format | expires_after is not a length the gateway can read, or is out of range. | Send a length such as 12h, 7d or 1mo, or leave it out. |
404 team_id=<id> not found | The team named in the request does not exist. | Check the team id on the Teams page. |
404 request_id=<id> not found | The request does not exist, or you may not see it. | List your requests with GET /access_request/list. |
403 only the requester can cancel a request | Someone other than the requester tried to cancel. | Reject the request instead, if you are an approver. |
403 only a proxy admin or an admin of the team this request targets can review it | You may not review this request. | Ask a proxy admin or an admin of the request's team. |
403 you cannot approve your own access request, ask another team admin or a proxy admin | A team admin tried to approve their own request. | Ask another admin of the team or a proxy admin. |
400 request_id=<id> is <status>, only pending requests can be approved (or rejected, cancelled) | The request was already decided, or is stuck in applying. | Nothing to do, raise a new request, or see the lifecycle section for a stuck request. |
409 request_id=<id> is already being reviewed | Another approver is applying the same request. | Reload the queue. The request is no longer pending. |
could not apply request: <reason> | The management code refused the change, for example a budget above the team's, and the request went back to pending. The status is the one that code answered with, often 400, 403 or 404. | Fix the limit or the key, or reject the request with a note. |
404 the key this request targets no longer exists | The key was deleted after the request was raised. | Reject the request. |
500 DB not connected... | The gateway runs without a database. | Connect the database. Access requests are stored there. |
The same messages are listed in the error reference.
Logs
| Level | Line | Meaning | Action |
|---|---|---|---|
| WARNING | access request <request_id>: requester notification failed: <error> | The outcome email to the requester could not be sent. The review itself succeeded. | Check the email settings and the mail provider. The requester can still see the outcome on My Requests. |
| WARNING | access request <request_id>: approver alert failed: <error> | The access_request_created notice could not be sent. The request was saved and waits in the review queue. | Check the alerting destination, for example the Slack webhook URL. |
| WARNING | access request <request_id>: the raise ran out but the old limits could not be restored, retrying: <error> | A temporary raise ran out, but putting the old limit back failed. The raise stays in place and the request stays approved. | Normal during a short database outage, the job retries every 5 minutes. If it keeps repeating, read the error, for example a key that can no longer be updated, and set the limit by hand. |
| WARNING | access request <request_id>: the raise ran out but the expiry job failed on it, retrying: <error type>: <error> | Something unexpected went wrong while putting the old limit back, for example a database error. Only this request is skipped, the rest of the run goes on, and the request stays approved. | The job tries again on the next run. If the line keeps repeating for the same request, read the error and set the limit by hand. |
| WARNING | access request <request_id>: could not postpone the expiry retry: <error> | The job could not move a failed request to the back of the queue, usually because the database is unreachable. | Nothing to do if the database is back. The request is tried again on the next run. |
| INFO | access request expiry: <n> temporary raise(s) ran out and were restored | One expiry run put the old limits back on <n> keys or teams. The line names no request text. It shows when SPANWAY_LOG is INFO or lower. | Nothing, this is the normal sign that the job works. |
The log reference lists these lines too.
Metrics and traces
Two Prometheus counters show the feature at work, see the Prometheus page.
| Metric | Labels | What it counts |
|---|---|---|
spanway_request_increase_hints_total | request_type (budget_increase or rate_limit_increase), target (key or team) | Refusals that carried the request_increase hint. A rising count tells you limits are tight and requests are about to arrive. |
spanway_access_request_expiry_total | outcome: restored, kept or failed | Temporary raises the expiry job settled. restored put every old limit back, kept left at least one limit alone because someone changed it after approval, and failed will be retried. A failed count that keeps growing means a stuck expiry, read the WARNING lines above. |
Each expiry run is one job access_request_expiry span in your traces when OpenTelemetry is on, with spanway.access_request.due (raises that were due) and spanway.access_request.expired (raises put back) as attributes. Access requests are not an Explore source, the audit log and these counters are where to look.
Related
- Self-serve onboarding for how developers get their first key.
- Virtual keys and team budgets for what an approval changes.
- Email notifications for the outcome email.
- Audit logs for the rows each action writes.
- Alerting for the
access_request_creatednotice. - Rate limits for what
rpm_limitandtpm_limitdo. - Access Requests page for every control on the Admin UI page.