Check Provider Dependencies

Check which entities (assistants, etc.) are currently using a specific LLM provider configuration.

Before You Begin

🔗 Use the GraphQL Playground to execute the queries in this guide.

➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.

Prerequisites

  1. Authentication: Use a Service Account token.
  2. Permissions: You must have permissions to manage AI providers in the organization.
  3. Organization UUID: The UUID of the organization where the provider exists.
  4. Provider ID: The ID of the provider configuration whose dependencies you want to check.

Step 1: Execute the Query

This query retrieves a paginated list of all owners (like assistants or the organization itself) that are currently configured to use a specific LLM provider. This is useful for identifying all dependencies before modifying or deleting a provider configuration.

query {
  providerDependencies(
    providerId: "27",
    organizationUuid: "org-uuid-example"
  ) {
    edges {
      cursor
      node {
        ownerId
        ownerType
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Arguments

  • providerId (ID, required): The ID of the LLM provider configuration.
  • organizationUuid (String, required): The UUID of the organization.

Response Fields

  • providerDependencies: A connection object containing the list of dependent entities.
    • edges: A list of dependency entries.
      • cursor: A unique identifier for the entry, used for pagination.
      • node: The dependency object itself.
        • ownerId: The ID of the owner entity (e.g., an assistant's ID).
        • ownerType: The type of the owner, which can be ASSISTANT or ORGANIZATION.
    • pageInfo: An object containing pagination details.
      • hasNextPage: true if more dependencies are available.
      • endCursor: The cursor of the last item in the list.

Example Response

{
  "data": {
    "providerDependencies": {
      "edges": [
        {
          "cursor": "b3duZXJJZD1hc3N0XzEyM2FiYw==",
          "node": {
            "ownerId": "asst_123abc",
            "ownerType": "ASSISTANT"
          }
        },
        {
          "cursor": "b3duZXJJZD1hc3N0XzQ1NmRlZg==",
          "node": {
            "ownerId": "asst_456def",
            "ownerType": "ASSISTANT"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "b3duZXJJZD1hc3N0XzQ1NmRlZg=="
      }
    }
  }
}

Additional Notes

  • If the provider has no dependencies, the edges array will be empty.
  • This query is a critical safety check to perform before using the deleteLlmProvider mutation to avoid breaking active services.
  • An error will be returned if the providerId or organizationUuid is invalid, or if you lack the necessary permissions.

This query helps you safely manage your LLM providers by showing you exactly which entities are using them.