Set LLM Provider Active Status

Toggles a Large Language Model (LLM) provider active status

Before You Begin

🔗 Use the GraphQL Playground to execute the mutations 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. Provider ID: The ID of an existing LLM Provider. You can retrieve it from the llmProvidersByOrganization query.

Step 1: Execute the Mutation

This mutation enables or disables an existing LLM provider.

Activating a provider

mutation {
  setLlmProviderActiveStatus(
    input: {
      providerId: "27"
      active: true
    }
  ) {
    success
  }
}

Deactivating a provider

mutation {
  setLlmProviderActiveStatus(
    input: {
      providerId: "27"
      active: false
    }
  ) {
    success
  }
}

Arguments

  • providerId (ID, required): The ID of the LLM provider whose status you want to change.
  • active (Boolean, required): Pass true to activate the provider or false to deactivate it.

Response Fields

  • success (Boolean): Returns true when the active status was updated successfully, false otherwise.

Example Response

{
  "data": {
    "setLlmProviderActiveStatus": {
      "success": true
    }
  }
}

Additional Notes

  • If the providerId is invalid or does not belong to the current organization, an error will be returned.
  • If the mutation fails due to insufficient permissions, an authorization error will be raised.
  • Deactivating a provider does not delete it; it can be re-activated at any time by calling this mutation with active: true.

This mutation provides a quick way to enable or disable an LLM provider without deleting its configuration.