Pinecone TypeScript SDK - v8.2.0
    Preparing search index...

    Class AdminClient

    The AdminClient class is the entrypoint for the Pinecone Admin API, which manages an organization and its resources: projects, API keys, users and invites, service accounts, and role bindings.

    Unlike the Pinecone client (which authenticates with a project API key), the Admin API authenticates with a service account using the OAuth2 client-credentials flow. You must supply a clientId and clientSecret, either directly or via the PINECONE_CLIENT_ID / PINECONE_CLIENT_SECRET environment variables. Create a service account and its credentials in the Pinecone console under Organization Settings → Service Accounts.

    The bearer token is fetched lazily on the first admin request and cached for the lifetime of the AdminClient, mirroring the Python and Go SDKs. It is not proactively refreshed, so a client kept alive past the token's server-side expiry (~30 minutes) should be recreated; admin operations are expected to run within a time-bounded session.

    export PINECONE_CLIENT_ID="your_client_id"
    export PINECONE_CLIENT_SECRET="your_client_secret"
    import { AdminClient } from '@pinecone-database/pinecone';

    const admin = new AdminClient();
    const projects = await admin.projects.list();
    import { AdminClient } from '@pinecone-database/pinecone';

    const admin = new AdminClient({
    clientId: 'your_client_id',
    clientSecret: 'your_client_secret',
    });

    A common workflow uses AdminClient to create a project and API key, then passes that key to the Pinecone client for data operations:

    import { AdminClient, Pinecone } from '@pinecone-database/pinecone';

    const admin = new AdminClient();
    const project = await admin.projects.create({ name: 'my-project' });
    const apiKey = await admin.apiKeys.create(project.id, { name: 'my-key' });
    const pc = new Pinecone({ apiKey: apiKey.value });
    Index

    Operations for managing API keys within a project.

    Operations for managing invitations to join the organization.

    organizations: OrganizationsResource

    Operations for managing organizations.

    Operations for managing projects.

    roleBindings: RoleBindingsResource

    Operations for managing role bindings.

    serviceAccounts: ServiceAccountsResource

    Operations for managing service accounts within the organization.

    Operations for managing users within the organization.