Create Eval
Create a new eval using an eval type configuration.
Args: eval_request (Eval): Data for the eval to create, including eval type and configuration.
Returns: Eval: The created eval object.
Raises: AymaraAPIError: If the workspace is not found or the request is invalid.
Example: POST /api/evals { "eval_type": "...", "workspace_uuid": "...", ... }
Body
Required
-
eval_uuid
string | null -
name
string | null -
ai_description
string Required Description of the AI under evaluation.
-
ai_instructions
string | null -
eval_type
string Required Type of the eval (safety, accuracy, etc.)
-
eval_instructions
string | null -
language
string | null Default value is
en
. -
modality
string Content type for AI interactions.
Values are
text
orimage
. Default value istext
. ground_truth
string | null | object Ground truth data or reference file, if any.
-
num_prompts
integer | null Default value is
100
. -
prompt_examples
array[object] | null -
is_jailbreak
boolean Indicates if the eval is a jailbreak test.
Default value is
false
. -
is_sandbox
boolean Indicates if the eval results are sandboxed.
Default value is
false
. -
workspace_uuid
string | null -
status
string | null Resource status.
Values are
created
,processing
,finished
, orfailed
. -
created_at
string(date-time) | null -
updated_at
string(date-time) | null
Responses
-
201 application/json
Created
-
400 application/json
Bad Request
-
401 application/json
Unauthorized
-
403 application/json
Forbidden
-
404 application/json
Not Found
-
409 application/json
Conflict
-
422 application/json
Unprocessable Entity
-
429 application/json
Too Many Requests
-
500 application/json
Internal Server Error
-
503 application/json
Service Unavailable
import os
from aymara_ai import AymaraAI
client = AymaraAI(
api_key=os.environ.get("AYMARA_AI_API_KEY"), # This is the default and can be omitted
)
eval = client.evals.create(
ai_description="ai_description",
eval_type="eval_type",
)
print(eval.eval_uuid)
curl \
--request POST 'https://api.aymara.ai/v2/evals' \
--header "x-api-key: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"eval_uuid":"string","name":"string","ai_description":"string","ai_instructions":"string","eval_type":"string","eval_instructions":"string","language":"en","modality":"text","ground_truth":"string","num_prompts":100,"prompt_examples":[{"content":"string","example_uuid":"string","type":"good","explanation":"string"}],"is_jailbreak":false,"is_sandbox":false,"workspace_uuid":"string","status":"created","created_at":"2025-05-04T09:42:00Z","updated_at":"2025-05-04T09:42:00Z"}'
{
"eval_uuid": "string",
"name": "string",
"ai_description": "string",
"ai_instructions": "string",
"eval_type": "string",
"eval_instructions": "string",
"language": "en",
"modality": "text",
"ground_truth": "string",
"num_prompts": 100,
"prompt_examples": [
{
"content": "string",
"example_uuid": "string",
"type": "good",
"explanation": "string"
}
],
"is_jailbreak": false,
"is_sandbox": false,
"workspace_uuid": "string",
"status": "created",
"created_at": "2025-05-04T09:42:00Z",
"updated_at": "2025-05-04T09:42:00Z"
}
{
"eval_uuid": "string",
"name": "string",
"ai_description": "string",
"ai_instructions": "string",
"eval_type": "string",
"eval_instructions": "string",
"language": "en",
"modality": "text",
"ground_truth": "string",
"num_prompts": 100,
"prompt_examples": [
{
"content": "string",
"example_uuid": "string",
"type": "good",
"explanation": "string"
}
],
"is_jailbreak": false,
"is_sandbox": false,
"workspace_uuid": "string",
"status": "created",
"created_at": "2025-05-04T09:42:00Z",
"updated_at": "2025-05-04T09:42:00Z"
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}