> ## Documentation Index
> Fetch the complete documentation index at: https://abstract-pbc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# End an episode

> Ends the episode now instead of at its 60-second idle expiry. Not billed. `ended` is
`false` when the episode was already gone: unknown, expired, ended before, or another
account's.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/end_session
openapi: 3.1.0
info:
  title: Abstract API
  version: 1.0.0
  summary: Robot action models and LLMs behind one API key.
  description: >
    `POST /v1/chat/completions` serves the LLM models. `GET
    /v1/chat/completions/{completion_id}`

    reads an LLM completion your account created. `POST /v1/get_action` and
    `POST /v1/end_session`

    serve the robot action models in Dream Labs' request shape. `GET /v1/models`
    lists the LLM model ids.
  contact:
    name: Abstract
    url: https://abstract.inc
servers:
  - url: https://api.abstract.inc
security:
  - bearerAuth: []
tags:
  - name: Chat completions
  - name: Robot actions
    description: End-effector and model-specific native joint action contracts.
  - name: Catalog
  - name: CLI credentials
paths:
  /v1/end_session:
    post:
      tags:
        - Robot actions
      summary: End an episode
      description: >
        Ends the episode now instead of at its 60-second idle expiry. Not
        billed. `ended` is

        `false` when the episode was already gone: unknown, expired, ended
        before, or another

        account's.
      operationId: endSession
      parameters:
        - $ref: '#/components/parameters/AbstractVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - session_id
              properties:
                model:
                  type: string
                  description: The robot model id the episode runs on.
                session_id:
                  type: string
                  description: The `session_id` a `get_action` answer carried.
            example:
              model: allenai/molmoact2
              session_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
      responses:
        '200':
          description: The episode's state after the call.
          headers:
            Request-Id:
              $ref: '#/components/headers/RequestId'
            Abstract-Version:
              $ref: '#/components/headers/AbstractVersion'
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - session_id
                  - ended
                properties:
                  status:
                    $ref: '#/components/schemas/ActionStatus'
                  session_id:
                    type: string
                  ended:
                    type: boolean
                    description: '`true` when this call ended a live episode.'
              example:
                status:
                  code: ok
                  reason: null
                  retryable: false
                  retry_after_s: null
                session_id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                ended: true
        '400':
          $ref: '#/components/responses/ActionRefusal'
        '401':
          $ref: '#/components/responses/ActionRefusal'
        '409':
          $ref: '#/components/responses/ActionRefusal'
        '503':
          $ref: '#/components/responses/ActionRefusal'
components:
  parameters:
    AbstractVersion:
      name: Abstract-Version
      in: header
      required: false
      description: >-
        The API version your client was written for. `2026-10-27` is the only
        version. Without this header the request is answered under the newest
        version; a version the API does not answer is refused with `400
        unsupported_api_version` before anything runs.
      schema:
        type: string
        enum:
          - '2026-10-27'
  headers:
    RequestId:
      description: >-
        `req_` and 32 hex characters, new for each HTTP attempt, a retry
        included. An error repeats it as `error.request_id`. Quote it when you
        report a problem.
      schema:
        type: string
        pattern: ^req_[0-9a-f]{32}$
    AbstractVersion:
      description: >-
        The API version this answer was made under: the `Abstract-Version` the
        request sent, or the newest version when it sent none.
      schema:
        type: string
  schemas:
    ActionStatus:
      type: object
      required:
        - code
        - reason
        - retryable
        - retry_after_s
      properties:
        code:
          type: string
          description: '`ok`, or an error code from the Errors page.'
        reason:
          type:
            - string
            - 'null'
        retryable:
          type: boolean
          description: The API's retry advice. Terminal refusals are not retryable.
        retry_after_s:
          type:
            - number
            - 'null'
          description: The `Retry-After` header, when there is one.
        param:
          type: string
          description: The offending request field, when known.
        name:
          type: string
          description: Uppercase status name.
        detail:
          type: string
          description: Human-readable refusal detail.
        trace_id:
          type: string
          pattern: ^[a-f0-9]{32}$
          description: >-
            Logical reply trace. Retained on a replay and mirrored in
            X-Trace-Id. The request-id header is unique to each HTTP attempt.
        request_id:
          type: string
          pattern: ^req_[0-9a-f]{32}$
          description: On a refusal, this answer's `Request-Id` header.
  responses:
    ActionRefusal:
      description: >-
        A robot action refusal. It keeps the HTTP status and answers a `status`
        object; `code` is an error code from the Errors page.
      content:
        application/json:
          schema:
            type: object
            required:
              - status
            properties:
              status:
                $ref: '#/components/schemas/ActionStatus'
          example:
            status:
              code: model_overloaded
              reason: The runtime admission is full.
              retryable: true
              retry_after_s: 1
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Abstract API key. Get it with `abstract login`, pass it as
        `$(abstract token)`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.