Scale AI Sessions API
The Sessions API from Scale AI — 2 operation(s) for sessions.
The Sessions API from Scale AI — 2 operation(s) for sessions.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/scale-ai:scale-ai-sessions-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a 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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: EGP API V4 Sessions API
description: This is the parent API for all EGP APIs. If you are looking for the EGP API, please go to https://api.egp.scale.com/docs.
contact:
name: Scale Generative AI Platform
url: https://scale.com/genai-platform
version: 0.1.0
servers:
- url: https://api.egp.scale.com
security: []
tags:
- name: Sessions
paths:
/v4/sessions:
post:
tags:
- Sessions
summary: Create Session
description: '### Description
Persistent sessions owned by an account. `state` is an opaque, caller-defined JSON blob.'
operationId: POST-V4-/sessions
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SessionRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SessionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
x-source: https://docs.gp.scale.com/reference/v4/sessions/create-session
get:
tags:
- Sessions
summary: List Sessions
description: '### Description
Lists all sessions accessible to the user.
### Details
This API can be used to list sessions. If a user has access to multiple accounts, all sessions from all accounts the user is associated with will be returned.'
operationId: GET-V4-/sessions
parameters:
- name: page
in: query
required: false
schema:
type: integer
minimum: 1
description: Page number for pagination to be returned by the given endpoint. Starts at page 1
default: 1
title: Page
description: Page number for pagination to be returned by the given endpoint. Starts at page 1
- name: limit
in: query
required: false
schema:
type: integer
maximum: 10000
minimum: 1
description: Maximum number of artifacts to be returned by the given endpoint. Defaults to 100 and cannot be greater than 10k.
default: 100
title: Limit
description: Maximum number of artifacts to be returned by the given endpoint. Defaults to 100 and cannot be greater than 10k.
- name: include_archived
in: query
required: false
schema:
type: boolean
default: false
title: Include Archived
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedSessionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
x-source: https://docs.gp.scale.com/reference/v4/sessions/list-sessions
/v4/sessions/{session_id}:
delete:
tags:
- Sessions
summary: Delete Session
description: '### Description
Deletes a session
### Details
This API can be used to delete a session by ID. To use this API, pass in the `id` that was returned from your Create Session API call as a path parameter.'
operationId: DELETE-V4-/sessions/{session_id}
parameters:
- name: session_id
in: path
required: true
schema:
type: string
title: Session Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
x-source: https://docs.gp.scale.com/reference/v4/sessions/delete-session
get:
tags:
- Sessions
summary: Get Session
description: '### Description
Gets the details of a session
### Details
This API can be used to get information about a single session by ID. To use this API, pass in the `id` that was returned from your Create Session API call as a path parameter.
Review the response schema to see the fields that will be returned.'
operationId: GET-V4-/sessions/{session_id}
parameters:
- name: session_id
in: path
required: true
schema:
type: string
title: Session Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SessionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
x-source: https://docs.gp.scale.com/reference/v4/sessions/get-session
patch:
tags:
- Sessions
summary: Update Session
description: '### Description
Updates a session
### Details
This API can be used to update the session that matches the ID that was passed in as a path parameter. To use this API, pass in the `id` that was returned from your Create Session API call as a path parameter.
Review the request schema to see the fields that can be updated.'
operationId: PATCH-V4-/sessions/{session_id}
parameters:
- name: session_id
in: path
required: true
schema:
type: string
title: Session Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RestorablePartialSessionRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SessionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
x-source: https://docs.gp.scale.com/reference/v4/sessions/update-session
components:
schemas:
SessionResponse:
properties:
id:
type: string
title: Id
title:
title: Title
can_patch: true
type: string
start_date:
title: Start Date
description: Start of the session window.
can_patch: true
type: string
format: date-time
end_date:
title: End Date
description: End of the session window.
can_patch: true
type: string
format: date-time
state:
additionalProperties: true
type: object
title: State
description: Opaque, caller-defined session state.
can_patch: true
optional_in_request: true
created_at:
type: string
format: date-time
title: Created At
description: The date and time when the entity was created in ISO format.
archived_at:
title: Archived At
description: The date and time when the entity was archived in ISO format.
type: string
format: date-time
updated_at:
type: string
format: date-time
title: Updated At
description: The date and time when the entity was last updated in ISO format.
created_by_user_id:
type: string
title: Created By User Id
description: The user who originally created the entity.
created_by_identity_type:
$ref: '#/components/schemas/IdentifierTypeEnum'
description: The type of identity that created the entity.
account_id:
type: string
title: Account Id
description: The ID of the account that owns the given entity.
can_patch: false
type: object
required:
- id
- title
- state
- created_at
- updated_at
- created_by_user_id
- created_by_identity_type
- account_id
title: SessionResponse
RestorablePartialSessionRequest:
oneOf:
- $ref: '#/components/schemas/PartialSessionRequest'
- $ref: '#/components/schemas/RestoreRequest'
title: RestorablePartialSessionRequest
discriminator:
propertyName: restore
mapping:
'False': '#/components/schemas/PartialSessionRequest'
'True': '#/components/schemas/RestoreRequest'
PartialSessionRequest:
properties:
title:
title: Title
can_patch: true
type: string
start_date:
title: Start Date
description: Start of the session window.
can_patch: true
type: string
format: date-time
end_date:
title: End Date
description: End of the session window.
can_patch: true
type: string
format: date-time
state:
title: State
description: Opaque, caller-defined session state.
can_patch: true
additionalProperties: true
type: object
restore:
type: boolean
const: false
title: Restore
description: Set to true to restore the entity from the database.
default: false
additionalProperties: false
type: object
title: PartialSessionRequest
RestoreRequest:
properties:
restore:
type: boolean
const: true
title: Restore
description: Set to true to restore the entity from the database.
additionalProperties: false
type: object
required:
- restore
title: RestoreRequest
PaginatedSessionResponse:
properties:
items:
items:
$ref: '#/components/schemas/SessionResponse'
type: array
title: Items
description: The data returned for the current page.
total_item_count:
type: integer
title: Total Item Count
description: The total number of items of the query
current_page:
type: integer
title: Current Page
description: The current page number.
items_per_page:
type: integer
title: Items Per Page
description: The number of items per page.
type: object
required:
- items
- total_item_count
- current_page
- items_per_page
title: PaginatedSessionResponse
IdentifierTypeEnum:
type: string
enum:
- user
- service_account
title: IdentifierTypeEnum
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
DeleteResponse:
properties:
success:
type: boolean
title: Success
count:
type: integer
title: Count
type: object
required:
- success
- count
title: DeleteResponse
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
additionalProperties: true
type: object
required:
- loc
- msg
- type
title: ValidationError
SessionRequest:
properties:
title:
title: Title
can_patch: true
type: string
start_date:
title: Start Date
description: Start of the session window.
can_patch: true
type: string
format: date-time
end_date:
title: End Date
description: End of the session window.
can_patch: true
type: string
format: date-time
state:
title: State
description: Opaque, caller-defined session state.
can_patch: true
additionalProperties: true
type: object
account_id:
type: string
title: Account Id
description: The ID of the account that owns the given entity.
can_patch: false
type: object
required:
- title
- state
- account_id
title: SessionRequest
securitySchemes:
APIKeyHeader:
type: apiKey
in: header
name: x-api-key
x-assembled-from: Per-operation OpenAPI fragments embedded verbatim in docs.gp.scale.com reference pages; source spec https://api.sgp.scale.com/openapi-versions/v4/openapi.json (404 when assembled)