1{
2  "version":"2.0",
3  "metadata":{
4    "apiVersion":"2023-09-30",
5    "endpointPrefix":"bedrock-runtime",
6    "jsonVersion":"1.1",
7    "protocol":"rest-json",
8    "serviceFullName":"Amazon Bedrock Runtime",
9    "serviceId":"Bedrock Runtime",
10    "signatureVersion":"v4",
11    "signingName":"bedrock",
12    "uid":"bedrock-runtime-2023-09-30"
13  },
14  "operations":{
15    "InvokeModel":{
16      "name":"InvokeModel",
17      "http":{
18        "method":"POST",
19        "requestUri":"/model/{modelId}/invoke",
20        "responseCode":200
21      },
22      "input":{"shape":"InvokeModelRequest"},
23      "output":{"shape":"InvokeModelResponse"},
24      "errors":[
25        {"shape":"AccessDeniedException"},
26        {"shape":"ResourceNotFoundException"},
27        {"shape":"ThrottlingException"},
28        {"shape":"ModelTimeoutException"},
29        {"shape":"InternalServerException"},
30        {"shape":"ValidationException"},
31        {"shape":"ModelNotReadyException"},
32        {"shape":"ServiceQuotaExceededException"},
33        {"shape":"ModelErrorException"}
34      ],
35      "documentation":"<p>Invokes the specified Bedrock model to run inference using the input provided in the request body. You use InvokeModel to run inference for text models, image models, and embedding models.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html\">Run inference</a> in the Bedrock User Guide.</p> <p>For example requests, see Examples (after the Errors section).</p>"
36    },
37    "InvokeModelWithResponseStream":{
38      "name":"InvokeModelWithResponseStream",
39      "http":{
40        "method":"POST",
41        "requestUri":"/model/{modelId}/invoke-with-response-stream",
42        "responseCode":200
43      },
44      "input":{"shape":"InvokeModelWithResponseStreamRequest"},
45      "output":{"shape":"InvokeModelWithResponseStreamResponse"},
46      "errors":[
47        {"shape":"AccessDeniedException"},
48        {"shape":"ResourceNotFoundException"},
49        {"shape":"ThrottlingException"},
50        {"shape":"ModelTimeoutException"},
51        {"shape":"InternalServerException"},
52        {"shape":"ModelStreamErrorException"},
53        {"shape":"ValidationException"},
54        {"shape":"ModelNotReadyException"},
55        {"shape":"ServiceQuotaExceededException"},
56        {"shape":"ModelErrorException"}
57      ],
58      "documentation":"<p>Invoke the specified Bedrock model to run inference using the input provided. Return the response in a stream.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html\">Run inference</a> in the Bedrock User Guide.</p> <p>For an example request and response, see Examples (after the Errors section).</p>"
59    }
60  },
61  "shapes":{
62    "AccessDeniedException":{
63      "type":"structure",
64      "members":{
65        "message":{"shape":"NonBlankString"}
66      },
67      "documentation":"<p>The request is denied because of missing access permissions.</p>",
68      "error":{
69        "httpStatusCode":403,
70        "senderFault":true
71      },
72      "exception":true
73    },
74    "Body":{
75      "type":"blob",
76      "max":25000000,
77      "min":0,
78      "sensitive":true
79    },
80    "InternalServerException":{
81      "type":"structure",
82      "members":{
83        "message":{"shape":"NonBlankString"}
84      },
85      "documentation":"<p>An internal server error occurred. Retry your request.</p>",
86      "error":{"httpStatusCode":500},
87      "exception":true,
88      "fault":true
89    },
90    "InvokeModelIdentifier":{
91      "type":"string",
92      "max":2048,
93      "min":1,
94      "pattern":"(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)"
95    },
96    "InvokeModelRequest":{
97      "type":"structure",
98      "required":[
99        "body",
100        "modelId"
101      ],
102      "members":{
103        "body":{
104          "shape":"Body",
105          "documentation":"<p>Input data in the format specified in the content-type request header. To see the format and content of this field for different models, refer to <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html\">Inference parameters</a>.</p>"
106        },
107        "contentType":{
108          "shape":"MimeType",
109          "documentation":"<p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>",
110          "location":"header",
111          "locationName":"Content-Type"
112        },
113        "accept":{
114          "shape":"MimeType",
115          "documentation":"<p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>",
116          "location":"header",
117          "locationName":"Accept"
118        },
119        "modelId":{
120          "shape":"InvokeModelIdentifier",
121          "documentation":"<p>Identifier of the model. </p>",
122          "location":"uri",
123          "locationName":"modelId"
124        }
125      },
126      "payload":"body"
127    },
128    "InvokeModelResponse":{
129      "type":"structure",
130      "required":[
131        "body",
132        "contentType"
133      ],
134      "members":{
135        "body":{
136          "shape":"Body",
137          "documentation":"<p>Inference response from the model in the format specified in the content-type header field. To see the format and content of this field for different models, refer to <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html\">Inference parameters</a>.</p>"
138        },
139        "contentType":{
140          "shape":"MimeType",
141          "documentation":"<p>The MIME type of the inference result.</p>",
142          "location":"header",
143          "locationName":"Content-Type"
144        }
145      },
146      "payload":"body"
147    },
148    "InvokeModelWithResponseStreamRequest":{
149      "type":"structure",
150      "required":[
151        "body",
152        "modelId"
153      ],
154      "members":{
155        "body":{
156          "shape":"Body",
157          "documentation":"<p>Inference input in the format specified by the content-type. To see the format and content of this field for different models, refer to <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html\">Inference parameters</a>.</p>"
158        },
159        "contentType":{
160          "shape":"MimeType",
161          "documentation":"<p>The MIME type of the input data in the request. The default value is <code>application/json</code>.</p>",
162          "location":"header",
163          "locationName":"Content-Type"
164        },
165        "accept":{
166          "shape":"MimeType",
167          "documentation":"<p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>",
168          "location":"header",
169          "locationName":"X-Amzn-Bedrock-Accept"
170        },
171        "modelId":{
172          "shape":"InvokeModelIdentifier",
173          "documentation":"<p>Id of the model to invoke using the streaming request.</p>",
174          "location":"uri",
175          "locationName":"modelId"
176        }
177      },
178      "payload":"body"
179    },
180    "InvokeModelWithResponseStreamResponse":{
181      "type":"structure",
182      "required":[
183        "body",
184        "contentType"
185      ],
186      "members":{
187        "body":{
188          "shape":"ResponseStream",
189          "documentation":"<p>Inference response from the model in the format specified by Content-Type. To see the format and content of this field for different models, refer to <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html\">Inference parameters</a>.</p>"
190        },
191        "contentType":{
192          "shape":"MimeType",
193          "documentation":"<p>The MIME type of the inference result.</p>",
194          "location":"header",
195          "locationName":"X-Amzn-Bedrock-Content-Type"
196        }
197      },
198      "payload":"body"
199    },
200    "MimeType":{"type":"string"},
201    "ModelErrorException":{
202      "type":"structure",
203      "members":{
204        "message":{"shape":"NonBlankString"},
205        "originalStatusCode":{
206          "shape":"StatusCode",
207          "documentation":"<p>The original status code.</p>"
208        },
209        "resourceName":{
210          "shape":"NonBlankString",
211          "documentation":"<p>The resource name.</p>"
212        }
213      },
214      "documentation":"<p>The request failed due to an error while processing the model.</p>",
215      "error":{
216        "httpStatusCode":424,
217        "senderFault":true
218      },
219      "exception":true
220    },
221    "ModelNotReadyException":{
222      "type":"structure",
223      "members":{
224        "message":{"shape":"NonBlankString"}
225      },
226      "documentation":"<p>The model specified in the request is not ready to serve inference requests.</p>",
227      "error":{
228        "httpStatusCode":429,
229        "senderFault":true
230      },
231      "exception":true
232    },
233    "ModelStreamErrorException":{
234      "type":"structure",
235      "members":{
236        "message":{"shape":"NonBlankString"},
237        "originalStatusCode":{
238          "shape":"StatusCode",
239          "documentation":"<p>The original status code.</p>"
240        },
241        "originalMessage":{
242          "shape":"NonBlankString",
243          "documentation":"<p>The original message.</p>"
244        }
245      },
246      "documentation":"<p>An error occurred while streaming the response.</p>",
247      "error":{
248        "httpStatusCode":424,
249        "senderFault":true
250      },
251      "exception":true
252    },
253    "ModelTimeoutException":{
254      "type":"structure",
255      "members":{
256        "message":{"shape":"NonBlankString"}
257      },
258      "documentation":"<p>The request took too long to process. Processing time exceeded the model timeout length.</p>",
259      "error":{
260        "httpStatusCode":408,
261        "senderFault":true
262      },
263      "exception":true
264    },
265    "NonBlankString":{
266      "type":"string",
267      "pattern":"[\\s\\S]*"
268    },
269    "PartBody":{
270      "type":"blob",
271      "max":1000000,
272      "min":0,
273      "sensitive":true
274    },
275    "PayloadPart":{
276      "type":"structure",
277      "members":{
278        "bytes":{
279          "shape":"PartBody",
280          "documentation":"<p>Base64-encoded bytes of payload data.</p>"
281        }
282      },
283      "documentation":"<p>Payload content included in the response.</p>",
284      "event":true,
285      "sensitive":true
286    },
287    "ResourceNotFoundException":{
288      "type":"structure",
289      "members":{
290        "message":{"shape":"NonBlankString"}
291      },
292      "documentation":"<p>The specified resource ARN was not found. Check the ARN and try your request again.</p>",
293      "error":{
294        "httpStatusCode":404,
295        "senderFault":true
296      },
297      "exception":true
298    },
299    "ResponseStream":{
300      "type":"structure",
301      "members":{
302        "chunk":{
303          "shape":"PayloadPart",
304          "documentation":"<p>Content included in the response.</p>"
305        },
306        "internalServerException":{"shape":"InternalServerException"},
307        "modelStreamErrorException":{"shape":"ModelStreamErrorException"},
308        "validationException":{"shape":"ValidationException"},
309        "throttlingException":{"shape":"ThrottlingException"},
310        "modelTimeoutException":{"shape":"ModelTimeoutException"}
311      },
312      "documentation":"<p>Definition of content in the response stream.</p>",
313      "eventstream":true
314    },
315    "ServiceQuotaExceededException":{
316      "type":"structure",
317      "members":{
318        "message":{"shape":"NonBlankString"}
319      },
320      "documentation":"<p>The number of requests exceeds the service quota. Resubmit your request later.</p>",
321      "error":{
322        "httpStatusCode":400,
323        "senderFault":true
324      },
325      "exception":true
326    },
327    "StatusCode":{
328      "type":"integer",
329      "box":true,
330      "max":599,
331      "min":100
332    },
333    "ThrottlingException":{
334      "type":"structure",
335      "members":{
336        "message":{"shape":"NonBlankString"}
337      },
338      "documentation":"<p>The number of requests exceeds the limit. Resubmit your request later.</p>",
339      "error":{
340        "httpStatusCode":429,
341        "senderFault":true
342      },
343      "exception":true
344    },
345    "ValidationException":{
346      "type":"structure",
347      "members":{
348        "message":{"shape":"NonBlankString"}
349      },
350      "documentation":"<p>Input validation failed. Check your request parameters and retry the request.</p>",
351      "error":{
352        "httpStatusCode":400,
353        "senderFault":true
354      },
355      "exception":true
356    }
357  },
358  "documentation":"<p>Describes the API operations for running inference using Bedrock models.</p>"
359}
360