Skip to content

feat(api): support monthly spend limits on project API keys - #4366

Merged
markstuart-oai merged 1 commit into
mainfrom
castiron/promotions/pr-471
Dec 3, 2026
Merged

markstuart-oai merged 1 commit into
mainfrom
castiron/promotions/pr-471

Conversation

@markstuart-oai

Copy link
Copy Markdown
Contributor

Summary

Set a monthly spending limit when creating a service account or issuing a key for one. Update or clear the limit on an existing project API key.

Changes

  • Pass spend_limit when creating a service account or a service account API key.
  • Set spend_limit=None on a project API key update to clear the limit, or omit it to keep the current setting.
  • Read the monthly limit and its enforcement status on returned keys.

Castiron-Internal-PR: openai/openai-python-internal#471
Castiron-Source-SHA: b27e96652ccdcc6fd48e6c8374e839023cbf2a84
Castiron-Public-Base-SHA: ccc5732
@markstuart-oai
markstuart-oai requested a review from a team as a code owner December 3, 2026 03:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T03:46:48.533857Z 620c46f PR opened
🔒 Security Review ✅ Completed 2026-12-03T03:47:04.254470Z 620c46f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable findings in the comprehensive static review of this commit. Checked sync/async request parity, null versus omission behavior, request and response models, enforcement status, and imports/exports. Independent second review agreed. Hosted CI at review: {"SUCCESS": 13, "IN_PROGRESS": 4, "SKIPPED": 9}. No candidate code or local tests were executed.

@markstuart-oai
markstuart-oai added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 83f5849 Dec 3, 2026
26 checks passed
@markstuart-oai
markstuart-oai deleted the castiron/promotions/pr-471 branch December 3, 2026 04:39
@openai-sdks openai-sdks Bot mentioned this pull request Dec 3, 2026
gh-actions-shared Bot pushed a commit to xf-qubit/openai-python that referenced this pull request Dec 3, 2026
Automated Release PR
---


##
[3.63.0](openai/openai-python@v3.62.2...v3.63.0)
(2026-12-03)


### Features

* **api:** support monthly spend limits on project API keys
([openai#4366](openai#4366))
([83f5849](openai@83f5849))


### Chores

* **api:** clarify blocking agent context compaction
([openai#4361](openai#4361))
([f0ec4f9](openai@f0ec4f9))
* **api:** clarify environment file uploads and model examples
([openai#4364](openai#4364))
([ccc5732](openai@ccc5732))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants