List LLM Providers by Organization

Retrieve all Large Language Model (LLM) provider configurations for a given organization.

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, typically granted to super admin roles.
  3. Organization UUID: The UUID of the organization whose providers you want to list.

Step 1: Execute the Query

This query retrieves a list of all LLM provider configurations registered within a specific organization. It supports pagination through a connection.

query {
  llmProvidersByOrganization(organizationUuid: "org-uuid-example") {
    edges {
      cursor
      node {
        id
        name
        configuration
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Arguments

  • organizationUuid (String, required): The UUID of the organization.

Response Fields

  • llmProvidersByOrganization: A connection object containing the list of providers.
    • edges: A list of provider entries.
      • cursor: A unique identifier for the entry, used for pagination.
      • node: The LLM provider object itself.
        • id: The unique ID of the provider configuration.
        • name: The descriptive name of the provider.
        • configuration: The non-sensitive configuration details (e.g., provider name, model).
    • pageInfo: An object containing pagination details.
      • hasNextPage: true if more providers are available.
      • endCursor: The cursor of the last item in the list.

Example Response

{
  "data": {
    "llmProvidersByOrganization": {
      "edges": [
        {
          "cursor": "MQ",
          "node": {
            "id": "27",
            "name": "OpenAI GPT-4o",
            "configuration": {
              "provider": "openai",
              "model_name": "gpt-4o"
            }
          }
        },
        {
          "cursor": "Mg",
          "node": {
            "id": "28",
            "name": "Anthropic Claude 3",
            "configuration": {
              "provider": "anthropic",
              "model_name": "claude-3-opus"
            }
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "Mg"
      }
    }
  }
}

Additional Notes

  • The query will return an error if the organizationUuid is invalid or if you lack the necessary permissions.
  • For security, sensitive information like API keys is not exposed in the configuration object of the response.
  • This query is useful for displaying a list of available providers to a user or for checking existing configurations before creating a new one.

This query provides a secure and comprehensive way to list all registered LLM providers within an organization.