SpyBara
Go Premium

guides/admin-apis.md 2026-05-21 06:36 UTC to 2026-05-22 06:33 UTC

16 added, 1 removed.

2026
Fri 29 06:38 Thu 28 06:37 Wed 27 06:42 Sun 24 06:25 Fri 22 06:33 Thu 21 06:36 Wed 20 06:35 Tue 19 11:58 Mon 18 22:01 Thu 14 21:00 Tue 12 18:57 Thu 7 21:57 Wed 6 00:01 Tue 5 23:00 Sat 2 05:57

Admin APIs

import { adminClientExamples, auditLogExamples, dataRetentionExamples, inviteUserExamples, modelPermissionsExamples, spendAlertExamples, } from "./admin-apis-examples";

Admin APIs let you automate organization management workflows such as user invitations, audit log review, project administration, API key management, spend alerts, data retention, and rate limit operations. Use them for back-office automation, security workflows, and operational tooling that should run outside the dashboard.

For endpoint details, see the Administration API reference, including Admin API keys, Invites, Users, Projects, and Audit logs.

Use an Admin API key with the SDK

To access these endpoints, create an Admin API key. Admin API keys cannot be used for non-administration endpoints.

Support for Admin APIs was added in these SDK versions, which may require updating your SDK version:

  • Node: 6.36.0
  • Python: 2.34.0
  • Go: 3.34.0
  • Ruby: 0.61.0
  • Java: 4.34.0

Set OPENAI_ADMIN_KEY, then initialize the SDK for your language.

Restrict model access for projects

Use project model permissions to set an allowlist or denylist for a project. Set mode to allow_list to allow only the listed models, or set mode to deny_list to block the listed models while allowing other available models. Model IDs must be visible to the organization, including visible fine-tuned model snapshots.

Manage spend limit alerts

Use project spend alerts to notify your team when project spend reaches a threshold. Threshold amounts are specified in cents.

Manage data retention

Use project data retention controls to override or inherit the organization's retention policy for a project. Set retention_type to organization_default to inherit the organization setting.

Invite a user by email

Use the Invites endpoint to send an organization invitation to an email address.

Retrieve audit logs

Use the Audit Logs endpoint to list recent user actions and configuration changes for the organization.