Skip to main content
A scope is one capability a credential may use, such as runs_write to send runs or usage_read to read usage. Every protected route demands a scope, and a credential without it gets 403 scope_denied. This page lists the routes behind each scope and the scopes behind each role, so you can give every key the least it needs. For the reasoning behind these choices, see Scopes and roles.

The nine scopes

Scope names are snake_case strings on the wire, and the same string appears in error messages. GET /healthz, GET /readyz and GET /openapi.json need no credential and no scope.

Scopes by role

Each member of an organization has a role. A console session holds the scopes of its role, and a person can only give a key scopes they hold themselves. What that means in practice:
  • Sending runs needs owner, admin or member.
  • Buying credits and changing auto-recharge needs owner, admin or billing.
  • Creating service-account keys needs owner or admin, because only they hold members_write.
  • A role outside this table grants nothing. Every scoped route answers 403 scope_denied.
See Organizations and roles for what each role is for.

Scopes on an API key

You choose a key’s scopes when you create it. Three rules apply:
  1. At least one scope. An empty list is refused with 400 empty_scopes.
  2. Only scopes you hold. Asking for a scope your own role or key lacks is refused with 403 scope_exceeds_creator, and the message names the scope.
  3. Frozen at creation. A key keeps the scopes it was created with, even if the person who created it later moves to a role with fewer scopes. To narrow a key, create a new one with fewer scopes and revoke the old one.
Duplicate scopes are removed and the list is returned sorted.

Suggested sets

The console’s API keys page offers the first three as presets (Send requests, Read only, Manage keys) plus Custom.

Create a key with two scopes

When a scope is missing

A credential that authenticates but lacks the route’s scope gets a 403. The message names the missing scope in its wire form:
Retrying does not help. Use a key that holds the scope, or create one; a key’s scopes cannot be edited.