---
title: Sticky and rotating proxy sessions for AI agents
description: How sid and rot keep an agent's requests on one device or move them on the clock, what happens when a device leaves, and which mode fits a job.
label: Sticky and rotating sessions
template: article
updated: 2026-11-26
---

# Sticky and rotating sessions

A proxy username without `sid` sends each request through a device chosen for it. With `sid-<id>`, every request that carries the same key goes to the same device, and `rot` says how long it stays there: `rot-sticky` while the device stays in the pool, or a window of minutes after which the session moves to another device. Both are parts of the username an agent already sends, described for the whole journey on [Proxies for AI agents](/proxies-for-ai-agents).

## Three ways to send requests

<!-- kit:compare read=2026-11-26 -->
The three modes of a proxy username, from [Proxy usernames](/guides/usernames.md) and the edge's choice of device.
| Mode | In the username | Where the requests go | Fits |
| --- | --- | --- | --- |
| No session | no `sid` | A device picked at random for each request | Independent page fetches |
| Rotating session | `sid-<id>` with `rot-auto5`, `rot-auto10`, `rot-auto20` or `rot-auto60` | One device for each window of that many minutes, then the next device for the key | Long jobs that should spread over devices in steps |
| Sticky session | `sid-<id>` with `rot-sticky`, or `rot-hard`, which means the same | One device while it stays in the pool | Signed-in flows and anything that keeps state on the site |
<!-- /kit:compare -->

`rot` needs `sid`, and `auto10` applies when a username has `sid` and no `rot`.

## What is a session key?

A [session key](/peer-proxy-network/glossary#session-key-sid) is the `<id>` in `sid-<id>`: lower case letters, digits and `_`, up to the length [Proxy usernames](/guides/usernames.md) gives. The key is part of the username, so no edge stores a session. Every edge ranks the devices for a key the same way, from the account, the other options in the username, the key and the time window, and so every edge picks the same device for the same session.

### When does a rotating session move?

At the end of each window. The window of `rot-auto5` to `rot-auto60` is counted on the clock, from the Unix epoch, not from the session's first request. A session therefore moves at fixed times, and its first window can be shorter than the rest. `rot-sticky` has no window.

### What happens when the device leaves?

A sticky session is a handle on one device while that device stays in the pool. When the device leaves, the session moves to the next device the ranking gives for its key, and requests leave from that device's network from then on, as the [stated limits](/guides/limits.md) say.

When the device the edge chose is gone, full or closing before the stream opens, the edge tries another, and the attempt costs nothing. A username with `failover-none` asks for one attempt only: the request is refused rather than sent through a second device.

### Which devices can a session reach?

Established devices only. A new device that carries [fallback supply](/peer-proxy-network/glossary#fallback-supply) serves only usernames with a pool and a country and nothing else, so a username with `sid`, or with any of `iptype`, `carrier`, `asn`, `state` and `city`, never reaches one.

## How do I make session usernames?

`POST /app/api/proxy/spawn` prints them for a signed-in account. Send `rotation` as a `rot` mode and a `count`, and each string gets its own session key. `sessionPrefix` names the keys, and `save` keeps the set on the account. With `rotation` set to `none` the answer is one username without a session.

```sh
curl -sS -b coronium.cookies -H 'Content-Type: application/json' -d '{"count": 10, "pool": "peer", "country": "de", "protocol": "http", "format": "url", "rotation": "sticky", "sessionPrefix": "job"}' https://coronium.ai/app/api/proxy/spawn
```

Each string in the answer holds `{credential}`, which the agent fills in from its own file, and `{host}` and `{port}` while the endpoint is closed. Without a session cookie the call is refused with `401` and `sign_in_required`. Two of the examples in [Proxy usernames](/guides/usernames.md), for the example account there:

```text
0123456789abcdef0123456789abcdef-peer-de
0123456789abcdef0123456789abcdef-peer-us-state-ca-sid-job_1-rot-sticky
```

The first picks any device in Germany for each request. The second keeps session `job_1` on one device in California.

<!-- kit:username -->
The builder spells a username from its parts: pool, country, state and city, one network key, session key, rotation, `failover-none` or a device of your own. It runs in the browser, sends nothing to the service, and answers with the username the edge accepts or the refusal the edge would send, in the selector's words for each rule; a value with a dash in it is refused whole, where the edge would name the piece it cannot read. It uses the example account of [Proxy usernames](/guides/usernames.md); put your own account id in its place.
<!-- /kit:username -->

**When is a username refused?** A username outside the grammar is refused with `bad_options`: the cause names the token, and the fix shows the username to send. The spawn call refuses `sessionPrefix` or `save` with `rotation` `none`, because a username without a session has no key to name. The full grammar, with every key and its values, is in [Proxy usernames](/guides/usernames.md).

## Can an account keep its sessions?

Yes. `save` stores a set of sessions under its prefix, and the [stated limits](/guides/limits.md) give how many sets an account keeps and how large each can be. `GET /app/api/proxy/sessions` lists them, newest first, and `POST /app/api/proxy/sessions/{prefix}/forget` with `confirm` true removes one. Saved sessions have no traffic counters of their own: the statement counts traffic by day and country.

## Which mode fits a job?

- Send independent page fetches without `sid`, so each request goes through a device picked for it.
- Use `rot-sticky` for a flow that signs in, fills a cart or keeps any state that the site ties to an address.
- Use a rotating window for a long job that should move between devices at fixed times, and pick the window by how long one device should carry it.
- Add `failover-none` when the job must know that its first device was not reached, instead of a second device taking the request.
- Give each parallel worker its own key, so the workers spread over devices.

The words for these terms are in the [glossary](/peer-proxy-network/glossary), and the cost of a job does not depend on the mode: [Pay per GB](/pay-per-gb) charges the bytes alone. [Connect your agent](/agents) walks through the calls from sign-up to the first proxy string.

<!-- facts:begin sentence -->
Infrastructure for AI agents to act on the web and on real devices: mobile and residential proxies with real IP addresses, and next phones, Macs and browsers an agent can drive.

One account, one balance, one file to read.
<!-- facts:end sentence -->
