---
title: "POST /model-customization-jobs"
method: POST
path: "/model-customization-jobs"
---

# POST /model-customization-jobs

`POST /model-customization-jobs`

Creates a fine-tuning job to customize a base model.

You specify the base foundation model and the location of the training data. After the model-customization job completes successfully, your custom model resource will be ready to use. Amazon Bedrock returns validation loss metrics and output generations after the job completes.

For information on the format of training and validation data, see [Prepare the datasets](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-prepare.html).

Model-customization jobs are asynchronous and the completion time depends on the base model and the training/validation data size. To monitor a job, use the `GetModelCustomizationJob` operation to retrieve the job status.

For more information, see [Custom models](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html) in the [Amazon Bedrock User Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html).

## Request body

- object
  - `jobName` string, required — A name for the fine-tuning job.
  - `customModelName` string, required — A name for the resulting custom model.
  - `roleArn` string, required — The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can assume to perform tasks on your behalf. For example, during model training, Amazon Bedrock needs your permission to read input data from an S3 bucket, write model artifacts to an S3 bucket. To pass this role to Amazon Bedrock, the caller of this API must have the <code>iam:PassRole</code> permission.
  - `clientRequestToken` string — A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.
  - `baseModelIdentifier` string, required — Name of the base model.
  - `customizationType` 'FINE_TUNING' | 'CONTINUED_PRE_TRAINING' | 'DISTILLATION' | 'REINFORCEMENT_FINE_TUNING' | 'IMPORTED' — The customization type.
  - `customModelKmsKeyId` string — The custom model is encrypted at rest using this key.
  - `jobTags` Tag[] — Tags to attach to the job.
    - `key` string, required — Key for the tag.
    - `value` string, required — Value for the tag.
  - `customModelTags` Tag[] — Tags to attach to the resulting custom model.
    - `key` string, required — Key for the tag.
    - `value` string, required — Value for the tag.
  - `trainingDataConfig` object, required — S3 Location of the training data.
    - `s3Uri` string — The S3 URI where the training data is stored.
    - `invocationLogsConfig` object — Settings for using invocation logs to customize a model.
      - `usePromptResponse` boolean — Whether to use the model's response for training, or just the prompt. The default value is <code>False</code>.
      - `invocationLogSource` object, required — The source of the invocation logs.
        - `s3Uri` string — The URI of an invocation log in a bucket.
      - `requestMetadataFilters` object — Rules for filtering invocation logs based on request metadata.
        - `equals` object — Include results where the key equals the value.
        - `notEquals` object — Include results where the key does not equal the value.
        - `andAll` RequestMetadataBaseFilters[] — Include results where all of the based filters match.
          - `equals` object — Include results where the key equals the value.
          - `notEquals` object — Include results where the key does not equal the value.
        - `orAll` RequestMetadataBaseFilters[] — Include results where any of the base filters match.
          - `equals` object — Include results where the key equals the value.
          - `notEquals` object — Include results where the key does not equal the value.
  - `validationDataConfig` object — Array of up to 10 validators.
    - `validators` Validator[] — Information about the validators.
      - `s3Uri` string, required — The S3 URI where the validation data is stored.
  - `outputDataConfig` object, required — S3 Location of the output data.
    - `s3Uri` string — The S3 URI where the output data is stored.
  - `hyperParameters` object — Parameters related to tuning the model. For details on the format for different models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html">Custom model hyperparameters</a>.
  - `vpcConfig` object — The configuration of a virtual private cloud (VPC). For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/usingVPC.html">Protect your data using Amazon Virtual Private Cloud and Amazon Web Services PrivateLink</a>.
    - `subnetIds` SubnetId[] — An array of IDs for each subnet in the VPC to use.
    - `securityGroupIds` SecurityGroupId[] — An array of IDs for each security group in the VPC to use.
  - `customizationConfig` object — A model customization configuration
    - `distillationConfig` object — The Distillation configuration for the custom model.
      - `teacherModelConfig` object, required — The teacher model configuration.
        - `teacherModelIdentifier` string, required — The identifier of the teacher model.
        - `maxResponseLengthForInference` integer — The maximum number of tokens requested when the customization job invokes the teacher model.
    - `rftConfig` object — Configuration settings for reinforcement fine-tuning (RFT) model customization, including grader configuration and hyperparameters.
      - `graderConfig` object — Configuration for the grader that evaluates model responses and provides reward signals during RFT training.
        - `lambdaGrader` object — Configuration for using an AWS Lambda function as the grader for evaluating model responses and provide reward signals in reinforcement fine-tuning.
          - `lambdaArn` string, required — ARN of the AWS Lambda function that will evaluate model responses and return reward scores for RFT training.
      - `hyperParameters` object — Hyperparameters that control the reinforcement fine-tuning training process, including learning rate, batch size, and epoch count.
        - `epochCount` integer — Number of training epochs to run during reinforcement fine-tuning. Higher values may improve performance but increase training time.
        - `batchSize` integer — Number of training samples processed in each batch during reinforcement fine-tuning (RFT) training. Larger batches may improve training stability.
        - `learningRate` number, float — Learning rate for the reinforcement fine-tuning. Controls how quickly the model adapts to reward signals.
        - `maxPromptLength` integer — Maximum length of input prompts during RFT training, measured in tokens. Longer prompts allow more context but increase memory usage and training-time.
        - `trainingSamplePerPrompt` integer — Number of response samples generated per prompt during RFT training. More samples provide better reward signal estimation.
        - `inferenceMaxTokens` integer — Maximum number of tokens the model can generate in response to each prompt during RFT training.
        - `reasoningEffort` 'low' | 'medium' | 'high' — Level of reasoning effort applied during RFT training. Higher values may improve response quality but increase training time.
        - `evalInterval` integer — Interval between evaluation runs during RFT training, measured in training steps. More frequent evaluation provides better monitoring.

## Response `201`

Success

- CreateModelCustomizationJobResponse
  - `jobArn` string, required — Amazon Resource Name (ARN) of the fine tuning job

## Other responses

- `480` — ResourceNotFoundException
- `481` — AccessDeniedException
- `482` — ValidationException
- `483` — ConflictException
- `484` — InternalServerException
- `485` — TooManyTagsException
- `486` — ServiceQuotaExceededException
- `487` — ThrottlingException

---

[API](https://skmtc.net/aws/apis/bedrock.md) · [All operations](https://skmtc.net/aws/apis/bedrock/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/bedrock/versions/3bc874e43ecd/schema)
