---
title: "Change the connection an existing chat runs on"
method: PUT
path: "/api/chat/sessions/{session_id}/connection"
tags: ["v2", "chat", "chat"]
---

# Change the connection an existing chat runs on

`PUT /api/chat/sessions/{session_id}/connection`

Move a chat onto another connection, from the next turn onward.

A chat is latched to the connection it started on so that a turn cannot
silently change who pays for it halfway through. This is the deliberate
exception: when a provider stops accepting turns -- a spent quota, an
expired login -- the alternative to switching is the chat simply ending.

It never happens on its own. The caller is a button the user pressed, and
the run continues on the connection they picked rather than on whichever
one happens to work.

History is not rewritten. Turns already stamped keep the connection they
ran on, so a chat that hit a limit and carried on elsewhere reads as
exactly that.

## Path parameters

- `session_id` string, required

## Request body

- ChangeSessionConnectionRequest — The connection the rest of this chat should run on.
  - `llm_auth_provider` 'platform' | 'codex', required
  - `llm_credential_id` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `401` — Authentication required
- `404` — Session not found or access denied
- `422` — Validation Error

## Changes

- **2026-09-02** `be3f4566783c` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server/changes/api/chat/sessions/:session_id/connection/put.md)

---

[API](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/significant-gravitas/autogpt-agent-server/revisions/dc8f009814db/schema)
