Skip to main content
Invokes an Amazon AWS Bedrock model and returns the raw response payload as a JSON string (TEXT). To use the function, provide the model identifier, the request body as serialized JSON, and a LOCATION that holds AWS credentials. For setup guidance and end-to-end examples, see Getting started with AI.

Syntax

Parameters

Make sure the request JSON matches the syntax required by the model you select. See the Amazon Bedrock model parameters documentation for details.

Return Type

TEXT
  • Returns the raw Bedrock response payload as a JSON string.
  • If <request> is NULL, the function returns NULL.

LLM Token Budget

The daily LLM token budget for each account is governed by the ALTER ACCOUNT SET LLM_TOKEN_BUDGET command. If your account exceeds its allotted token budget, invocations of AWS_BEDROCK_AI_QUERY will fail until the budget is increased or the daily limit resets. The current limit and daily usage of the LLM token budget can be viewed in information_schema.quotas. Counting tokens is done in a “best effort” manner. Some models provide the token count in the response, while others don’t. For those that don’t Firebolt estimates the token count. Supported model list:
LLM token budget accounting is not available in Firebolt Core.

Examples

Create a LOCATION with role ARN

For role-based AWS access you can additionally set an external ID. An external ID is a value you choose and control that AWS checks when Firebolt assumes your role, adding a second condition on top of your account’s unique IAM principal. Configuring one is a recommended best practice. See IAM roles.
For details on creating a Bedrock LOCATION, see CREATE LOCATION (Amazon Bedrock).

Invoke a model using the LOCATION

Returns (example shape):

Invoking the LLM on multiple values

Returns

Sentiment analysis

Returns

Check your LLM token quota usage

Look for the LLM_TOKEN_BUDGET row to view current usage and limits.