{
  "servers": [
    {
      "description": "Global Endpoint",
      "url": "https://colaboratory.googleapis.com"
    }
  ],
  "info": {
    "version": "v1beta",
    "description": "The Colab API lets you programmatically manage Colab runtimes.",
    "x-google-revision": "20261122",
    "title": "Colab API"
  },
  "openapi": "3.0.3",
  "externalDocs": {
    "description": "Find more info here.",
    "url": "https://developers.google.com/colab/api/reference/rest"
  },
  "paths": {
    "/v1beta/subscription": {
      "get": {
        "parameters": [],
        "tags": [
          "colaboratory"
        ],
        "security": [
          {
            "google_oauth_implicit": [
              "https://www.googleapis.com/auth/colaboratory",
              "https://www.googleapis.com/auth/colaboratory.readonly"
            ]
          },
          {
            "google_oauth_code": [
              "https://www.googleapis.com/auth/colaboratory",
              "https://www.googleapis.com/auth/colaboratory.readonly"
            ]
          },
          {
            "bearer_auth": []
          }
        ],
        "operationId": "GetSubscription",
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          }
        },
        "description": "Gets the subscription of the requesting user."
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/alt"
        },
        {
          "$ref": "#/components/parameters/callback"
        },
        {
          "$ref": "#/components/parameters/prettyPrint"
        },
        {
          "$ref": "#/components/parameters/_.xgafv"
        }
      ]
    },
    "/v1beta/runtimes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/alt"
        },
        {
          "$ref": "#/components/parameters/callback"
        },
        {
          "$ref": "#/components/parameters/prettyPrint"
        },
        {
          "$ref": "#/components/parameters/_.xgafv"
        }
      ],
      "get": {
        "security": [
          {
            "google_oauth_implicit": [
              "https://www.googleapis.com/auth/colaboratory",
              "https://www.googleapis.com/auth/colaboratory.readonly"
            ]
          },
          {
            "google_oauth_code": [
              "https://www.googleapis.com/auth/colaboratory",
              "https://www.googleapis.com/auth/colaboratory.readonly"
            ]
          },
          {
            "bearer_auth": []
          }
        ],
        "parameters": [],
        "tags": [
          "colaboratory"
        ],
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRuntimesResponse"
                }
              }
            },
            "description": "Successful operation"
          }
        },
        "operationId": "ListRuntimes",
        "description": "Lists Colab runtimes assigned to the requesting user."
      },
      "post": {
        "operationId": "CreateRuntime",
        "x-google-lro": "true",
        "description": "Creates a Colab runtime assignment.\n\nWhen runtime creation is refused with a [`FAILED_PRECONDITION` (code:\n9)](https://github.com/googleapis/googleapis/blob/437254f595a380cd9323111700ce0fcf9d6d2c21/google/rpc/code.proto#L128)\nerror, a more specific error reason will be returned in the\ndetails of the Operation\nerror wrapped in\ngoogle.rpc.ErrorInfo.\n\nA requests-per-minute-per-project and a requests-per-minute-per-user quota\nare enforced on this API. To see the exact limit your project is subject\nto, after you enable the Colab API, view it in your project's [Quotas &\nSystem\nLimits](https://console.cloud.google.com/apis/api/colaboratory.googleapis.com/quotas)\npage. Note that there is no usage reporting on the per-user limit and it is\nnot overridable at the individual user level.",
        "security": [
          {
            "google_oauth_implicit": [
              "https://www.googleapis.com/auth/colaboratory"
            ]
          },
          {
            "google_oauth_code": [
              "https://www.googleapis.com/auth/colaboratory"
            ]
          },
          {
            "bearer_auth": []
          }
        ],
        "tags": [
          "colaboratory"
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateRuntimeOperation"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "description": "Optional. A unique identifier for this request.\n\nThis request is only idempotent if a `request_id` is provided.\nSee [AIP-155](https://google.aip.dev/155) for more details.\n\nIf provided, the request ID must be in UUID4 format per\nhttps://linter.aip.dev/155/request-id-format.",
            "name": "requestId",
            "in": "query"
          },
          {
            "description": "Optional. A unique identifier for the runtime. If not supplied, a random ID will be\ngenerated. If a runtime with the given ID owned by the requesting user\nalready exists, a completed Operation with\nan [`ALREADY_EXISTS` (code:\n6)](https://github.com/googleapis/googleapis/blob/437254f595a380cd9323111700ce0fcf9d6d2c21/google/rpc/code.proto#L84)\nerror will be returned. See\n[AIP-133](https://google.aip.dev/133#user-specified-ids) for more details.\n\nThe ID must conform to\n[RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034), specifically:\n\n- 1 to 63 characters\n\n- Lower-case letters, digits, and hyphens\n\n- Start with a letter\n\n- End with a letter or digit",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "runtimeId"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Runtime"
              }
            }
          },
          "description": "Required. Specifications for the runtime to assign."
        }
      }
    },
    "/v1beta/runtimespecs": {
      "get": {
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRuntimeSpecsResponse"
                }
              }
            }
          }
        },
        "parameters": [],
        "tags": [
          "colaboratory"
        ],
        "security": [
          {
            "google_oauth_implicit": [
              "https://www.googleapis.com/auth/colaboratory",
              "https://www.googleapis.com/auth/colaboratory.readonly"
            ]
          },
          {
            "google_oauth_code": [
              "https://www.googleapis.com/auth/colaboratory",
              "https://www.googleapis.com/auth/colaboratory.readonly"
            ]
          },
          {
            "bearer_auth": []
          }
        ],
        "description": "Lists available Colab runtime specs and their eligibility to the requesting\nuser.",
        "operationId": "ListRuntimeSpecs"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/alt"
        },
        {
          "$ref": "#/components/parameters/callback"
        },
        {
          "$ref": "#/components/parameters/prettyPrint"
        },
        {
          "$ref": "#/components/parameters/_.xgafv"
        }
      ]
    },
    "/v1beta/runtimes/{runtime}": {
      "delete": {
        "operationId": "DeleteRuntime",
        "description": "Deletes a Colab runtime assignment.\n\n**Best Practices:**\n\n- Avoid deleting runtimes unless necessary. Reuse runtimes for efficiency.\n\n- Open a new Jupyter session on an existing runtime for state isolation.",
        "responses": {
          "default": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Empty"
                }
              }
            }
          }
        },
        "tags": [
          "colaboratory"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "in": "path",
            "name": "runtime",
            "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122."
          },
          {
            "name": "allowMissing",
            "schema": {
              "type": "boolean"
            },
            "description": "Optional. If set to `true`, and the runtime is not found, the request will succeed\nbut no action will be taken on the server.",
            "in": "query"
          }
        ],
        "security": [
          {
            "google_oauth_implicit": [
              "https://www.googleapis.com/auth/colaboratory"
            ]
          },
          {
            "google_oauth_code": [
              "https://www.googleapis.com/auth/colaboratory"
            ]
          },
          {
            "bearer_auth": []
          }
        ]
      },
      "get": {
        "security": [
          {
            "google_oauth_implicit": [
              "https://www.googleapis.com/auth/colaboratory",
              "https://www.googleapis.com/auth/colaboratory.readonly"
            ]
          },
          {
            "google_oauth_code": [
              "https://www.googleapis.com/auth/colaboratory",
              "https://www.googleapis.com/auth/colaboratory.readonly"
            ]
          },
          {
            "bearer_auth": []
          }
        ],
        "operationId": "GetRuntime",
        "tags": [
          "colaboratory"
        ],
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Runtime"
                }
              }
            },
            "description": "Successful operation"
          }
        },
        "description": "Gets a Colab runtime assigned to the requesting user.",
        "parameters": [
          {
            "description": "Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.",
            "in": "path",
            "name": "runtime",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/alt"
        },
        {
          "$ref": "#/components/parameters/callback"
        },
        {
          "$ref": "#/components/parameters/prettyPrint"
        },
        {
          "$ref": "#/components/parameters/_.xgafv"
        }
      ]
    }
  },
  "components": {
    "securitySchemes": {
      "google_oauth_code": {
        "type": "oauth2",
        "description": "Google Oauth 2.0 authorizationCode authentication flow.",
        "flows": {
          "authorizationCode": {
            "refreshUrl": "https://oauth2.googleapis.com/token",
            "scopes": {
              "https://www.googleapis.com/auth/colaboratory": "Read, write, and delete your Colab resources",
              "https://www.googleapis.com/auth/colaboratory.readonly": "Read-only access to your Colab resources"
            },
            "authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth",
            "tokenUrl": "https://oauth2.googleapis.com/token"
          }
        }
      },
      "google_oauth_implicit": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "scopes": {
              "https://www.googleapis.com/auth/colaboratory": "Read, write, and delete your Colab resources",
              "https://www.googleapis.com/auth/colaboratory.readonly": "Read-only access to your Colab resources"
            },
            "authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth"
          }
        },
        "description": "Google Oauth 2.0 implicit authentication flow."
      },
      "bearer_auth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Http bearer authentication."
      }
    },
    "parameters": {
      "alt": {
        "in": "query",
        "name": "$alt",
        "description": "Data format for response.",
        "schema": {
          "type": "string",
          "x-google-enum-descriptions": [
            "Responses with Content-Type of application/json",
            "Media download with context-dependent Content-Type",
            "Responses with Content-Type of application/x-protobuf"
          ],
          "default": "json",
          "enum": [
            "json",
            "media",
            "proto"
          ]
        }
      },
      "prettyPrint": {
        "description": "Returns response with indentations and line breaks.",
        "in": "query",
        "name": "$prettyPrint",
        "schema": {
          "default": "true",
          "type": "boolean"
        }
      },
      "_.xgafv": {
        "schema": {
          "x-google-enum-descriptions": [
            "v1 error format",
            "v2 error format"
          ],
          "enum": [
            "1",
            "2"
          ],
          "type": "string"
        },
        "in": "query",
        "description": "V1 error format.",
        "name": "$.xgafv"
      },
      "callback": {
        "schema": {
          "type": "string"
        },
        "in": "query",
        "description": "JSONP",
        "name": "$callback"
      }
    },
    "schemas": {
      "SubscriptionTier": {
        "enum": [
          "SUBSCRIPTION_TIER_UNSPECIFIED",
          "SUBSCRIPTION_TIER_FREE",
          "SUBSCRIPTION_TIER_PRO",
          "SUBSCRIPTION_TIER_PRO_PLUS"
        ],
        "type": "string",
        "x-google-enum-descriptions": [
          "Default value. This value is unused.",
          "User is not subscribed to any paid tier.",
          "User is subscribed to Colab Pro.",
          "User is subscribed to Colab Pro+."
        ]
      },
      "BaseOperation": {
        "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should be a resource name ending with `operations/{unique_id}`."
          },
          "error": {
            "description": "The error result of the operation in case of failure or cancellation.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Status"
              }
            ]
          },
          "done": {
            "type": "boolean",
            "description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable."
          }
        },
        "type": "object"
      },
      "CreateRuntimeOperation": {
        "type": "object",
        "description": "This resource represents a long-running operation where metadata and response fields are strongly typed.",
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseOperation"
          },
          {
            "type": "object",
            "properties": {
              "metadata": {
                "$ref": "#/components/schemas/CreateRuntimeMetadata"
              },
              "response": {
                "$ref": "#/components/schemas/Runtime"
              }
            }
          }
        ]
      },
      "ListRuntimesResponse": {
        "properties": {
          "runtimes": {
            "items": {
              "$ref": "#/components/schemas/Runtime"
            },
            "type": "array",
            "description": "The list of runtimes assigned to the requesting user."
          }
        },
        "description": "Response message for `ListRuntimes`.",
        "type": "object"
      },
      "Empty": {
        "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n    service Foo {\n      rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n    }",
        "type": "object"
      },
      "RuntimeSpec": {
        "type": "object",
        "properties": {
          "key": {
            "description": "Required. The key of the runtime spec.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Key"
              }
            ]
          },
          "eligible": {
            "type": "boolean",
            "readOnly": true,
            "description": "Output only. Whether the requesting user is eligible for the runtime spec."
          }
        },
        "required": [
          "key"
        ],
        "description": "A specification of a runtime."
      },
      "Runtime": {
        "required": [
          "runtimeSpec"
        ],
        "properties": {
          "connectionInfo": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ConnectionInfo"
              }
            ],
            "description": "Output only. The connection info used to authenticate to the runtime.",
            "readOnly": true
          },
          "runtimeSpec": {
            "description": "Required. The specification of the runtime.\n\nWhen calling `CreateRuntime`, this field should be set to an eligible\nruntime spec obtained from the ListRuntimeSpecsResponse.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Key"
              }
            ]
          },
          "name": {
            "x-google-identifier": true,
            "type": "string",
            "description": "Identifier. The name of the runtime in the format `runtimes/{runtime_id}`, where\n`runtime_id` is either the value supplied via\nCreateRuntimeRequest.runtime_id or, if none was supplied, a random ID\ngenerated by the backend."
          },
          "version": {
            "description": "Optional. The version of the runtime image.\n\nSee [Colab Runtime Version\nFAQ](https://research.google.com/colaboratory/runtime-version-faq.html) for\nsupported runtime versions. If omitted (empty), the latest runtime image is\nused.",
            "type": "string"
          }
        },
        "type": "object",
        "description": "A Colab managed runtime.\n\nThis is essentially a Jupyter server that runs on Google infrastructure.\nClients should use the connection_info provided to connect to the\nruntime, and leverage the standard Jupyter [REST\nAPI](https://jupyter-server.readthedocs.io/en/stable/developers/rest-api.html)\nand/or [client\nlibrary](https://jupyter-client.readthedocs.io/en/stable/api/jupyter_client.html)\nto interact with the runtime."
      },
      "ErrorInfo": {
        "type": "object",
        "description": "Describes the cause of the error with structured details.\n\nExample of an error when contacting the \"pubsub.googleapis.com\" API when it\nis not enabled:\n\n    { \"reason\": \"API_DISABLED\"\n      \"domain\": \"googleapis.com\"\n      \"metadata\": {\n        \"resource\": \"projects/123\",\n        \"service\": \"pubsub.googleapis.com\"\n      }\n    }\n\nThis response indicates that the pubsub.googleapis.com API is not enabled.\n\nExample of an error that is returned when attempting to create a Spanner\ninstance in a region that is out of stock:\n\n    { \"reason\": \"STOCKOUT\"\n      \"domain\": \"spanner.googleapis.com\",\n      \"metadata\": {\n        \"availableRegions\": \"us-central1,us-east2\"\n      }\n    }",
        "properties": {
          "domain": {
            "type": "string",
            "description": "The logical grouping to which the \"reason\" belongs. The error domain\nis typically the registered service name of the tool or product that\ngenerates the error. Example: \"pubsub.googleapis.com\". If the error is\ngenerated by some common infrastructure, the error domain must be a\nglobally unique value that identifies the infrastructure. For Google API\ninfrastructure, the error domain is \"googleapis.com\"."
          },
          "reason": {
            "type": "string",
            "description": "The reason for the error. This is a constant value that identifies the\nproximate cause of the error. Error reasons are unique within a particular\ndomain of errors. This should be at most 63 characters and match a\nregular expression of `A-Z+[A-Z0-9]`, which represents\nUPPER_SNAKE_CASE."
          },
          "metadata": {
            "type": "object",
            "description": "Additional structured details about this error.\n\nKeys must match a regular expression of `a-z+` but should\nideally be lowerCamelCase. Also, they must be limited to 64 characters in\nlength. When identifying the current value of an exceeded limit, the units\nshould be contained in the key, not the value.  For example, rather than\n`{\"instanceLimit\": \"100/request\"}`, should be returned as,\n`{\"instanceLimitPerRequest\": \"100\"}`, if the client exceeds the number of\ninstances that can be created in a single (batch) request.",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "Subscription": {
        "description": "Colab user subscription information.",
        "properties": {
          "name": {
            "x-google-identifier": true,
            "description": "Identifier. Name of the subscription. This will always be \"subscription\".",
            "type": "string"
          },
          "tier": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SubscriptionTier"
              }
            ],
            "description": "Required. User's Colab subscription tier."
          }
        },
        "type": "object",
        "required": [
          "tier"
        ]
      },
      "ConnectionInfo": {
        "description": "Connection info used to authenticate to the runtime.",
        "type": "object",
        "required": [
          "token",
          "expireTime",
          "url"
        ],
        "properties": {
          "url": {
            "readOnly": true,
            "type": "string",
            "description": "Required. Output only. The authenticated URL that can be used to connect to the runtime."
          },
          "token": {
            "readOnly": true,
            "type": "string",
            "description": "Required. Output only. The runtime proxy token. This is a short-lived credential used to\nauthenticate to the runtime.\n\nClients should set this token as the value of the\n`X-Colab-Runtime-Proxy-Token` HTTP header when connecting to the runtime,\nand call the GetRuntime API to refresh this\ntoken when approaching `expire_time`."
          },
          "expireTime": {
            "type": "string",
            "description": "Required. Output only. The expiration time of the runtime proxy token.",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "Operation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseOperation"
          },
          {
            "type": "object",
            "properties": {
              "metadata": {
                "description": "Service-specific metadata associated with the operation.  It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata.  Any method that returns a\nlong-running operation should document the metadata type, if any.",
                "type": "object",
                "additionalProperties": {
                  "description": "Properties of the object. Contains field @type with type URL."
                }
              },
              "response": {
                "description": "The normal, successful response of the operation.  If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`.  If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource.  For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name.  For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.",
                "additionalProperties": {
                  "description": "Properties of the object. Contains field @type with type URL."
                },
                "type": "object"
              }
            }
          }
        ],
        "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.",
        "type": "object"
      },
      "Status": {
        "properties": {
          "details": {
            "items": {
              "additionalProperties": {
                "description": "Properties of the object. Contains field @type with type URL."
              },
              "type": "object"
            },
            "description": "A list of messages that carry the error details.  There is a common set of\nmessage types for APIs to use.",
            "type": "array"
          },
          "code": {
            "description": "The status code, which should be an enum value of google.rpc.Code.",
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string",
            "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client."
          }
        },
        "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors).",
        "type": "object"
      },
      "Shape": {
        "enum": [
          "SHAPE_UNSPECIFIED",
          "SHAPE_STANDARD",
          "SHAPE_HIGHMEM"
        ],
        "type": "string",
        "x-google-enum-descriptions": [
          "Default value. This value is unused.",
          "Standard shape.",
          "High memory shape."
        ]
      },
      "Variant": {
        "x-google-enum-descriptions": [
          "Default value. This value is unused.",
          "CPU variant.",
          "GPU variant.",
          "TPU variant."
        ],
        "type": "string",
        "enum": [
          "VARIANT_UNSPECIFIED",
          "VARIANT_CPU",
          "VARIANT_GPU",
          "VARIANT_TPU"
        ]
      },
      "ListRuntimeSpecsResponse": {
        "properties": {
          "runtimeSpecs": {
            "description": "The list of runtime specs available to the requesting user.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuntimeSpec"
            }
          }
        },
        "type": "object",
        "description": "Response message for `ListRuntimeSpecs`."
      },
      "Key": {
        "description": "Key fields that uniquely identify a runtime spec.",
        "properties": {
          "variant": {
            "description": "Required. Runtime variant.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Variant"
              }
            ]
          },
          "shape": {
            "description": "Required. Runtime shape.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Shape"
              }
            ]
          },
          "accelerator": {
            "description": "Required. Runtime accelerator model name (e.g., \"T4\", \"L4\", \"A100\").\nFor CPU runtime specs, this field will be \"NONE\".",
            "type": "string"
          }
        },
        "required": [
          "variant",
          "accelerator",
          "shape"
        ],
        "type": "object"
      },
      "CreateRuntimeMetadata": {
        "description": "Metadata for `CreateRuntime` long-running operation.",
        "properties": {
          "runtime": {
            "description": "The runtime resource being created, in the format of\n`runtimes/{runtime_id}`.",
            "type": "string"
          }
        },
        "type": "object"
      }
    }
  }
}
