Zatomic API

Improve Version

Creates a new version of the prompt based on either its scoring analysis or risk analysis.

The request supports a source value, which determines if the improvement will be based on the prompt's scoring analysis or its risk analysis.

You can also add a settings object to the request that specifies which AI model and provider you want to use to improve the prompt. If settings is given in the request, the model_source and model_id are required.

The model_source field specifies where the model comes from. When using models from your own AI providers, use the value provider; otherwise, use zatomic.

If provider_id is given and the provider is for Amazon Bedrock, then the aws_region is required and must be the region where the model is located.

You can find model IDs in the model catalog and provider IDs in your Zatomic account.

Endpoint
POST https://api.zatomic.ai/v1/prompts/{promptId}/versions/{versionId}/improve

// Example
POST https://api.zatomic.ai/v1/prompts/prm_2qRzu8geIvfudcJTwP0pur4TbMJ/versions/ver_2qRzu8qzlNOMhTrini2EKCDh5r6/improve

Endpoint Request

Request Properties
source
string, optional
The analysis source for the improvement. If given must be scoring or risk. If not given defaults to scoring.
settings
object, optional

Properties for the object:

model_source
string
The source of the model.
model_id
string
The ID of the AI model to use for the improvement.
provider_id
string, optional
The ID of the AI provider that contains the model to use for the improvement.
aws_region
string, optional
The AWS region where the model resides. Required if the given provider is Amazon Bedrock.
Request Body
{
   "source": "scoring|risk",
   "settings": {
      "model_source": "zatomic|provider",
      "model_id": "aim_2y2eRWI32fN0CB7a5wE7RuvhVMv"
      "provider_id": "aap_2zFxUYe3RINnOr37VQwHDFF3gK3",
      "aws_region": "us-east-1"
   }
}

Endpoint Response

A successful call returns a response that contains the newly improved version object.

HTTP Status Codes
201 Created The version was improved.
400 Bad Request If settings is given in the request but does not contain a model source.
400 Bad Request If settings is given in the request but does not contain a model ID.
400 Bad Request If a model is given in the settings but it is invalid.
400 Bad Request If model source is "provider" in the settings but does not contain a provider ID.
400 Bad Request If a provider is given in the settings but it is invalid.
400 Bad Request If Amazon Bedrock provider is given in the settings but does not contain an AWS region.
403 Forbidden The prompt action limit has been reached for the account.
404 Not Found The prompt didn't exist.
404 Not Found The version didn't exist.
500 Internal Server Error Something went wrong on Zatomic's end.