# Amazon Bedrock

> Run the foundation models in your AWS account through Amazon Bedrock: chat with Amazon Nova, Claude, Llama and more, call any model with its own request, make text embeddings and list the models in your region.

App · 4 actions. Web page: https://docs.lodol.com/docs/integrations/aws-bedrock

## Actions

### Call a model (native request)

Call a Bedrock model with a request in its own format, as its maker documents it, and get its answer back as JSON. For options 'Send a message' does not cover.

**Inputs**

- Model (`model`, text, required): The Bedrock model ID, such as amazon.nova-micro-v1:0, or an inference profile ID starting with a region group like us. or eu. The body must be in this model's own format.
- Request body (`body`, object, required): The model's own request as JSON. For Amazon Nova: {"messages": [{"role": "user", "content": [{"text": "Hello"}]}], "inferenceConfig": {"maxTokens": 200}}.

**Outputs**

- `content_type` (text): The answer's media type.
- `input_tokens` (number): Tokens read, when Bedrock reports them, else null.
- `model` (text): The model ID the step called.
- `output_tokens` (number): Tokens written, when Bedrock reports them, else null.
- `response` (object): The model's answer, decoded from JSON, in the model's own format.

**Example output**

```json
{
  "content_type": "application/json",
  "input_tokens": 5,
  "model": "amazon.nova-micro-v1:0",
  "output_tokens": 8,
  "response": {
    "output": {
      "message": {
        "content": [
          {
            "text": "Hello! How can I help?"
          }
        ],
        "role": "assistant"
      }
    },
    "stopReason": "end_turn",
    "usage": {
      "inputTokens": 5,
      "outputTokens": 8,
      "totalTokens": 13
    }
  }
}
```

### Create embedding

Turn text into an embedding, a list of numbers that places it by meaning, for search, matching or grouping. Uses Amazon Titan Text Embeddings V2 or Cohere Embed.

**Inputs**

- Text (`text`, text, required): The text to embed: up to 50,000 characters for Titan, 2,048 for Cohere.
- Model (`model`, text): The embedding model to use. One of: `amazon.titan-embed-text-v2:0` (Amazon Titan Text Embeddings V2), `cohere.embed-english-v3` (Cohere Embed English v3), `cohere.embed-multilingual-v3` (Cohere Embed Multilingual v3). Default: `amazon.titan-embed-text-v2:0`.
- Dimensions (`dimensions`, text): How many numbers the embedding has, for Titan only. Leave empty for 1024. One of: `1024`, `512`, `256`.
- Normalize (`normalize`, true/false): Scale the embedding to length 1, which suits cosine similarity. Titan only. Default: `true`.
- Used for (`input_type`, text): What the text is for, for Cohere only: a document to search, a search query, or text to classify or cluster. One of: `search_document` (Document to search), `search_query` (Search query), `classification`, `clustering`. Default: `search_document`.

**Outputs**

- `dimensions` (number): How many numbers it has.
- `embedding` (list): The embedding's numbers.
- `input_tokens` (number): Tokens read from the text, when reported, else null.
- `model` (text): The model ID the step called.

**Example output**

```json
{
  "dimensions": 4,
  "embedding": [
    0.0123,
    -0.0456,
    0.0789,
    0.0012
  ],
  "input_tokens": 7,
  "model": "amazon.titan-embed-text-v2:0"
}
```

### List foundation models

List the foundation models Bedrock offers in the connection's region, with what they read and write and how they can be run.

**Inputs**

- Provider (`provider`, text): Only models from this company, such as Amazon, Anthropic or Meta. Leave empty for all.
- Output (`output_modality`, text): Only models that write this. Leave empty for all. One of: `TEXT`, `IMAGE` (Images), `EMBEDDING` (Embeddings).
- Inference type (`inference_type`, text): Only models that run this way: on demand (pay per use) or on provisioned throughput. Leave empty for all. One of: `ON_DEMAND` (On demand), `PROVISIONED`.

**Outputs**

- `count` (number): How many models matched.
- `models` (list): The models, as Bedrock lists them.
- `region` (text): The region listed.

**Example output**

```json
{
  "count": 2,
  "models": [
    {
      "arn": "arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-micro-v1:0",
      "id": "amazon.nova-micro-v1:0",
      "inference_types": [
        "ON_DEMAND",
        "INFERENCE_PROFILE"
      ],
      "input_modalities": [
        "TEXT"
      ],
      "lifecycle_status": "ACTIVE",
      "name": "Nova Micro",
      "output_modalities": [
        "TEXT"
      ],
      "provider": "Amazon",
      "streaming": true
    },
    {
      "arn": "arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0",
      "id": "amazon.titan-embed-text-v2:0",
      "inference_types": [
        "ON_DEMAND"
      ],
      "input_modalities": [
        "TEXT"
      ],
      "lifecycle_status": "ACTIVE",
      "name": "Titan Text Embeddings V2",
      "output_modalities": [
        "EMBEDDING"
      ],
      "provider": "Amazon",
      "streaming": false
    }
  ],
  "region": "us-east-1"
}
```

### Send a message

Send a prompt to a Bedrock chat model, such as Amazon Nova, Claude or Llama, and get its reply. Works the same for every model that supports Bedrock's Converse API.

**Inputs**

- Model (`model`, text, required): The Bedrock model ID, such as amazon.nova-micro-v1:0. Newer models are often reached through an inference profile ID, which starts with a region group like us. or eu. (us.anthropic.claude-sonnet-4-20250514-v1:0). The model must be available to your account in the connection's region.
- Prompt (`prompt`, text, required): What to ask or tell the model.
- System prompt (`system`, text): Instructions that set how the model behaves, such as its role or the format of its answer.
- Earlier messages (`messages`, list): The conversation so far, oldest first, as a list of {"role": "user" or "assistant", "content": "..."}. It must start with a user turn. The prompt is added after it.
- Maximum response length (`max_tokens`, number): The most tokens the reply may use (a token is about three quarters of a word). Leave empty for the model's own default. At least 1.
- Temperature (`temperature`, number): How varied the reply is, from 0 (focused and repeatable) to 1 (more creative). From 0 to 1.
- Top P (`top_p`, number): Only consider the likeliest words that together make up this share of the probability, from 0 to 1. Usually set this or temperature, not both. From 0 to 1.

**Outputs**

- `model` (text): The model ID the step called.
- `stop_reason` (text): Why it stopped: end_turn (finished), max_tokens (hit the length limit), stop_sequence, guardrail_intervened or content_filtered.
- `text` (text): The model's reply.
- `usage` (object): How many tokens the call used, as Bedrock bills them.

**Example output**

```json
{
  "model": "amazon.nova-micro-v1:0",
  "stop_reason": "end_turn",
  "text": "Hello! How can I help you today?",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 10,
    "total_tokens": 22
  }
}
```
