Sentrial Sessions API

Create and manage agent sessions.

Operations 2

POST /api/sdk/sessions Create a session #
PATCH /api/sdk/sessions/{id} Update a session #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sentrial-sessions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sentrial-sessions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sentrial SDK Sessions API
  version: '1.0'
  description: Sentrial is an AI agent observability platform.
  contact:
    name: Sentrial
    url: https://sentrial.com
  x-apievangelist-generated: true
  x-apievangelist-source: https://www.sentrial.com/docs/api/sessions.md, https://www.sentrial.com/docs/api/events.md, https://www.sentrial.com/docs/api/auth.md
servers:
- url: https://api.sentrial.com
  description: Production
security:
- bearerAuth: []
tags:
- name: Sessions
  description: Create and manage agent sessions.
paths:
  /api/sdk/sessions:
    post:
      operationId: createSession
      summary: Create a session
      description: Create a new agent session. A session is a complete record of a single agent interaction.
      tags:
      - Sessions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSessionRequest'
            example:
              name: Customer Support Request
              agentName: support-agent
              userId: user_123
              metadata:
                ticketId: TKT-789
                channel: web_chat
      responses:
        '200':
          description: Session created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
              example:
                id: sess_abc123def456
                name: Customer Support Request
                agentName: support-agent
                userId: user_123
                status: active
                createdAt: '2025-01-12T10:30:00Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
  /api/sdk/sessions/{id}:
    patch:
      operationId: updateSession
      summary: Update a session
      description: Update a session's status and record final metrics (cost, duration, token usage, custom metrics).
      tags:
      - Sessions
      parameters:
      - name: id
        in: path
        required: true
        description: ID of the session to update.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSessionRequest'
            example:
              status: completed
              success: true
              estimatedCost: 0.045
              durationMs: 3500
              promptTokens: 1500
              completionTokens: 500
              totalTokens: 2000
              customMetrics:
                satisfaction: 4.5
                resolution_time: 120
      responses:
        '200':
          description: Session updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
              example:
                id: sess_abc123def456
                name: Customer Support Request
                status: completed
                success: true
                estimatedCost: 0.045
                durationMs: 3500
                completedAt: '2025-01-12T10:30:03Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  responses:
    NotFound:
      description: Session ID not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Server error, please retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid or missing API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: API key does not have permission for this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Missing required fields or invalid data.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    UpdateSessionRequest:
      type: object
      properties:
        status:
          type: string
          enum:
          - completed
          - failed
          description: Terminal status of the session.
        success:
          type: boolean
          description: Whether the session completed successfully.
        failureReason:
          type: string
          description: Reason the session failed.
        estimatedCost:
          type: number
          description: Total cost in USD.
        durationMs:
          type: number
          description: Duration in milliseconds.
        promptTokens:
          type: number
          description: Input tokens used.
        completionTokens:
          type: number
          description: Output tokens used.
        totalTokens:
          type: number
          description: Total tokens.
        customMetrics:
          type: object
          additionalProperties: true
          description: Custom numeric metrics.
    Session:
      type: object
      properties:
        id:
          type: string
          description: Session ID (prefix sess_).
        name:
          type: string
        agentName:
          type: string
        userId:
          type: string
        status:
          type: string
          enum:
          - active
          - completed
          - failed
        success:
          type: boolean
        estimatedCost:
          type: number
        durationMs:
          type: number
        createdAt:
          type: string
          format: date-time
        completedAt:
          type: string
          format: date-time
    CreateSessionRequest:
      type: object
      required:
      - name
      - agentName
      - userId
      properties:
        name:
          type: string
          description: Descriptive name for the session.
        agentName:
          type: string
          description: Agent identifier for grouping.
        userId:
          type: string
          description: External user identifier.
        metadata:
          type: object
          additionalProperties: true
          description: Custom key-value data.
    Error:
      type: object
      properties:
        error:
          type: string
          description: Short error code/title.
        message:
          type: string
          description: Human-readable explanation.
      example:
        error: Unauthorized
        message: Invalid or missing API key
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key passed as a Bearer token in the Authorization header. Keys follow the format sentrial_live_xxxxxxxxxxxxx and are created in organization Settings -> API Keys.