> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.loreos.app/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.loreos.app/_mcp/server.

# Create Conversation Eval

POST https://api.loreos.app/v1/characters/{slug}/conversation-evals
Content-Type: application/json

Create the built-in Conversation Eval that uses the real reply engine.

Use this operation when you need an actual scripted dialogue, not the static authored-config
check at POST /characters/\{slug}/evals. It scores deterministic assertions
(forbidden-leakage / memory-recall / per-turn contains) plus LLM-judge rubrics. Async: returns
an eval\_id; poll get\_conversation\_eval for the terminal result, transcript, and scored report.

Reference: https://docs.loreos.app/api-reference/evals/create-conversation-eval

## Authentication

- `Authorization` header (bearer token, required) — LoreOS runtime API key (`ck_...`), sent as `Authorization: Bearer <key>`.

## Servers

- `https://api.loreos.app` (Production, default)
- `http://127.0.0.1:8000` (Local development)

## Request

### Path parameters

- `slug` (string, required)

### Body (application/json)

This endpoint expects a V1ConversationEvalRequest.

- `name` (string, required)
- `turns` (list of ConvTurn, required)
- `seed_context` (list of V1ContextEvent, optional, nullable) — Context events planted before turn 1 (e.g. a fact to test leak).
- `assertions` (ConvAssertions, optional)
- `reply_mode` (enum, optional, default: deep)
  - Allowed values: `fast`, `deep`

## Response

### 200

Successful Response

- `schema_version` ("v0", required) — LoreOS success-envelope version.
- `data` (ConversationEvalCreateData, required)
- `next_actions` (list of V1NextAction, required) — Concrete follow-up API actions; empty when no action is required.

## Errors

### 401 Unauthorized Error

Runtime API key is missing, invalid, expired, or revoked.

- `detail` (V1ErrorDetail, required) — Stable public error core; domain-specific fields may be added alongside it.

### 404 Not Found Error

Character not found in the caller's app.

- `detail` (V1ErrorDetail, required) — Stable public error core; domain-specific fields may be added alongside it.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ConvTurn

- `user_text` (string, required)
- `expect_contains` (list of string, optional, nullable) — This turn's reply SHOULD contain each of these substrings.
- `expect_not_contains` (list of string, optional, nullable) — This turn's reply must NOT contain any of these substrings.

### V1ContextEvent

One typed, visibility-scoped context push for a session.

- `source` (string, optional, nullable) — Free provenance label.
- `speakable_facts` (list of string, optional) — Facts the character MAY say.
- `private_facts` (list of string, optional) — Shape the reply; never spoken.
- `forbidden_to_reveal` (list of string, optional) — Must NOT surface, even if asked.
- `memory_candidates` (list of string, optional) — Proposed to the persistent world model (the engine's critics decide).
- `ttl_seconds` (integer, optional, nullable) — Active window; default ~10 min.
- `permanent` (boolean, optional, default: false) — If true, active until explicitly deleted instead of TTL expiry.
- `priority` (double, optional, default: 0.5) — Ranking when context is abundant.
- `idempotency_key` (string, optional, nullable)
- `relationship_context_key` (string, optional, nullable)

### ConvAssertions

- `memory_recall` (list of string, optional) — Facts a later reply must reference (deterministic).
- `forbidden_leakage` (list of string, optional) — Facts that must NEVER appear in a reply (deterministic).
- `tone` (string, optional, nullable) — LLM-judge rubric: is every reply in-voice?
- `relationship_pace` (string, optional, nullable) — LLM-judge rubric: does the relational tenor move believably?

### ConversationEvalCreateData

- `eval_id` (string, required)
- `slug` (string, required)
- `status` ("queued", required)
- `character_version_id` (string, required)
- `character_version_number` (integer, required)

### V1NextAction

- `command` (string, required) — The next API command an agent can execute.
- `description` (string, required) — Why or when to execute the command.

### V1ErrorDetail

Stable public error core; domain-specific fields may be added alongside it.

- `code` (string, required)
- `message` (string, required)
- `fix` (string, required)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Request**

```json
{
  "name": "string",
  "turns": [
    {
      "user_text": "string"
    }
  ]
}
```

**Response**

```json
{
  "schema_version": "string",
  "data": {
    "eval_id": "string",
    "slug": "string",
    "status": "string",
    "character_version_id": "string",
    "character_version_number": 1
  },
  "next_actions": [
    {
      "command": "string",
      "description": "string"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.loreos.app/v1/characters/slug/conversation-evals"

payload = {
    "name": "string",
    "turns": [{ "user_text": "string" }]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.loreos.app/v1/characters/slug/conversation-evals';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"string","turns":[{"user_text":"string"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.loreos.app/v1/characters/slug/conversation-evals"

	payload := strings.NewReader("{\n  \"name\": \"string\",\n  \"turns\": [\n    {\n      \"user_text\": \"string\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.loreos.app/v1/characters/slug/conversation-evals")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"string\",\n  \"turns\": [\n    {\n      \"user_text\": \"string\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.loreos.app/v1/characters/slug/conversation-evals")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"string\",\n  \"turns\": [\n    {\n      \"user_text\": \"string\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.loreos.app/v1/characters/slug/conversation-evals', [
  'body' => '{
  "name": "string",
  "turns": [
    {
      "user_text": "string"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.loreos.app/v1/characters/slug/conversation-evals");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"string\",\n  \"turns\": [\n    {\n      \"user_text\": \"string\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "string",
  "turns": [["user_text": "string"]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.loreos.app/v1/characters/slug/conversation-evals")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```