Courseiva
Applications of Foundation ModelseasyMultiple ChoiceObjective-mapped

AIF-C01 Applications of Foundation Models Practice Question

Exhibit

Refer to the exhibit.

error: text generation failed with status code 400
{
  "error": {
    "message": "The model 'ai21.j2-mid-v1' does not support the 'maxTokens' parameter. Use 'maxTokens' with supported models or remove it.",
    "type": "invalid_request_error"
  }
}

A developer is calling the Amazon Bedrock InvokeModel API to generate text with the AI21 Labs Jurassic-2 Mid model. The API call includes a maxTokens parameter, but the request fails with the error shown in the exhibit. What is the most likely cause of this error?

⚠ Common exam trap

The AIF-C01 exam often tests the nuance that model-specific parameter names must match exactly, including case sensitivity, and candidates mistakenly assume all Bedrock models use the same parameter naming convention.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The parameter name is incorrect; the model expects 'maxTokens' with a capital T.

The AI21 Labs Jurassic-2 Mid model expects the parameter name 'maxTokens' with a capital 'T' (camelCase). The error occurs because the API request used a different casing (e.g., 'maxtokens' or 'max_tokens'), which the model's schema does not recognize. Amazon Bedrock's InvokeModel API passes parameters directly to the model, so parameter names must match the model's exact specification.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The API request is missing a required parameter such as 'prompt'.

    Why it's wrong here

    The error specifically mentions the 'maxTokens' parameter, not a missing required parameter.

  • The AWS region does not support the AI21 Labs model.

    Why it's wrong here

    The error is a client-side 400 error, not a regional availability issue.

  • The value of 'maxTokens' exceeds the model's maximum limit.

    Why it's wrong here

    The error states the parameter is not supported, not that the value is out of range.

  • The parameter name is incorrect; the model expects 'maxTokens' with a capital T.

    Why this is correct

    Jurassic-2 Mid uses 'maxTokens' (capital T) as the parameter name for controlling output length.

About these practice questions

Courseiva writes every AIF-C01 question from scratch — 619 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AIF-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AIF-C01 exam.