---
title: "Invoke Model With Raw Input"
method: POST
path: "/model/invoke_with_raw_input"
tags: ["Model Invocation"]
---

# Invoke Model With Raw Input

`POST /model/invoke_with_raw_input`

## Endpoint to Invoke a Model on Bedrock with Raw Input
This endpoint allows users to invoke a model on Bedrock with raw input.

***

#### Request Body

| Parameter | Type   | Description                                                                     |
|-----------|--------|---------------------------------------------------------------------------------|
| model_id  | str    | The ID of the model to invoke.                                                  |
| raw_input | dict   | The raw input for the model. Please check Bedrock documentation for model-specific input format. |

***

#### Response Body

| Field          | Type   | Description                          |
|----------------|--------|--------------------------------------|
| output_text    | str    | The generated text.                  |
| input_tokens   | str    | The number of input tokens used.     |
| output_tokens  | str    | The number of output tokens generated.|

***

#### Errors

- **400 Bad Request**: If the request parameters are invalid.
- **401 Unauthorized**: If the authorization header is missing or invalid.
- **500 Internal Server Error**: If there is an unexpected error during model invocation.


***


#### Notes

## Request body

- InvokeModelWithRawInputRequest
  - `model_id` string, required
  - `raw_input` object, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/aws-samples/apis/generative-ai-foundational-platform-api.md) · [All operations](https://skmtc.dev/aws-samples/apis/generative-ai-foundational-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/aws-samples/generative-ai-foundational-platform-api/revisions/8831d08902e9/schema)
