{"command":{"effect":"write","timeoutSeconds":120,"inputSchema":{"type":"object","description":"Updates the scopes and/or expiration of an existing API key in the project, including a\nservice-account-owned key. Requires permission to write project API keys.\n\nProvide at least one of `scopes` or `expires_in_seconds`. Omitted fields stay\nunchanged; neither field accepts `null`. Both changes are saved together.\n\n`scopes` replaces the key's scope restrictions using the same scope identifiers\nas the dashboard. An empty array means All permissions, subject to the owner's\neffective access; it does not mean no access. Use `[\"api.all.read\"]` for read-only\naccess or specific scopes such as `[\"api.files.read\"]` for restricted access.\nThis does not change user or service-account roles or grant admin permissions.\nScope changes follow the same authentication-cache propagation as dashboard edits.\n\nProvide `expires_in_seconds` to set the expiration relative to this request.\nThe value must satisfy the organization's and project's expiry policies.\nExpired keys cannot be updated. Retrying resets the expiration relative to\nthe new request. The response contains only the redacted key, not its secret.\n","properties":{"path":{"type":"object","properties":{"project_id":{"type":"string","description":"The ID of the project."},"api_key_id":{"type":"string","description":"The ID of the API key."}},"required":["project_id","api_key_id"],"additionalProperties":false},"body":{"$ref":"#/definitions/UpdateProjectApiKeyBody","examples":[{"scopes":["api.all.read"]}]}},"required":["path","body"],"additionalProperties":false,"definitions":{"UpdateProjectApiKeyBody":{"anyOf":[{"required":["scopes"]},{"required":["expires_in_seconds"]}],"properties":{"expires_in_seconds":{"type":"integer","maximum":31536000,"minimum":1,"description":"Number of seconds from this request until the API key expires. Must comply with the organization and project expiry policies. Expired keys cannot be updated. Retrying resets the expiry relative to the new request. Omit to keep the current expiration."},"scopes":{"items":{"type":"string"},"type":"array","description":"Replace the API key scope restrictions. Omit to leave scopes unchanged. An empty array removes key restrictions (All permissions), subject to the owner's effective permissions. Use [\"api.all.read\"] for read-only access. Scopes do not change the owner's roles or grant administrative permissions."}},"type":"object","required":[]}}},"name":"Update project API key","id":"openai.update-project-api-key","example":{"path":{"project_id":"example","api_key_id":"example"},"body":{"scopes":[]}},"maxRequests":1,"summary":false}}