Using multiple projects

In some cases, you might need to create multiple Google Cloud projects to use Dialogflow:

  • You might find it useful to create one project for authentication, quotas, and billing, and additional projects for agent data.
  • Each project can have at most one agent per region. If you need multiple agents in the same region, then multiple projects are required.

Consumer and resource projects

When you make calls to the API, you typically provide service account keys for authentication. Each service account is owned by a specific project, but service accounts might be provided roles to access resources for other projects. The project associated with the service account you provide for an API call is referred to as the consumer project.

When you make calls to the API, your request specifies the agent's project. This project is referred to as the resource project.

For example, in the following REST curl request, the project associated with AGENT_ID is the resource project, and the project associated with the service account used to generate TOKEN is the consumer project:

curl -X GET
    -H "Authorization: Bearer TOKEN"
    "https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/agent/AGENT_ID"

One project can play the role of both consumer and resource project. Agent data, charges, and quotas are associated only with this project.

When consumer and resource projects are two different projects, charges, quota constraints, agent information, and a requirement to enable the API are applicable to either or both projects. The following table shows the association for an API call with two projects:

Description Consumer project (service account project) Resource project (agent project) Notes
Project that charges are incurred for
Project that is bound to quotas
Project that contains the agent that determines the Trial or Essentials Dialogflow edition If your consumer project doesn't have an agent, create an empty agent to upgrade to the Essentials edition.
Project that contains all agent data and the Trial or Essentials Dialogflow edition
Projects for which you must enable the Dialogflow API The Dialogflow API must be enabled for both project types.
Project that shows API usage on the Cloud console API dashboard