Firebase ML API
Access custom machine learning models hosted via Firebase ML
COMMUNITYBEARER0 INSTALLS
OpenAPI Specificationv3.0
{
"openapi": "3.0.0",
"servers": [
{
"url": "https://firebaseml.googleapis.com/"
}
],
"info": {
"contact": {
"name": "Google",
"url": "https://google.com",
"x-twitter": "youtube"
},
"description": "Access custom machine learning models hosted via Firebase ML.",
"license": {
"name": "Creative Commons Attribution 3.0",
"url": "http://creativecommons.org/licenses/by/3.0/"
},
"termsOfService": "https://developers.google.com/terms/",
"title": "Firebase ML API",
"version": "v1beta2",
"x-apiClientRegistration": {
"url": "https://console.developers.google.com"
},
"x-apisguru-categories": [
"analytics",
"media"
],
"x-logo": {
"url": "https://api.apis.guru/v2/cache/logo/https_www.google.com_images_branding_googlelogo_2x_googlelogo_color_272x92dp.png"
},
"x-origin": [
{
"format": "google",
"url": "https://firebaseml.googleapis.com/$discovery/rest?version=v1beta2",
"version": "v1"
}
],
"x-preferred": true,
"x-providerName": "googleapis.com",
"x-serviceName": "firebaseml"
},
"externalDocs": {
"url": "https://firebase.google.com"
},
"tags": [
{
"name": "projects"
}
],
"paths": {
"/v1beta2/{name}": {
"delete": {
"description": "Deletes a model",
"operationId": "firebaseml.projects.models.delete",
"parameters": [
{
"description": "Required. The name of the model to delete. The name must have the form `projects/{project_id}/models/{model_id}`",
"in": "path",
"name": "name",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Empty"
}
}
},
"description": "Successful response"
}
},
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/cloud-platform"
],
"Oauth2c": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
],
"tags": [
"projects"
]
},
"get": {
"description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
"operationId": "firebaseml.projects.operations.get",
"parameters": [
{
"description": "The name of the operation resource.",
"in": "path",
"name": "name",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Operation"
}
}
},
"description": "Successful response"
}
},
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/cloud-platform"
],
"Oauth2c": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
],
"tags": [
"projects"
]
},
"parameters": [
{
"$ref": "#/components/parameters/_.xgafv"
},
{
"$ref": "#/components/parameters/access_token"
},
{
"$ref": "#/components/parameters/alt"
},
{
"$ref": "#/components/parameters/callback"
},
{
"$ref": "#/components/parameters/fields"
},
{
"$ref": "#/components/parameters/key"
},
{
"$ref": "#/components/parameters/oauth_token"
},
{
"$ref": "#/components/parameters/prettyPrint"
},
{
"$ref": "#/components/parameters/quotaUser"
},
{
"$ref": "#/components/parameters/upload_protocol"
},
{
"$ref": "#/components/parameters/uploadType"
}
],
"patch": {
"description": "Updates a model. The longrunning operation will eventually return a Model.",
"operationId": "firebaseml.projects.models.patch",
"parameters": [
{
"description": "The resource name of the Model. Model names have the form `projects/{project_id}/models/{model_id}` The name is ignored when creating a model.",
"in": "path",
"name": "name",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "The update mask",
"in": "query",
"name": "updateMask",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Model"
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Operation"
}
}
},
"description": "Successful response"
}
},
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/cloud-platform"
],
"Oauth2c": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
],
"tags": [
"projects"
]
}
},
"/v1beta2/{name}:download": {
"get": {
"description": "Gets Download information for a model. This is meant for downloading model resources onto devices. It gives very limited information about the model.",
"operationId": "firebaseml.projects.models.download",
"parameters": [
{
"description": "Required. The name of the model to download. The name must have the form `projects/{project}/models/{model}`",
"in": "path",
"name": "name",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DownloadModelResponse"
}
}
},
"description": "Successful response"
}
},
"tags": [
"projects"
]
},
"parameters": [
{
"$ref": "#/components/parameters/_.xgafv"
},
{
"$ref": "#/components/parameters/access_token"
},
{
"$ref": "#/components/parameters/alt"
},
{
"$ref": "#/components/parameters/callback"
},
{
"$ref": "#/components/parameters/fields"
},
{
"$ref": "#/components/parameters/key"
},
{
"$ref": "#/components/parameters/oauth_token"
},
{
"$ref": "#/components/parameters/prettyPrint"
},
{
"$ref": "#/components/parameters/quotaUser"
},
{
"$ref": "#/components/parameters/upload_protocol"
},
{
"$ref": "#/components/parameters/uploadType"
}
]
},
"/v1beta2/{parent}/models": {
"get": {
"description": "Lists the models",
"operationId": "firebaseml.projects.models.list",
"parameters": [
{
"description": "Required. The name of the parent to list models for. The parent must have the form `projects/{project_id}'",
"in": "path",
"name": "parent",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "A filter for the list e.g. 'tags: abc' to list models which are tagged with \"abc\"",
"in": "query",
"name": "filter",
"schema": {
"type": "string"
}
},
{
"description": "The maximum number of items to return",
"in": "query",
"name": "pageSize",
"schema": {
"type": "integer"
}
},
{
"description": "The next_page_token value returned from a previous List request, if any.",
"in": "query",
"name": "pageToken",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListModelsResponse"
}
}
},
"description": "Successful response"
}
},
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/cloud-platform"
],
"Oauth2c": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
],
"tags": [
"projects"
]
},
"parameters": [
{
"$ref": "#/components/parameters/_.xgafv"
},
{
"$ref": "#/components/parameters/access_token"
},
{
"$ref": "#/components/parameters/alt"
},
{
"$ref": "#/components/parameters/callback"
},
{
"$ref": "#/components/parameters/fields"
},
{
"$ref": "#/components/parameters/key"
},
{
"$ref": "#/components/parameters/oauth_token"
},
{
"$ref": "#/components/parameters/prettyPrint"
},
{
"$ref": "#/components/parameters/quotaUser"
},
{
"$ref": "#/components/parameters/upload_protocol"
},
{
"$ref": "#/components/parameters/uploadType"
}
],
"post": {
"description": "Creates a model in Firebase ML. The longrunning operation will eventually return a Model",
"operationId": "firebaseml.projects.models.create",
"parameters": [
{
"description": "Required. The parent project resource where the model is to be created. The parent must have the form `projects/{project_id}`",
"in": "path",
"name": "parent",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Model"
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Operation"
}
}
},
"description": "Successful response"
}
},
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/cloud-platform"
],
"Oauth2c": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
],
"tags": [
"projects"
]
}
}
},
"components": {
"parameters": {
"_.xgafv": {
"description": "V1 error format.",
"in": "query",
"name": "$.xgafv",
"schema": {
"enum": [
"1",
"2"
],
"type": "string"
}
},
"access_token": {
"description": "OAuth access token.",
"in": "query",
"name": "access_token",
"schema": {
"type": "string"
}
},
"alt": {
"description": "Data format for response.",
"in": "query",
"name": "alt",
"schema": {
"enum": [
"json",
"media",
"proto"
],
"type": "string"
}
},
"callback": {
"description": "JSONP",
"in": "query",
"name": "callback",
"schema": {
"type": "string"
}
},
"fields": {
"description": "Selector specifying which fields to include in a partial response.",
"in": "query",
"name": "fields",
"schema": {
"type": "string"
}
},
"key": {
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"in": "query",
"name": "key",
"schema": {
"type": "string"
}
},
"oauth_token": {
"description": "OAuth 2.0 token for the current user.",
"in": "query",
"name": "oauth_token",
"schema": {
"type": "string"
}
},
"prettyPrint": {
"description": "Returns response with indentations and line breaks.",
"in": "query",
"name": "prettyPrint",
"schema": {
"type": "boolean"
}
},
"quotaUser": {
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"in": "query",
"name": "quotaUser",
"schema": {
"type": "string"
}
},
"uploadType": {
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"in": "query",
"name": "uploadType",
"schema": {
"type": "string"
}
},
"upload_protocol": {
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"in": "query",
"name": "upload_protocol",
"schema": {
"type": "string"
}
}
},
"schemas": {
"DownloadModelResponse": {
"description": "The response for downloading a model to device.",
"properties": {
"downloadUri": {
"description": "Output only. A download URI for the model/zip file.",
"readOnly": true,
"type": "string"
},
"expireTime": {
"description": "Output only. The time that the download URI link expires. If the link has expired, the REST call must be repeated.",
"format": "google-datetime",
"readOnly": true,
"type": "string"
},
"modelFormat": {
"description": "Output only. The format of the model being downloaded.",
"enum": [
"MODEL_FORMAT_UNSPECIFIED",
"TFLITE"
],
"readOnly": true,
"type": "string"
},
"sizeBytes": {
"description": "Output only. The size of the file(s), if this information is available.",
"format": "int64",
"readOnly": true,
"type": "string"
}
},
"type": "object"
},
"Empty": {
"description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }",
"properties": {},
"type": "object"
},
"ListModelsResponse": {
"description": "The response for list models",
"properties": {
"models": {
"description": "The list of models",
"items": {
"$ref": "#/components/schemas/Model"
},
"type": "array"
},
"nextPageToken": {
"description": "Token to retrieve the next page of results, or empty if there are no more results in the list.",
"type": "string"
}
},
"type": "object"
},
"Model": {
"description": "An ML model hosted in Firebase ML",
"properties": {
"activeOperations": {
"description": "Output only. Lists operation ids associated with this model whose status is NOT done.",
"items": {
"$ref": "#/components/schemas/Operation"
},
"readOnly": true,
"type": "array"
},
"createTime": {
"description": "Output only. Timestamp when this model was created in Firebase ML.",
"format": "google-datetime",
"readOnly": true,
"type": "string"
},
"displayName": {
"description": "Required. The name of the model to create. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores(_) and ASCII digits 0-9. It must start with a letter.",
"type": "string"
},
"etag": {
"description": "Output only. See RFC7232 https://tools.ietf.org/html/rfc7232#section-2.3",
"readOnly": true,
"type": "string"
},
"modelHash": {
"description": "Output only. The model_hash will change if a new file is available for download.",
"readOnly": true,
"type": "string"
},
"name": {
"description": "The resource name of the Model. Model names have the form `projects/{project_id}/models/{model_id}` The name is ignored when creating a model.",
"type": "string"
},
"state": {
"$ref": "#/components/schemas/ModelState",
"description": "State common to all model types. Includes publishing and validation information."
},
"tags": {
"description": "User defined tags which can be used to group/filter models during listing",
"items": {
"type": "string"
},
"type": "array"
},
"tfliteModel": {
"$ref": "#/components/schemas/TfLiteModel",
"description": "A TFLite Model"
},
"updateTime": {
"description": "Output only. Timestamp when this model was updated in Firebase ML.",
"format": "google-datetime",
"readOnly": true,
"type": "string"
}
},
"type": "object"
},
"ModelOperationMetadata": {
"description": "This is returned in the longrunning operations for create/update.",
"properties": {
"basicOperationStatus": {
"enum": [
"BASIC_OPERATION_STATUS_UNSPECIFIED",
"BASIC_OPERATION_STATUS_UPLOADING",
"BASIC_OPERATION_STATUS_VERIFYING"
],
"type": "string"
},
"name": {
"description": "The name of the model we are creating/updating The name must have the form `projects/{project_id}/models/{model_id}`",
"type": "string"
}
},
"type": "object"
},
"ModelState": {
"description": "State common to all model types. Includes publishing and validation information.",
"properties": {
"published": {
"description": "Indicates if this model has been published.",
"type": "boolean"
},
"validationError": {
"$ref": "#/components/schemas/Status",
"description": "Output only. Indicates the latest validation error on the model if any. A model may have validation errors if there were problems during the model creation/update. e.g. in the case of a TfLiteModel, if a tflite model file was missing or in the wrong format. This field will be empty for valid models.",
"readOnly": true
}
},
"type": "object"
},
"Operation": {
"description": "This resource represents a long-running operation that is the result of a network API call.",
"properties": {
"done": {
"description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.",
"type": "boolean"
},
"error": {
"$ref": "#/components/schemas/Status",
"description": "The error result of the operation in case of failure or cancellation."
},
"metadata": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.",
"type": "object"
},
"name": {
"description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.",
"type": "string"
},
"response": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.",
"type": "object"
}
},
"type": "object"
},
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
"properties": {
"code": {
"description": "The status code, which should be an enum value of google.rpc.Code.",
"format": "int32",
"type": "integer"
},
"details": {
"description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
"items": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"type": "object"
},
"type": "array"
},
"message": {
"description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
"type": "string"
}
},
"type": "object"
},
"TfLiteModel": {
"description": "Information that is specific to TfLite models.",
"properties": {
"automlModel": {
"description": "The AutoML model id referencing a model you created with the AutoML API. The name should have format 'projects//locations//models/' (This is the model resource name returned from the AutoML API)",
"type": "string"
},
"gcsTfliteUri": {
"description": "The TfLite file containing the model. (Stored in Google Cloud). The gcs_tflite_uri should have form: gs://some-bucket/some-model.tflite Note: If you update the file in the original location, it is necessary to call UpdateModel for ML to pick up and validate the updated file.",
"type": "string"
},
"sizeBytes": {
"description": "Output only. The size of the TFLite model",
"readOnly": true,
"type": "string"
}
},
"type": "object"
}
},
"securitySchemes": {
"Oauth2": {
"description": "Oauth 2.0 implicit authentication",
"flows": {
"implicit": {
"authorizationUrl": "https://accounts.google.com/o/oauth2/auth",
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account."
}
}
},
"type": "oauth2"
},
"Oauth2c": {
"description": "Oauth 2.0 authorizationCode authentication",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://accounts.google.com/o/oauth2/auth",
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account."
},
"tokenUrl": "https://accounts.google.com/o/oauth2/token"
}
},
"type": "oauth2"
}
}
}
}