Amazon Bedrock Inference API

Operations for invoking models and running inference.

GitHub OpenAPI
Business capability
Artificial Intelligence Management BC-610.60

Operations 2

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /model/{modelId}/invoke Run inference on a model · Invoke Model #
Ask an LLM
“How do I send a prompt to a foundation model and get the generated text back?”
“Can I apply a guardrail to a model invocation?”
Tell an agent
Invoke model {modelId} with my prompt and return the full response.
Run inference on {modelId} with guardrail {guardrail}.
POST /model/{modelId}/invoke-with-response-stream Stream a model's inference response · Invoke Model With Response Stream #
Ask an LLM
“Can I get a model's output as it generates it, piece by piece?”
“Which models support streaming inference?”
Tell an agent
Stream the output of model {modelId} as it generates.
Invoke {modelId} with streaming enabled and guardrail {guardrail}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/amazon-bedrock:amazon-bedrock-inference-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

amazon-bedrock-inference-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amazon Bedrock Inference API
  version: '2023-04-20'
  description: Generated from AWS's published Smithy model for Amazon Bedrock. 2 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://bedrock-runtime.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /model/{modelId}/invoke:
    post:
      operationId: InvokeModel
      summary: Invoke Model
      description: Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided
        in the request body. You use model inference to generate text, images, and embeddings. For example code, see Invoke
        model code examples in the Amazon Bedrock User Guide. This operation requires permission for the bedrock:InvokeModel
        action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to
        the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource
        through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference
        on specific models. For troubleshooting some of the common errors you might encounter when using the InvokeModel API,
        see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvokeModelResponse'
        '403':
          description: AccessDeniedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '424':
          description: ModelErrorException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelErrorException'
        '429':
          description: ModelNotReadyException; ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelNotReadyException'
        '408':
          description: ModelTimeoutException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelTimeoutException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '400':
          description: ServiceQuotaExceededException; ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '503':
          description: ServiceUnavailableException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableException'
      parameters:
      - name: Content-Type
        in: header
        schema:
          type: string
        description: The MIME type of the input data in the request. You must specify application/json.
      - name: Accept
        in: header
        schema:
          type: string
        description: The desired MIME type of the inference body in the response. The default value is application/json.
      - name: modelId
        in: path
        required: true
        schema:
          type: string
        description: 'The unique identifier of the model to invoke to run inference. The modelId to provide depends on the
          type of model or throughput that you use: If you use a base model, specify the model ID or its ARN. For a list of
          model IDs for base models, see Amazon Bedrock base model IDs (on-demand throughput) in the Amazon Bedrock User Guide.
          If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs,
          see Supported Regions and models for cross-region inference in the Amazon Bedrock User Guide. If you use a provisioned
          model, specify the ARN of the Pro'
      - name: X-Amzn-Bedrock-Trace
        in: header
        schema:
          type: string
          enum:
          - ENABLED
          - DISABLED
          - ENABLED_FULL
        description: Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.
      - name: X-Amzn-Bedrock-GuardrailIdentifier
        in: header
        schema:
          type: string
        description: The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail
          is applied to the invocation. An error will be thrown in the following situations. You don't provide a guardrail
          identifier but you specify the amazon-bedrock-guardrailConfig field in the request body. You enable the guardrail
          but the contentType isn't application/json. You provide a guardrail identifier, but guardrailVersion isn't specified.
      - name: X-Amzn-Bedrock-GuardrailVersion
        in: header
        schema:
          type: string
        description: The version number for the guardrail. The value can also be DRAFT.
      - name: X-Amzn-Bedrock-PerformanceConfig-Latency
        in: header
        schema:
          type: string
          enum:
          - standard
          - optimized
        description: Model performance settings for the request.
      - name: X-Amzn-Bedrock-Service-Tier
        in: header
        schema:
          type: string
          enum:
          - priority
          - default
          - flex
          - reserved
        description: Specifies the processing tier type used for serving the request.
      - name: X-Amzn-Bedrock-Request-Metadata
        in: header
        schema:
          type: string
        description: Key-value pairs that you can use to filter invocation logs.
      requestBody:
        content:
          application/json:
            schema:
              type: string
              format: byte
      tags:
      - Inference
  /model/{modelId}/invoke-with-response-stream:
    post:
      operationId: InvokeModelWithResponseStream
      summary: Invoke Model With Response Stream
      description: Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided
        in the request body. The response is returned in a stream. To see if a model supports streaming, call GetFoundationModel
        and check the responseStreamingSupported field in the response. The CLI doesn't support streaming operations in Amazon
        Bedrock, including InvokeModelWithResponseStream. For example code, see Invoke model with streaming code example in
        the Amazon Bedrock User Guide. This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream
        action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to
        the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource
        through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference
        on specific models. For troubleshooting some of the common errors you might encounter when using the InvokeModelWithResponseStream
        API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvokeModelWithResponseStreamResponse'
        '403':
          description: AccessDeniedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '424':
          description: ModelErrorException; ModelStreamErrorException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelErrorException'
        '429':
          description: ModelNotReadyException; ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelNotReadyException'
        '408':
          description: ModelTimeoutException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelTimeoutException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '400':
          description: ServiceQuotaExceededException; ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '503':
          description: ServiceUnavailableException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableException'
      parameters:
      - name: Content-Type
        in: header
        schema:
          type: string
        description: The MIME type of the input data in the request. You must specify application/json.
      - name: X-Amzn-Bedrock-Accept
        in: header
        schema:
          type: string
        description: The desired MIME type of the inference body in the response. The default value is application/json.
      - name: modelId
        in: path
        required: true
        schema:
          type: string
        description: 'The unique identifier of the model to invoke to run inference. The modelId to provide depends on the
          type of model or throughput that you use: If you use a base model, specify the model ID or its ARN. For a list of
          model IDs for base models, see Amazon Bedrock base model IDs (on-demand throughput) in the Amazon Bedrock User Guide.
          If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs,
          see Supported Regions and models for cross-region inference in the Amazon Bedrock User Guide. If you use a provisioned
          model, specify the ARN of the Pro'
      - name: X-Amzn-Bedrock-Trace
        in: header
        schema:
          type: string
          enum:
          - ENABLED
          - DISABLED
          - ENABLED_FULL
        description: Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.
      - name: X-Amzn-Bedrock-GuardrailIdentifier
        in: header
        schema:
          type: string
        description: The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail
          is applied to the invocation. An error is thrown in the following situations. You don't provide a guardrail identifier
          but you specify the amazon-bedrock-guardrailConfig field in the request body. You enable the guardrail but the contentType
          isn't application/json. You provide a guardrail identifier, but guardrailVersion isn't specified.
      - name: X-Amzn-Bedrock-GuardrailVersion
        in: header
        schema:
          type: string
        description: The version number for the guardrail. The value can also be DRAFT.
      - name: X-Amzn-Bedrock-PerformanceConfig-Latency
        in: header
        schema:
          type: string
          enum:
          - standard
          - optimized
        description: Model performance settings for the request.
      - name: X-Amzn-Bedrock-Service-Tier
        in: header
        schema:
          type: string
          enum:
          - priority
          - default
          - flex
          - reserved
        description: Specifies the processing tier type used for serving the request.
      - name: X-Amzn-Bedrock-Request-Metadata
        in: header
        schema:
          type: string
        description: Key-value pairs that you can use to filter invocation logs.
      requestBody:
        content:
          application/json:
            schema:
              type: string
              format: byte
      tags:
      - Inference
components:
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
        request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: bedrock
  schemas:
    AccessDeniedException:
      type: object
      properties:
        message:
          type: string
    InternalServerException:
      type: object
      properties:
        message:
          type: string
    InvokeModelResponse:
      type: object
      properties:
        body:
          type: string
          format: byte
          description: Inference response from the model in the format specified in the contentType header. To see the format
            and content of the request and response bodies for different models, refer to Inference parameters.
        contentType:
          type: string
          description: The MIME type of the inference result.
        performanceConfigLatency:
          type: string
          enum:
          - standard
          - optimized
          description: Model performance settings for the request.
        serviceTier:
          type: string
          enum:
          - priority
          - default
          - flex
          - reserved
          description: Specifies the processing tier type used for serving the request.
      required:
      - body
      - contentType
    InvokeModelWithResponseStreamResponse:
      type: object
      properties:
        body:
          $ref: '#/components/schemas/ResponseStream'
        contentType:
          type: string
          description: The MIME type of the inference result.
        performanceConfigLatency:
          type: string
          enum:
          - standard
          - optimized
          description: Model performance settings for the request.
        serviceTier:
          type: string
          enum:
          - priority
          - default
          - flex
          - reserved
          description: Specifies the processing tier type used for serving the request.
      required:
      - body
      - contentType
    ModelErrorException:
      type: object
      properties:
        message:
          type: string
        originalStatusCode:
          type: integer
          description: The original status code.
        resourceName:
          type: string
          description: The resource name.
    ModelNotReadyException:
      type: object
      properties:
        message:
          type: string
    ModelStreamErrorException:
      type: object
      properties:
        message:
          type: string
        originalStatusCode:
          type: integer
          description: The original status code.
        originalMessage:
          type: string
          description: The original message.
    ModelTimeoutException:
      type: object
      properties:
        message:
          type: string
    PayloadPart:
      type: object
      properties:
        bytes:
          type: string
          format: byte
          description: Base64-encoded bytes of payload data.
    ResourceNotFoundException:
      type: object
      properties:
        message:
          type: string
    ResponseStream:
      type: object
      properties:
        chunk:
          $ref: '#/components/schemas/PayloadPart'
        internalServerException:
          $ref: '#/components/schemas/InternalServerException'
        modelStreamErrorException:
          $ref: '#/components/schemas/ModelStreamErrorException'
        validationException:
          $ref: '#/components/schemas/ValidationException'
        throttlingException:
          $ref: '#/components/schemas/ThrottlingException'
        modelTimeoutException:
          $ref: '#/components/schemas/ModelTimeoutException'
        serviceUnavailableException:
          $ref: '#/components/schemas/ServiceUnavailableException'
      description: Exactly one member is set.
    ServiceQuotaExceededException:
      type: object
      properties:
        message:
          type: string
    ServiceUnavailableException:
      type: object
      properties:
        message:
          type: string
    ThrottlingException:
      type: object
      properties:
        message:
          type: string
    ValidationException:
      type: object
      properties:
        message:
          type: string
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/bedrock-runtime/service/2023-09-30/bedrock-runtime-2023-09-30.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)