curl --request POST \
--url https://api.getbluejay.ai/v1/create-custom-metrics \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"metrics": [
{
"name": "<string>",
"description": "<string>",
"response_type": "pass_fail",
"agent_id": 123,
"agent_ids": [
123
],
"min_value": 123,
"max_value": 123,
"category": "<string>",
"tags": [
"<string>"
],
"scoring_guidance": "<string>",
"eval_route": "AUTO",
"model": "<string>",
"audio_model": "<string>",
"temperature": 123,
"enum_options": [
"<string>"
],
"allow_not_applicable": false
}
]
}
'{
"metrics": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"response_type": "pass_fail",
"created_at": "2023-11-07T05:31:56Z",
"agent_ids": [
123
],
"min_value": 123,
"max_value": 123,
"category": "<string>",
"tags": [
"<string>"
],
"scoring_guidance": "<string>",
"eval_route": "AUDIO",
"model": "<string>",
"audio_model": "<string>",
"temperature": 123,
"enum_options": [
"<string>"
],
"allow_not_applicable": false
}
]
}Create multiple custom metrics synchronously using a single bulk insert.
curl --request POST \
--url https://api.getbluejay.ai/v1/create-custom-metrics \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"metrics": [
{
"name": "<string>",
"description": "<string>",
"response_type": "pass_fail",
"agent_id": 123,
"agent_ids": [
123
],
"min_value": 123,
"max_value": 123,
"category": "<string>",
"tags": [
"<string>"
],
"scoring_guidance": "<string>",
"eval_route": "AUTO",
"model": "<string>",
"audio_model": "<string>",
"temperature": 123,
"enum_options": [
"<string>"
],
"allow_not_applicable": false
}
]
}
'{
"metrics": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"response_type": "pass_fail",
"created_at": "2023-11-07T05:31:56Z",
"agent_ids": [
123
],
"min_value": 123,
"max_value": 123,
"category": "<string>",
"tags": [
"<string>"
],
"scoring_guidance": "<string>",
"eval_route": "AUDIO",
"model": "<string>",
"audio_model": "<string>",
"temperature": 123,
"enum_options": [
"<string>"
],
"allow_not_applicable": false
}
]
}# Bluejay — Testing & Monitoring Platform for Conversational AI Agents
You are a senior backend engineer integrating the Bluejay API. Think step-by-step: first understand the endpoint, then plan the integration, then implement with minimal changes.
## Create Custom Metrics — POST /v1/create-custom-metrics
> **What this endpoint does:** Create multiple custom metrics synchronously using a single bulk insert.
**Endpoint:** POST `https://api.getbluejay.ai/v1/create-custom-metrics`
**Auth:** `X-API-Key` header
**Content-Type:** application/json
### Required Parameters
| Name | Type | Description |
|------|------|-------------|
| X-API-Key | string | API key required to authenticate requests. |
| metrics | array[object] | List of custom metrics to create |
### Request Body (required fields)
```json
{
"metrics": [
{
"agent_id": 123,
"agent_ids": [
123
],
"name": "example_name",
"description": "string",
"response_type": "pass_fail",
"min_value": 1.0,
"max_value": 1.0,
"category": "string",
"tags": [
"string"
],
"scoring_guidance": "string",
"eval_route": "AUDIO",
"model": "string",
"temperature": 1.0,
"enum_options": [
"string"
],
"allow_not_applicable": false
}
]
}
```
Refer to the full schema at https://docs.getbluejay.ai/api-reference/endpoint/create-custom-metrics. Include optional fields that serve the goal of setting up for testing and monitoring on Bluejay.
### Example
**POST with body:**
```python
import requests
def create_custom_metrics(payload: dict, api_key: str) -> dict:
url = "https://api.getbluejay.ai/v1/create-custom-metrics"
headers = {"X-API-Key": api_key}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
return response.json()
```
### Constraints
- Minimal changes — only add/change files needed for this integration.
- Match existing codebase patterns (naming, file structure, error handling).
- Include error handling for 422: Validation Error.
### Integration Checklist
Before writing code, verify:
1. Which module/service owns this API domain in the codebase?
2. What HTTP client and error-handling patterns does the project use?
3. Are there existing types/interfaces to extend?
Then implement the integration, export it, and confirm it compiles/passes lint.
API key required to authenticate requests.
Request model for creating multiple custom metrics
List of custom metrics to create
Show child attributes
Successful Response
Response model for bulk creating custom metrics
List of created custom metrics
Show child attributes