Skip to content

Commit bb5dc1c

Browse files
committed
Merge commit '089541c9a7ae7be9e8348670d69b501d511bff4e' into HEAD
2 parents 6240235 + 089541c commit bb5dc1c

34 files changed

Lines changed: 491 additions & 495 deletions

‎.castiron.stats.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
schema_version: 1
2-
generation_id: f3e19207-6ce5-40a6-a13b-8302b0c58a75
3-
openapi_spec_hash: 1733a6607ae8c4bfadd88afe842dae7a
4-
openapi_transformed_spec_hash: 48c270e8b363f3dac1f5593e4289538c
5-
config_hash: a9f6de2d35d1dd50fccee9708e138837
6-
codegen_sha: bed5b38486e1557a6fbf8b151c505379e0a7870b
7-
codegen_hash: d0dcab1077903e346bdacf03930b4f278a68c2896e49e30457106763a44c8f07
2+
generation_id: 8b821b6c-0836-44bb-a4a9-6f62fdac616e
3+
openapi_spec_hash: 6bb5b5586f1ffada85bccfd43170bfa3
4+
openapi_transformed_spec_hash: e15abdc5dfeb4d1b3bc07bf2ba10de1e
5+
config_hash: eb083898f75b3c78d03e3c6d075e53d8
6+
codegen_sha: 3d9c87a0ececa02d59d3755babfce9993e3c0a11
7+
codegen_hash: 1bd1db260d1cf8172d9ef9d6dc02eb205973e3d245b8126f8a30b1ce91f56abe

‎.release-please-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.62.2"
2+
".": "3.63.0"
33
}

‎CHANGELOG.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## [3.63.0](https://github.com/openai/openai-python/compare/v3.62.2...v3.63.0) (2026-12-03)
4+
5+
6+
### Features
7+
8+
* **api:** support monthly spend limits on project API keys ([#4366](https://github.com/openai/openai-python/issues/4366)) ([83f5849](https://github.com/openai/openai-python/commit/83f5849fc7948c9fd72a16de1f55b810780554d3))
9+
10+
11+
### Chores
12+
13+
* **api:** clarify blocking agent context compaction ([#4361](https://github.com/openai/openai-python/issues/4361)) ([f0ec4f9](https://github.com/openai/openai-python/commit/f0ec4f94f93a110a72b8c991fd1f3155322bf957))
14+
* **api:** clarify environment file uploads and model examples ([#4364](https://github.com/openai/openai-python/issues/4364)) ([ccc5732](https://github.com/openai/openai-python/commit/ccc573291d5830c1cb4a8991edf104a3ea171cf9))
15+
316
## [3.62.2](https://github.com/openai/openai-python/compare/v3.62.1...v3.62.2) (2026-12-02)
417

518

‎api.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ Methods:
16611661
Types:
16621662

16631663
```python
1664-
from openai.types.admin.organization import Project, ProjectResidency
1664+
from openai.types.admin.organization import Project, ProjectAPIKeySpendLimit, ProjectResidency
16651665
```
16661666

16671667
Methods:

‎api_reference/openapi.transformed.yml‎

Lines changed: 156 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9724,6 +9724,7 @@ paths:
97249724
x-oaiMeta:
97259725
group: models
97269726
examples:
9727+
- title: Retrieve a model
97279728
request:
97289729
curl: |
97299730
curl https://api.openai.com/v1/models/gpt-6.2-astra \
@@ -9755,14 +9756,27 @@ paths:
97559756
apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
97569757
);
97579758

9758-
ClientResult<OpenAIModel> model = client.GetModel("babbage-002");
9759+
ClientResult<OpenAIModel> model = client.GetModel("gpt-6.2-astra");
97599760
Console.WriteLine(model.Value.Id);
97609761
response: |
97619762
{
97629763
"id": "gpt-6.2-astra",
97639764
"object": "model",
97649765
"created": 1686935002,
97659766
"owned_by": "openai",
9767+
"shutdown_date": null
9768+
}
9769+
- title: Before shutdown (historical example)
9770+
request:
9771+
curl: |
9772+
curl https://api.openai.com/v1/models/gpt-4o-2024-05-13 \
9773+
-H "Authorization: Bearer $OPENAI_API_KEY"
9774+
response: |
9775+
{
9776+
"id": "gpt-4o-2024-05-13",
9777+
"object": "model",
9778+
"created": 1686935002,
9779+
"owned_by": "openai",
97669780
"shutdown_date": "2026-10-23"
97679781
}
97689782
delete:
@@ -13150,11 +13164,12 @@ paths:
1315013164
- AdminApiKeyAuth: []
1315113165
summary: Update project API key
1315213166
description: |
13153-
Updates the scopes and/or expiration of an existing API key in the project, including a
13154-
service-account-owned key. Requires permission to write project API keys.
13167+
Updates the scopes, expiration, or monthly hard spend limit of an existing
13168+
project API key, including keys owned by service accounts. Requires
13169+
permission to write project API keys.
1315513170

13156-
Provide at least one of `scopes` or `expires_in_seconds`. Omitted fields stay
13157-
unchanged; neither field accepts `null`. Both changes are saved together.
13171+
Provide at least one of `scopes`, `expires_in_seconds`, or `spend_limit`.
13172+
Omitted fields stay unchanged. Set `spend_limit` to `null` to remove the limit.
1315813173

1315913174
`scopes` replaces the key's scope restrictions using the same scope identifiers
1316013175
as the dashboard. An empty array means All permissions, subject to the owner's
@@ -32636,7 +32651,7 @@ paths:
3263632651
post:
3263732652
operationId: createAgentEnvironmentFile
3263832653
summary: Write an agent environment file
32639-
description: Copies inline bytes or a Files API file into a connected execution environment, replacing an existing regular file at the same path. Upload between turns and wait for success before starting the next turn. See [environment files](https://developers.openai.com/api/docs/guides/agents-api/environments/files).
32654+
description: Writes inline bytes or a Files API file, replacing an existing regular file at the same path. Uploading wakes a suspended session-owned sandbox that supports restore. Early in that restore, uploads can return success once their files are durably saved. Later uploads wait for the sandbox to connect. Upload between turns and wait for all uploads to succeed before sending input. The next turn waits for all accepted files to be installed. If installation fails after a successful upload, the session fails and its error identifies the file. See [environment files](https://developers.openai.com/api/docs/guides/agents-api/environments/files).
3264032655
tags:
3264132656
- Agents
3264232657
parameters:
@@ -32655,7 +32670,7 @@ paths:
3265532670
$ref: '#/components/schemas/HostedEnvironmentFileParam'
3265632671
responses:
3265732672
'201':
32658-
description: The written live environment file.
32673+
description: The file accepted for this environment.
3265932674
content:
3266032675
application/json:
3266132676
schema:
@@ -54751,7 +54766,7 @@ components:
5475154766
name: The model object
5475254767
example: |
5475354768
{
54754-
"id": "gpt-6.2-astra",
54769+
"id": "gpt-4o-2024-05-13",
5475554770
"object": "model",
5475654771
"created": 1686935002,
5475754772
"owned_by": "openai",
@@ -55718,6 +55733,8 @@ components:
5571855733
$ref: '#/components/schemas/ProjectApiKeyOwnerUser'
5571955734
service_account:
5572055735
$ref: '#/components/schemas/ProjectApiKeyOwnerServiceAccount'
55736+
spend_limit:
55737+
$ref: '#/components/schemas/spend_limit'
5572155738
required:
5572255739
- object
5572355740
- redacted_value
@@ -56331,6 +56348,8 @@ components:
5633156348
description: The Unix timestamp (in seconds) when the API key expires, or null if it does not expire.
5633256349
id:
5633356350
type: string
56351+
spend_limit:
56352+
$ref: '#/components/schemas/spend_limit'
5633456353
required:
5633556354
- object
5633656355
- value
@@ -56355,6 +56374,8 @@ components:
5635556374
maximum: 31536000
5635656375
- type: 'null'
5635756376
description: Number of seconds until the initial API key expires. If omitted or null, the key does not expire unless the effective organization or project policy requires an expiration. When a policy sets a maximum lifetime, this value must be provided and must not exceed that limit. A non-null value cannot be used when `create_service_account_only` is true.
56377+
spend_limit:
56378+
$ref: '#/components/schemas/properties-spend_limit'
5635856379
required:
5635956380
- name
5636056381
ProjectServiceAccountCreateResponse:
@@ -81842,6 +81863,8 @@ components:
8184281863
- scopes
8184381864
- required:
8184481865
- expires_in_seconds
81866+
- required:
81867+
- spend_limit
8184581868
properties:
8184681869
expires_in_seconds:
8184781870
type: integer
@@ -81854,6 +81877,11 @@ components:
8185481877
type: string
8185581878
type: array
8185681879
description: Replace the API key scope restrictions. Omit to leave scopes unchanged. An empty array removes key restrictions (All permissions), subject to the owner's effective permissions. Use ["api.all.read"] for read-only access. Scopes do not change the owner's roles or grant administrative permissions.
81880+
spend_limit:
81881+
anyOf:
81882+
- $ref: '#/components/schemas/UpdateProjectKeySpendLimitParams'
81883+
description: The monthly hard spend limit for this API key. Set to `null` to remove the limit.
81884+
- type: 'null'
8185781885
type: object
8185881886
required: []
8185981887
SpecificProgrammaticToolCallingParam:
@@ -84064,6 +84092,11 @@ components:
8406484092
minimum: 1
8406584093
description: Number of seconds until the API key expires.
8406684094
- type: 'null'
84095+
spend_limit:
84096+
anyOf:
84097+
- $ref: '#/components/schemas/CreateSpendLimitParams'
84098+
description: The monthly hard spend limit for the new API key.
84099+
- type: 'null'
8406784100
type: object
8406884101
required: []
8406984102
description: The service account API key create request payload.
@@ -84095,6 +84128,11 @@ components:
8409584128
id:
8409684129
type: string
8409784130
description: The identifier of the API key.
84131+
spend_limit:
84132+
anyOf:
84133+
- $ref: '#/components/schemas/ApiKeySpendLimitBody'
84134+
description: The hard spend limit for this API key, or null if no limit is configured.
84135+
- type: 'null'
8409884136
type: object
8409984137
required:
8410084138
- object
@@ -87704,7 +87742,7 @@ components:
8770487742
properties:
8770587743
async:
8770687744
type: boolean
87707-
description: Whether context is compacted in the background. Defaults to false.
87745+
description: Always false. Context compaction is blocking.
8770887746
required:
8770987747
- async
8771087748
additionalProperties: false
@@ -88771,7 +88809,7 @@ components:
8877188809
type:
8877288810
- boolean
8877388811
- 'null'
88774-
description: Whether to compact context in the background. Omission or null defaults to false. Set to true to enable background compaction. Background compaction may increase token usage.
88812+
description: Accepted for compatibility and ignored. Context compaction is always blocking.
8877588813
additionalProperties: false
8877688814
description: Settings for compacting the agent's context.
8877788815
AgentToolConfigParamFunction:
@@ -89235,7 +89273,7 @@ components:
8923589273
anyOf:
8923689274
- $ref: '#/components/schemas/CompactionParam'
8923789275
- type: 'null'
89238-
description: Context compaction settings. Omit to keep the current settings. A supplied object replaces the settings; null or an empty object uses blocking compaction.
89276+
description: Context compaction settings.
8923989277
tools:
8924089278
type:
8924189279
- array
@@ -90664,7 +90702,7 @@ components:
9066490702
- path
9066590703
- size_bytes
9066690704
additionalProperties: false
90667-
description: A live file in an execution environment.
90705+
description: A file accepted for or present in an execution environment.
9066890706
EnvironmentFileListResource:
9066990707
type: object
9067090708
properties:
@@ -93205,7 +93243,7 @@ components:
9320593243
anyOf:
9320693244
- $ref: '#/components/schemas/CompactionParam'
9320793245
- type: 'null'
93208-
description: Context compaction settings. Omission or null uses blocking compaction.
93246+
description: Context compaction settings.
9320993247
required:
9321093248
- model
9321193249
additionalProperties: false
@@ -93253,7 +93291,7 @@ components:
9325393291
anyOf:
9325493292
- $ref: '#/components/schemas/CompactionParam'
9325593293
- type: 'null'
93256-
description: Context compaction settings. Omit to keep the current settings. A supplied object replaces the settings; null or an empty object uses blocking compaction.
93294+
description: Context compaction settings.
9325793295
metadata:
9325893296
type:
9325993297
- object
@@ -115125,6 +115163,110 @@ components:
115125115163
"id": "alertnotif_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
115126115164
}
115127115165
}
115166+
ApiKeySpendLimitEnforcementStatus:
115167+
type: string
115168+
enum:
115169+
- inactive
115170+
- enforcing
115171+
ApiKeySpendLimitEnforcementBody:
115172+
properties:
115173+
status:
115174+
$ref: '#/components/schemas/ApiKeySpendLimitEnforcementStatus'
115175+
description: The status is `enforcing` while the spend limit is blocking requests made with this API key, and `inactive` otherwise.
115176+
type: object
115177+
required:
115178+
- status
115179+
ApiKeySpendLimitBody:
115180+
properties:
115181+
threshold_amount:
115182+
type: integer
115183+
description: The monthly hard spend limit amount, in USD cents.
115184+
currency:
115185+
type: string
115186+
enum:
115187+
- USD
115188+
description: The currency for the threshold amount. Currently, only `USD` is supported.
115189+
default: USD
115190+
x-stainless-const: true
115191+
interval:
115192+
type: string
115193+
enum:
115194+
- month
115195+
description: The time interval for evaluating spend against the threshold. Currently, only `month` is supported.
115196+
default: month
115197+
x-stainless-const: true
115198+
enforcement:
115199+
$ref: '#/components/schemas/ApiKeySpendLimitEnforcementBody'
115200+
description: The current enforcement state of the hard spend limit.
115201+
type: object
115202+
required:
115203+
- threshold_amount
115204+
- currency
115205+
- interval
115206+
- enforcement
115207+
description: Represents a hard spend limit configured for a project API key.
115208+
spend_limit:
115209+
anyOf:
115210+
- $ref: '#/components/schemas/ApiKeySpendLimitBody'
115211+
description: The hard spend limit for this API key, or null if no limit is configured.
115212+
- type: 'null'
115213+
UpdateProjectKeySpendLimitParams:
115214+
properties:
115215+
threshold_amount:
115216+
type: integer
115217+
minimum: 1
115218+
description: The monthly hard spend limit amount, in USD cents.
115219+
currency:
115220+
type: string
115221+
enum:
115222+
- USD
115223+
description: The currency for the threshold amount. Currently, only `USD` is supported.
115224+
default: USD
115225+
x-stainless-const: true
115226+
interval:
115227+
type: string
115228+
enum:
115229+
- month
115230+
description: The time interval for evaluating spend against the threshold. Currently, only `month` is supported.
115231+
default: month
115232+
x-stainless-const: true
115233+
type: object
115234+
required:
115235+
- threshold_amount
115236+
- currency
115237+
- interval
115238+
description: The monthly hard spend limit for this API key. Set to `null` to remove the limit.
115239+
CreateSpendLimitParams:
115240+
properties:
115241+
threshold_amount:
115242+
type: integer
115243+
minimum: 1
115244+
description: The monthly hard spend limit amount, in USD cents.
115245+
currency:
115246+
type: string
115247+
enum:
115248+
- USD
115249+
description: The currency for the threshold amount. Currently, only `USD` is supported.
115250+
default: USD
115251+
x-stainless-const: true
115252+
interval:
115253+
type: string
115254+
enum:
115255+
- month
115256+
description: The time interval for evaluating spend against the threshold. Currently, only `month` is supported.
115257+
default: month
115258+
x-stainless-const: true
115259+
type: object
115260+
required:
115261+
- threshold_amount
115262+
- currency
115263+
- interval
115264+
description: The monthly hard spend limit to set on the API key.
115265+
properties-spend_limit:
115266+
anyOf:
115267+
- $ref: '#/components/schemas/CreateSpendLimitParams'
115268+
description: The monthly hard spend limit for the initial API key. You cannot set a spend limit when `create_service_account_only` is `true`.
115269+
- type: 'null'
115128115270
DecisionPromptCacheBreakpoint:
115129115271
type: object
115130115272
properties:

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "openai"
3-
version = "3.62.2"
3+
version = "3.63.0"
44
description = "The official Python library for the openai API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)