Skip to content

Commit 6e4a79c

Browse files
chore(api): document batch error responses (openai#3961)
## Summary Documents applicable Batch API errors while preserving Python exception behavior. ## Changes - Describe invalid requests, missing batches, and cancellation conflicts. - Clarify applicable rate-limit and service-error responses. Co-authored-by: markstuart-oai <323302876+markstuart-oai@users.noreply.github.com>
1 parent a9d727f commit 6e4a79c

2 files changed

Lines changed: 119 additions & 35 deletions

File tree

‎.castiron.stats.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
schema_version: 1
2-
generation_id: bbcf5fb4-a54f-48d7-9c24-772776477085
3-
openapi_spec_hash: 0e4e2f7dffefdf9af4ba091f557e3698
4-
openapi_transformed_spec_hash: 289efd507762e0572ba21c2b46935826
2+
generation_id: bf7a8dff-eafb-43e0-873c-86458c45c4bc
3+
openapi_spec_hash: 0ec6a7e693cd01f26722c3dab19fc122
4+
openapi_transformed_spec_hash: f0b54f1f631dbd006b7768595bcda2d4
55
config_hash: 84cdcc959ee7140cc9a65e9b642c097b
6-
codegen_sha: 89568c51f375a47f1d3156069016495765eeb70f
6+
codegen_sha: d04e68695b3ce0aedd210db03d3a02ec740a3cef
77
codegen_hash: 67b5ab20d81c80689a8a857466838278fb0d428d48b3261d2479bab43396d589
8-
public_codegen_sha: adc070c132abc2bdd81fd8ef5c4b75925ea0a02c
8+
public_codegen_sha: 00b2059284b62aea18c2360ad9cd3ee65a9c12e5

‎api_reference/openapi.transformed.yml‎

Lines changed: 114 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,30 @@ paths:
15401540
application/json:
15411541
schema:
15421542
$ref: '#/components/schemas/Batch'
1543+
'400':
1544+
description: The request is invalid or the account cannot create a batch.
1545+
content:
1546+
application/json:
1547+
schema:
1548+
$ref: '#/components/schemas/ErrorResponse'
1549+
'429':
1550+
description: The request was rejected because a rate limit was exceeded.
1551+
content:
1552+
application/json:
1553+
schema:
1554+
$ref: '#/components/schemas/ErrorResponse'
1555+
'500':
1556+
description: An internal error prevented the batch from being created.
1557+
content:
1558+
application/json:
1559+
schema:
1560+
$ref: '#/components/schemas/ErrorResponse'
1561+
'503':
1562+
description: The batch could not be created because the service is temporarily unavailable.
1563+
content:
1564+
application/json:
1565+
schema:
1566+
$ref: '#/components/schemas/ErrorResponse'
15431567
x-oaiMeta:
15441568
group: batch
15451569
examples:
@@ -1637,6 +1661,24 @@ paths:
16371661
application/json:
16381662
schema:
16391663
$ref: '#/components/schemas/ListBatchesResponse'
1664+
'400':
1665+
description: Invalid pagination parameters.
1666+
content:
1667+
application/json:
1668+
schema:
1669+
$ref: '#/components/schemas/ErrorResponse'
1670+
'404':
1671+
description: No batch was found with the specified pagination cursor.
1672+
content:
1673+
application/json:
1674+
schema:
1675+
$ref: '#/components/schemas/ErrorResponse'
1676+
'429':
1677+
description: The request was rejected because a rate limit was exceeded.
1678+
content:
1679+
application/json:
1680+
schema:
1681+
$ref: '#/components/schemas/ErrorResponse'
16401682
x-oaiMeta:
16411683
group: batch
16421684
examples:
@@ -1724,6 +1766,24 @@ paths:
17241766
application/json:
17251767
schema:
17261768
$ref: '#/components/schemas/Batch'
1769+
'400':
1770+
description: Invalid batch ID.
1771+
content:
1772+
application/json:
1773+
schema:
1774+
$ref: '#/components/schemas/ErrorResponse'
1775+
'404':
1776+
description: No batch was found with the specified ID.
1777+
content:
1778+
application/json:
1779+
schema:
1780+
$ref: '#/components/schemas/ErrorResponse'
1781+
'429':
1782+
description: The request was rejected because a rate limit was exceeded.
1783+
content:
1784+
application/json:
1785+
schema:
1786+
$ref: '#/components/schemas/ErrorResponse'
17271787
x-oaiMeta:
17281788
group: batch
17291789
examples:
@@ -1800,6 +1860,30 @@ paths:
18001860
application/json:
18011861
schema:
18021862
$ref: '#/components/schemas/Batch'
1863+
'400':
1864+
description: Invalid batch ID.
1865+
content:
1866+
application/json:
1867+
schema:
1868+
$ref: '#/components/schemas/ErrorResponse'
1869+
'404':
1870+
description: No batch was found with the specified ID.
1871+
content:
1872+
application/json:
1873+
schema:
1874+
$ref: '#/components/schemas/ErrorResponse'
1875+
'409':
1876+
description: The batch's current status does not allow cancellation.
1877+
content:
1878+
application/json:
1879+
schema:
1880+
$ref: '#/components/schemas/ErrorResponse'
1881+
'429':
1882+
description: The request was rejected because a rate limit was exceeded.
1883+
content:
1884+
application/json:
1885+
schema:
1886+
$ref: '#/components/schemas/ErrorResponse'
18031887
x-oaiMeta:
18041888
group: batch
18051889
examples:
@@ -66973,6 +67057,36 @@ components:
6697367057
"type": "safety.warning_issued",
6697467058
"data": {"id": "C-abc123"}
6697567059
}
67060+
_MisalignmentErrorType:
67061+
anyOf:
67062+
- type: string
67063+
- type: string
67064+
enum:
67065+
- potentially_unintended_data_transfer
67066+
- potentially_unintended_data_access
67067+
- potentially_unintended_destructive_activity
67068+
- other
67069+
_MisalignmentSteer:
67070+
properties:
67071+
message:
67072+
type: string
67073+
description: The public continuation instruction.
67074+
type: object
67075+
required:
67076+
- message
67077+
MisalignmentErrorDetailsResource:
67078+
properties:
67079+
error_type:
67080+
$ref: '#/components/schemas/_MisalignmentErrorType'
67081+
description: An optional classification; clients must accept additional values.
67082+
detailed_explanation:
67083+
type: string
67084+
description: The public explanation for this block.
67085+
steer:
67086+
$ref: '#/components/schemas/_MisalignmentSteer'
67087+
description: An optional public continuation instruction.
67088+
type: object
67089+
required: []
6697667090
ModerationInputType:
6697767091
type: string
6697867092
enum:
@@ -70449,36 +70563,6 @@ components:
7044970563
- object
7045070564
- metadata
7045170565
- created_at
70452-
_MisalignmentErrorType:
70453-
anyOf:
70454-
- type: string
70455-
- type: string
70456-
enum:
70457-
- potentially_unintended_data_transfer
70458-
- potentially_unintended_data_access
70459-
- potentially_unintended_destructive_activity
70460-
- other
70461-
_MisalignmentSteer:
70462-
properties:
70463-
message:
70464-
type: string
70465-
description: The public continuation instruction.
70466-
type: object
70467-
required:
70468-
- message
70469-
MisalignmentErrorDetailsResource:
70470-
properties:
70471-
error_type:
70472-
$ref: '#/components/schemas/_MisalignmentErrorType'
70473-
description: An optional classification; clients must accept additional values.
70474-
detailed_explanation:
70475-
type: string
70476-
description: The public explanation for this block.
70477-
steer:
70478-
$ref: '#/components/schemas/_MisalignmentSteer'
70479-
description: An optional public continuation instruction.
70480-
type: object
70481-
required: []
7048270566
ImageGenOutputTokensDetails:
7048370567
properties:
7048470568
image_tokens:

0 commit comments

Comments
 (0)