Evals
Re-evaluate an existing transcript
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/agents/string/eval-only" \ -H "Content-Type: application/json" \ -d '{ "source_run_id": "string", "template_id": "string" }'{
"$schema": "/api/v1/schemas/RunningBody.json",
"run_id": "string",
"status": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Evaluate an agent conversation
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/agents/string/evaluate" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "content": "string", "role": "string" } ], "template_id": "string" }'{
"$schema": "/api/v1/schemas/EvaluateAcceptedBody.json",
"run_id": "string",
"status": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Run simulation and evaluation
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/agents/string/run-eval" \ -H "Content-Type: application/json" \ -d '{ "template_id": "string" }'{
"$schema": "/api/v1/schemas/RunningBody.json",
"run_id": "string",
"status": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Run an agent simulation
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/agents/string/simulate" \ -H "Content-Type: application/json" \ -d '{}'{
"$schema": "/api/v1/schemas/SimulateRunningBody.json",
"run_id": "string",
"status": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}List eval runs
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Query Parameters
Filter by agent ID
Items per page (default 20)
20int64Pagination offset
0int64Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/eval-runs"{
"$schema": "/api/v1/schemas/ListEvalRunsOutputBody.json",
"runs": [
{
"$schema": "/api/v1/schemas/EvalRun.json",
"adaptation_result": null,
"adaptation_template_id": "string",
"adaptation_template_snapshot": null,
"agent_id": "string",
"agent_name": "string",
"character_config": null,
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"error_reason": "string",
"evaluation_cost_usd": 0.1,
"evaluation_result": null,
"project_id": "string",
"run_id": "string",
"simulated_minutes": 0,
"simulation_config": null,
"simulation_cost_usd": 0.1,
"simulation_model": "string",
"simulation_state": null,
"started_at": "2019-08-24T14:15:22Z",
"status": "string",
"template_id": "string",
"template_snapshot": null,
"tenant_id": "string",
"total_cost_usd": 0.1,
"total_sessions": 0,
"total_turns": 0,
"transcript": null,
"user_persona": null
}
],
"total_count": 0
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Get an eval run
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Eval run UUID
Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/eval-runs/string"{
"$schema": "/api/v1/schemas/EvalRun.json",
"adaptation_result": null,
"adaptation_template_id": "string",
"adaptation_template_snapshot": null,
"agent_id": "string",
"agent_name": "string",
"character_config": null,
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"error_reason": "string",
"evaluation_cost_usd": 0.1,
"evaluation_result": null,
"project_id": "string",
"run_id": "string",
"simulated_minutes": 0,
"simulation_config": null,
"simulation_cost_usd": 0.1,
"simulation_model": "string",
"simulation_state": null,
"started_at": "2019-08-24T14:15:22Z",
"status": "string",
"template_id": "string",
"template_snapshot": null,
"tenant_id": "string",
"total_cost_usd": 0.1,
"total_sessions": 0,
"total_turns": 0,
"transcript": null,
"user_persona": null
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Delete an eval run
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Eval run UUID
Response Body
application/json
application/problem+json
curl -X DELETE "https://loading/api/v1/eval-runs/string"{
"$schema": "/api/v1/schemas/DeleteEvalRunOutputBody.json",
"success": true
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Stream eval run events (SSE)
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Eval run UUID
Query Parameters
Event index to stream from (default 0)
0int64Response Body
text/event-stream
application/problem+json
curl -X GET "https://loading/api/v1/eval-runs/string/events"{
"$schema": "/api/v1/schemas/EvalRunEvent.json",
"adaptation_result": null,
"error_reason": "string",
"evaluation_result": null,
"status": "string",
"type": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}List eval templates
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Query Parameters
Filter by template type (e.g. quality, adaptation)
Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/eval-templates"{
"$schema": "/api/v1/schemas/ListEvalTemplatesOutputBody.json",
"templates": [
{
"$schema": "/api/v1/schemas/EvalTemplate.json",
"categories": [
{
"key": "string",
"label": "string",
"prompt_instructions": "string"
}
],
"created_at": "2019-08-24T14:15:22Z",
"description": "string",
"is_system": true,
"judge_model": "string",
"max_tokens": 0,
"name": "string",
"scoring_rubric": "string",
"temperature": 0.1,
"template_id": "string",
"template_type": "string",
"tenant_id": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
]
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Create an eval template
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/eval-templates" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{
"$schema": "/api/v1/schemas/EvalTemplate.json",
"categories": [
{
"key": "string",
"label": "string",
"prompt_instructions": "string"
}
],
"created_at": "2019-08-24T14:15:22Z",
"description": "string",
"is_system": true,
"judge_model": "string",
"max_tokens": 0,
"name": "string",
"scoring_rubric": "string",
"temperature": 0.1,
"template_id": "string",
"template_type": "string",
"tenant_id": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Get an eval template
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Template UUID
Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/eval-templates/string"{
"$schema": "/api/v1/schemas/EvalTemplate.json",
"categories": [
{
"key": "string",
"label": "string",
"prompt_instructions": "string"
}
],
"created_at": "2019-08-24T14:15:22Z",
"description": "string",
"is_system": true,
"judge_model": "string",
"max_tokens": 0,
"name": "string",
"scoring_rubric": "string",
"temperature": 0.1,
"template_id": "string",
"template_type": "string",
"tenant_id": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Delete an eval template
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Template UUID
Response Body
application/json
application/problem+json
curl -X DELETE "https://loading/api/v1/eval-templates/string"{
"$schema": "/api/v1/schemas/DeleteEvalTemplateOutputBody.json",
"success": true
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Update an eval template
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Template UUID
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X PUT "https://loading/api/v1/eval-templates/string" \ -H "Content-Type: application/json" \ -d '{}'{
"$schema": "/api/v1/schemas/EvalTemplate.json",
"categories": [
{
"key": "string",
"label": "string",
"prompt_instructions": "string"
}
],
"created_at": "2019-08-24T14:15:22Z",
"description": "string",
"is_system": true,
"judge_model": "string",
"max_tokens": 0,
"name": "string",
"scoring_rubric": "string",
"temperature": 0.1,
"template_id": "string",
"template_type": "string",
"tenant_id": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}