Set theENDPOINTS_GAE_SDKenvironment variable to the path of your
App Engine SDK folder:Path_to_Cloud_SDK/platform/google_appengine.
ReplacePath_to_Cloud_SDKwith the output of the
following command:
gcloudinfo--format="value(installation.sdk_root)"
Run the following command in the API main directory:
gcloudappdeploy
Wait a few moments for the deployment to succeed, ignoring the warning
messages. When the deployment completes, a message similar to the
following displays:
File upload done.
Updating service [default]...done.
Confirm successful deployment by sending a test request to the API, for
example:
For information on how to do API versioning, and how to deploy to versions,
seeHandling API versioning
Testing an API locally
You can use the App Engine local development server to test your API
locally. For more information about the local development server, seeUsing the local development server.
To run your API locally:
From the root directory of the project, start the App Engine
development server:
For your API to be managed by Endpoints Frameworks, you must generate
and deploy an OpenAPI document that describes your API, as described inAdding API management.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis guide details the process of deploying an API, which includes setting up the environment, creating the API and web server, and then deploying to production.\u003c/p\u003e\n"],["\u003cp\u003eTo deploy to production, you must set the \u003ccode\u003eENDPOINTS_GAE_SDK\u003c/code\u003e environment variable and use the \u003ccode\u003egcloud app deploy\u003c/code\u003e command, then confirm deployment by making a test request.\u003c/p\u003e\n"],["\u003cp\u003eAPIs can be tested locally using the App Engine development server, started via \u003ccode\u003edev_appserver.py YOUR_PROJECT_DIR\u003c/code\u003e, followed by sending a test \u003ccode\u003ecurl\u003c/code\u003e request.\u003c/p\u003e\n"],["\u003cp\u003eEndpoints Frameworks offers API management features, such as monitoring, logging, quotas, and a developer portal, which are enabled by deploying an OpenAPI document.\u003c/p\u003e\n"],["\u003cp\u003eVersioning can be done by referring to the "Handling API versioning" page.\u003c/p\u003e\n"]]],[],null,["# Deploying and testing an API\n\nThis page describes how to deploy your API.\n\nBefore you begin\n----------------\n\n- [Set up your programming environment and download tools](/endpoints/docs/frameworks/python/get-started-frameworks-python#before-you-begin).\n- [Create your API](/endpoints/docs/frameworks/python/create_api).\n- [Create a web server](/endpoints/docs/frameworks/python/api_server) to serve your API.\n\nDeploying your API to production\n--------------------------------\n\nTo deploy an API:\n\n1. Set the `ENDPOINTS_GAE_SDK` environment variable to the path of your\n App Engine SDK folder:\n \u003cvar translate=\"no\"\u003ePath_to_Cloud_SDK\u003c/var\u003e`/platform/google_appengine`.\n\n Replace \u003cvar translate=\"no\"\u003ePath_to_Cloud_SDK\u003c/var\u003e with the output of the\n following command: \n\n gcloud info --format=\"value(installation.sdk_root)\"\n\n2. Run the following command in the API main directory:\n\n gcloud app deploy\n\n Wait a few moments for the deployment to succeed, ignoring the warning\n messages. When the deployment completes, a message similar to the\n following displays: \n\n ```\n File upload done.\n Updating service [default]...done.\n ```\n3. Confirm successful deployment by sending a test request to the API, for\n example:\n\n ```\n curl --request POST \\\n --header \"Content-Type: application/json\" \\\n --data '{\"content\":\"echo\"}' \\\n https://PROJECT_ID.appspot.com/_ah/api/echo/v1/echo?n=2\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with your project ID and\n `echo` with your API name.\n\n The results are: \n\n ```\n {\n \"content\": \"echo echo\"\n }\n ```\n\nIf you didn't get a successful response, see\n[Troubleshooting response errors](/endpoints/docs/frameworks/troubleshoot-response-errors).\n\nDeploying to multiple app versions\n----------------------------------\n\nFor information on how to do API versioning, and how to deploy to versions,\nsee [Handling API versioning](/endpoints/docs/frameworks/python/handling-api-versioning)\n\nTesting an API locally\n----------------------\n\nYou can use the App Engine local development server to test your API\nlocally. For more information about the local development server, see\n[Using the local development server](/appengine/docs/standard/python/tools/using-local-server).\n\nTo run your API locally:\n\n1. From the root directory of the project, start the App Engine\n development server:\n\n ```\n dev_appserver.py YOUR_PROJECT_DIR\n ```\n2. Run `curl` to make an API request, for example:\n\n curl --request POST \\\n --header \"Content-Type: application/json\" \\\n --data '{\"message\":\"echo\"}' \\\n \"${HOST}/_ah/api/echo/v1/echo?n=2\"\n\nAdding API management\n---------------------\n\nEndpoints Frameworks provides API management features such as:\n\n- [Monitoring](/endpoints/docs/frameworks/monitoring-your-api)\n- [Logging](/endpoints/docs/frameworks/monitoring-your-api#logs)\n- [Quotas](/endpoints/docs/openapi/quotas-overview)\n- [Developer portal](/endpoints/docs/openapi/dev-portal-overview)\n\nFor your API to be managed by Endpoints Frameworks, you must generate\nand deploy an OpenAPI document that describes your API, as described in\n[Adding API management](/endpoints/docs/frameworks/python/adding-api-management)."]]