v3

latestOpenAPI 3.1.02026-07-311,4541,5202.3 MB
scores

Create Span Score

Create and list scores for a specific log

Endpoints: GET /api/logs/{log_id}/scores/ - List all scores for a log POST /api/logs/{log_id}/scores/ - Create a new score for a log

Args (POST): - evaluator_id (Optional): The ID of the Keywords AI evaluator to associate with - evaluator_slug (Optional): The slug of a custom evaluator (required if evaluator_id not provided) - numerical_value (Optional): The numerical score value - string_value (Optional): The string score value - boolean_value (Optional): The boolean score value - categorical_value (Optional): The categorical score values (list of strings)

Returns (POST): { "id": "eval_result_unique_id", "created_at": "2024-01-15T10:30:00Z", "type": "llm", "environment": "test", "numerical_value": 4.5, "string_value": "Good quality", "boolean_value": true, "categorical_value": ["excellent"], "is_passed": false, "cost": 0.0, "evaluator_id": null, "evaluator_slug": "custom_evaluator", "log_id": null, "dataset_id": null }

Returns (GET): { "count": 2, "next": null, "previous": null, "results": [ { "id": "eval_result_unique_id_1", "created_at": "2024-01-15T10:30:00Z", "type": "llm", "environment": "test", "numerical_value": 4.5, "string_value": "Good quality", "boolean_value": true, "categorical_value": ["excellent"], "is_passed": false, "cost": 0.0, "evaluator_id": null, "evaluator_slug": "custom_evaluator", "log_id": "log_unique_id", "dataset_id": null } ] }

post/api/logs/{log_id}/scores/

Path parameters

log_idstring required

Headers

Authorizationstring required

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

Request body

organizationinteger required
unique_organization_idstring
type'llm' | 'code' | 'human' | 'function' | 'human_numerical' | 'human_categorical' | 'human_boolean' | 'human_text' | 'custom'
  • llm - Llm
  • code - Code
  • human - Human
  • function - Function
  • human_numerical - Human Numerical
  • human_categorical - Human Categorical
  • human_boolean - Human Boolean
  • human_text - Human Text
  • custom - Custom
environmentstring
numerical_valuenumber double
string_valuestring
boolean_valueboolean nullable
categorical_valuestring[]
json_valuestring
is_passedboolean
costnumber double
evaluator_idstring
evaluator_slugstring
log_idstring
prompt_idstring
prompt_version_numberinteger
dataset_idstring
status'pending' | 'completed' | 'failed'
  • pending - Pending
  • completed - Completed
  • failed - Failed
error_messagestring nullable

Response

idstring required
created_atstring date-time required
updated_byinteger nullable required
type'llm' | 'code' | 'human' | 'function' | 'human_numerical' | 'human_categorical' | 'human_boolean' | 'human_text' | 'custom'
  • llm - Llm
  • code - Code
  • human - Human
  • function - Function
  • human_numerical - Human Numerical
  • human_categorical - Human Categorical
  • human_boolean - Human Boolean
  • human_text - Human Text
  • custom - Custom
environmentstring
numerical_valuenumber double
string_valuestring
boolean_valueboolean nullable
categorical_valuestring[]
json_valuestring
is_passedboolean
costnumber double
evaluator_idstring
evaluator_slugstring
scorerstring required
log_idstring
prompt_idstring
prompt_version_numberinteger
dataset_idstring
status'pending' | 'completed' | 'failed'
  • pending - Pending
  • completed - Completed
  • failed - Failed
error_messagestring nullable