Skip to content

Commit da8ea3e

Browse files
feat: update schemas for 3 /batches endpoints
1 parent 327311b commit da8ea3e

3 files changed

Lines changed: 163 additions & 20 deletions

File tree

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "AIML API",
5+
"version": "1.0.0"
6+
},
7+
"servers": [
8+
{
9+
"url": "https://api.aimlapi.com"
10+
}
11+
],
12+
"paths": {
13+
"/v1/batches/cancel/:batch_id": {
14+
"post": {
15+
"operationId": "_v1_batches_cancel_:batch_id",
16+
"requestBody": {
17+
"required": true,
18+
"content": {
19+
"application/json": {
20+
"schema": {
21+
"type": "object",
22+
"properties": {
23+
"id": {
24+
"type": "string"
25+
}
26+
},
27+
"required": [
28+
"id"
29+
]
30+
}
31+
}
32+
}
33+
},
34+
"responses": {
35+
"200": {
36+
"content": {
37+
"application/json": {
38+
"schema": {
39+
"type": "object",
40+
"properties": {
41+
"id": {
42+
"type": "string",
43+
"description": "Unique identifier of the batch.",
44+
"example": "msgbatch_01McVJYhQd3Wiuqrac6y9PrX"
45+
},
46+
"type": {
47+
"type": "string",
48+
"description": "Object type.",
49+
"example": "message_batch"
50+
},
51+
"processing_status": {
52+
"type": "string",
53+
"description": "Current processing status of the batch.",
54+
"example": "canceling"
55+
},
56+
"request_counts": {
57+
"type": "object",
58+
"description": "Number of requests in each state.",
59+
"properties": {
60+
"processing": {
61+
"type": "integer",
62+
"description": "Number of requests currently being processed.",
63+
"example": 3
64+
},
65+
"succeeded": {
66+
"type": "integer",
67+
"description": "Number of successfully completed requests.",
68+
"example": 0
69+
},
70+
"errored": {
71+
"type": "integer",
72+
"description": "Number of requests that failed with an error.",
73+
"example": 0
74+
},
75+
"canceled": {
76+
"type": "integer",
77+
"description": "Number of canceled requests.",
78+
"example": 0
79+
},
80+
"expired": {
81+
"type": "integer",
82+
"description": "Number of expired requests.",
83+
"example": 0
84+
}
85+
},
86+
"required": [
87+
"processing",
88+
"succeeded",
89+
"errored",
90+
"canceled",
91+
"expired"
92+
]
93+
},
94+
"ended_at": {
95+
"type": "string",
96+
"format": "date-time",
97+
"nullable": true,
98+
"description": "Timestamp when the batch finished processing, if completed."
99+
},
100+
"created_at": {
101+
"type": "string",
102+
"format": "date-time",
103+
"description": "Timestamp when the batch was created.",
104+
"example": "2025-10-24T13:49:11.902215+00:00"
105+
},
106+
"expires_at": {
107+
"type": "string",
108+
"format": "date-time",
109+
"description": "Timestamp when the batch will expire if not completed.",
110+
"example": "2025-10-25T13:49:11.902215+00:00"
111+
},
112+
"cancel_initiated_at": {
113+
"type": "string",
114+
"format": "date-time",
115+
"nullable": true,
116+
"description": "Timestamp when cancellation was initiated."
117+
},
118+
"results_url": {
119+
"type": "string",
120+
"nullable": true,
121+
"description": "URL to download batch results once processing is complete."
122+
}
123+
},
124+
"required": [
125+
"id",
126+
"type",
127+
"processing_status",
128+
"request_counts",
129+
"created_at",
130+
"expires_at"
131+
]
132+
}
133+
}
134+
}
135+
}
136+
}
137+
}
138+
}
139+
}
140+
}

docs/capabilities/batch-create.json

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"paths": {
1313
"/v1/batches": {
1414
"post": {
15+
"x-codeSamples":[],
1516
"operationId": "_v1_batches",
1617
"requestBody": {
1718
"required": true,
@@ -28,21 +29,16 @@
2829
"properties": {
2930
"custom_id": {
3031
"type": "string",
31-
"description": "A unique identifier for this request within the batch."
32+
"description": "A unique identifier for this request within the batch.",
33+
"example": "test_call_1"
3234
},
3335
"params": {
3436
"type": "object",
3537
"description": "Parameters passed to the model for this request.",
3638
"properties": {
3739
"model": {
3840
"type": "string",
39-
"description": "Model to use for this request."
40-
},
41-
"max_tokens": {
42-
"type": "number",
43-
"minimum": 1,
44-
"default": 1024,
45-
"description": "Maximum number of tokens to generate."
41+
"description": "Anthropic model to use for this request."
4642
},
4743
"messages": {
4844
"type": "array",
@@ -51,31 +47,45 @@
5147
"nullable": true
5248
}
5349
},
50+
"system": {
51+
"type": "string",
52+
"description": "System prompt that guides the model’s behavior."
53+
},
5454
"metadata": {
5555
"type": "object",
5656
"description": "Optional metadata for this request.",
5757
"additionalProperties": {
5858
"type": "string"
5959
}
6060
},
61+
"max_tokens": {
62+
"type": "number",
63+
"minimum": 1,
64+
"default": 1024,
65+
"description": "Maximum number of tokens to generate."
66+
},
6167
"stop_sequences": {
6268
"type": "array",
6369
"description": "Sequences where the model will stop generating further tokens.",
6470
"items": {
6571
"type": "string"
6672
}
6773
},
68-
"system": {
69-
"type": "string",
70-
"description": "System prompt that guides the model’s behavior."
71-
},
7274
"temperature": {
7375
"type": "number",
7476
"minimum": 0,
7577
"maximum": 1,
7678
"default": 1,
7779
"description": "Controls randomness of the output."
7880
},
81+
"top_k": {
82+
"type": "number",
83+
"description": "Limits sampling to the top K most likely tokens."
84+
},
85+
"top_p": {
86+
"type": "number",
87+
"description": "Controls nucleus sampling probability threshold."
88+
},
7989
"tool_choice": {
8090
"nullable": true,
8191
"description": "Controls how the model selects or uses tools."
@@ -87,14 +97,6 @@
8797
"nullable": true
8898
}
8999
},
90-
"top_k": {
91-
"type": "number",
92-
"description": "Limits sampling to the top K most likely tokens."
93-
},
94-
"top_p": {
95-
"type": "number",
96-
"description": "Controls nucleus sampling probability threshold."
97-
},
98100
"thinking": {
99101
"description": "Controls internal reasoning behavior.",
100102
"oneOf": [

docs/capabilities/batch-get.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"paths": {
1313
"/v1/batches": {
1414
"get": {
15+
"x-codeSamples":[],
1516
"operationId": "_v1_batches",
1617
"requestBody": {
1718
"required": true,

0 commit comments

Comments
 (0)