Colab API

The Colab API lets you programmatically manage Colab runtimes.

The API is currently in beta and available on an allowlist basis. If you're interested in integrating with us, please share your use cases with colaboratory-team@google.com to request access. We look forward to working with you!

Service: colaboratory.googleapis.com

To call this service, we recommend that you use the Google-provided client libraries. If your application needs to use your own libraries to call this service, use the following information when you make the API requests.

Discovery document

A Discovery Document is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery documents:

Discovery document can also be retrieved in OpenAPI V3.0 format. This service provides the following OpenAPI v3 discovery documents:

Service endpoint

A service endpoint is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:

  • https://colaboratory.googleapis.com

REST Resource: v1beta

Methods
getSubscription GET /v1beta/{name=subscription}
Gets the subscription of the requesting user.

REST Resource: v1beta.runtimes

Methods
create POST /v1beta/runtimes
Creates a Colab runtime assignment.
delete DELETE /v1beta/{name=runtimes/*}
Deletes a Colab runtime assignment.
get GET /v1beta/{name=runtimes/*}
Gets a Colab runtime assigned to the requesting user.
list GET /v1beta/runtimes
Lists Colab runtimes assigned to the requesting user.

REST Resource: v1beta.runtimespecs

Methods
list GET /v1beta/runtimespecs
Lists available Colab runtime specs and their eligibility to the requesting user.

REST Resource: v1.operations

Methods
get GET /v1/{name=operations/**}
Gets the latest state of a long-running operation.
list GET /v1/operations
Lists operations that match the specified filter in the request.
wait GET /v1/{name=operations/*}:wait
Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state.