# Commit or cancel a chat stream POST /v1/a/adapters/llm/chat/stream/{id}/{action} Select code sample ``` const url = 'https://example.com/v1/a/adapters/llm/chat/stream/example/commit'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ``` curl --request POST \ --url https://example.com/v1/a/adapters/llm/chat/stream/example/commit \ --header 'Authorization: Bearer ' ``` - /v1/a/adapters/llm/chat/stream/{id}/{action} ## Permission This operation needs the permission [`llm:chat:manage`](https://docs.aiva.apifonica.com/concepts/roles-and-permissions/#llm-chat-manage). ## Authorizations - **[bearerAuth](https://docs.aiva.apifonica.com/api/account/#bearerauth)** ## Parameters ### Path Parameters **id** required string Chat stream id. **action** required string Allowed values: commit cancel Stream lifecycle action. ## Responses ### 202 Action accepted ### 400 Invalid request body or parameters Media typeapplication/json Canonical structured error emitted by the chat completion, chat stream and embeddings handlers (the shared `errorResponse` helper). `code` is an application error code (0 when unset); `status` mirrors the HTTP status. object **name** required string **message** required string **code** required integer **status** required integer ##### Examplegenerated ``` { "name": "example", "message": "example", "code": 1, "status": 1 } ``` ### 401 Unauthorized ### 403 Forbidden ### 404 Resource does not exist Media typeapplication/json Canonical structured error emitted by the chat completion, chat stream and embeddings handlers (the shared `errorResponse` helper). `code` is an application error code (0 when unset); `status` mirrors the HTTP status. object **name** required string **message** required string **code** required integer **status** required integer ##### Examplegenerated ``` { "name": "example", "message": "example", "code": 1, "status": 1 } ``` ### 500 Internal server error Media typeapplication/json Canonical structured error emitted by the chat completion, chat stream and embeddings handlers (the shared `errorResponse` helper). `code` is an application error code (0 when unset); `status` mirrors the HTTP status. object **name** required string **message** required string **code** required integer **status** required integer ##### Examplegenerated ``` { "name": "example", "message": "example", "code": 1, "status": 1 } ``` ### 502 Bad gateway (upstream adapter error)