Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Configura el uso del servicio para un entorno de desarrollo
En esta página se describe cómo configurar tu entorno de desarrollo para usar la API de Service Usage.
Para la mayoría de los casos prácticos operativos, la forma más sencilla de habilitar e inhabilitar los servicios es usar la consola de Google Cloud .
Si necesitas crear secuencias de comandos, puedes usar Google Cloud CLI.
Si quieres programar soluciones basadas en la API de Service Usage, usa una de las bibliotecas cliente.
Para experimentar con la API, puedes seguir las instrucciones alternativas de configuración que aparecen en esta guía y usar el comando curl para probar la API sin configurar un entorno completo de desarrollo de aplicaciones.
Configura el entorno para realizar llamadas directas a la API
En esta sección se describen los pasos básicos necesarios para configurar su entorno local a fin de experimentar con la API de Service Usage mediante el comando curl. Está dirigida a desarrolladores que necesiten programar en la API de Service Usage.
Habilita la API de Service Usage
Para usar la API de Service Usage, primero debes habilitarla en el proyecto deGoogle Cloud en el que quieras usarla:
Sigue las instrucciones de Cómo mostrar una lista de servicios para enumerar las APIs y los servicios que están habilitados o disponibles en tus proyectos de Google Cloud .
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[],[],null,["# Quickstart: Set up Service Usage for a development environment\n\nSet up Service Usage for a development environment\n==================================================\n\nThis page describes how to set up your development environment to use the\nService Usage API.\n\n- For most operational use cases, the simplest way to enable and disable services is to use Google Cloud console.\n- If you need to create scripts, you can use the Google Cloud CLI.\n- If you need to program against the Service Usage API, use one of the [client libraries](/service-usage/docs/libraries).\n- To experiment with the API, you can follow the alternative setup instructions in this guide and use the `curl` command to test the API without setting up a full application development environment.\n\nSet up to call the API directly\n-------------------------------\n\nThis section describes the basic steps necessary to set up your local\nenvironment to experiment with the Service Usage API using the\n`curl` command. It is aimed at developers who need to program against the\nService Usage API.\n| **Note:** You don't need to complete the instructions in this section if you want to list, enable, or disable services using Google Cloud console or the `gcloud` command line interface.\n\n### Enable the Service Usage API\n\nTo use the Service Usage API, you must first enable it in the\nGoogle Cloud project you want to use it for:\n\n1. Go to the Google Cloud console **API Library** page. \n [Go to the API Library page](https://console.cloud.google.com/project/_/apis/library/serviceusage.googleapis.com)\n2. Select the Google Cloud project that you want to use to access the service.\n3. On the API Library page, click **Enable**.\n4. Ensure that your user account has the [Service Usage Admin](https://cloud.google.com/iam/docs/understanding-roles#service-usage-roles) role.\n\n### Test with curl\n\n1. Define a convenient shell alias for calling Google REST APIs:\n\n alias gcurl='curl -H \"Authorization: Bearer $(gcloud auth print-access-token)\" -H \"Content-Type: application/json\"'\n\n2. Set an environment variable `PROJECT_ID` with the identifier of your\n project. This can be the project id or number:\n\n PROJECT_ID=\"my-project-id\"\n\n3. Ensure that you are logged into 'gcloud':\n\n gcloud auth login\n\n4. List the enabled APIs and services in this project:\n\n gcurl \"https://serviceusage.googleapis.com/v1/projects/${PROJECT_ID}/services?filter=state:ENABLED&fields=services.config.title,services.config.name\"\n\n If you see output like this, then your setup is successful: \n\n {\n \"services\": [\n {\n \"config\": {\n \"name\": \"bigquery.googleapis.com\",\n \"title\": \"BigQuery API\"\n }\n },\n {\n \"config\": {\n \"name\": \"bigquerystorage.googleapis.com\",\n \"title\": \"BigQuery Storage API\"\n }\n },\n ...\n\nNext steps\n----------\n\nFollow [Listing Services](/service-usage/docs/list-services) to list the APIs\nand services that are enabled or available in your Google Cloud projects."]]