Dataset chats
On this page you add, browse and filter the chats a text project trains on, and turn on auto-save so your own requests become chats.
A chat is one training example: ordered system, user and assistant
messages, plus an optional name, description and tags. Tags are how a training
run selects its chats.
Add chats
Create one chat with POST /api/v1/projects/{owner_slug}/{project_slug}/chats:
{
"name": "returns-001",
"description": "Approved returns answer",
"tags": ["support"],
"messages": [
{"role": "user", "text": "Can I return this?"},
{"role": "assistant", "text": "Yes, within 30 days."}
]
}
To add many at once, send a JSON array of the same chat objects to
POST .../chats/bulk:
[
{"name": "returns-001", "tags": ["support"], "messages": [
{"role": "user", "text": "Can I return this?"},
{"role": "assistant", "text": "Yes, within 30 days."}
]},
{"name": "returns-002", "tags": ["support"], "messages": [
{"role": "user", "text": "Who pays for return shipping?"},
{"role": "assistant", "text": "We do."}
]}
]
The response is {"status": "created", "count": 2}. The batch is checked as a
whole before anything is written, so a refused batch adds nothing. For a large
file, use an import instead: it runs in the background and maps
CSV columns for you.
Limits. Each message's text can be up to 20,480 characters. A project holds
up to 100,000 chats and 500,000 messages in total, whether they were added one
at a time, in bulk or by an import. A create, bulk create or edit that would go
past a limit answers 400 with a message that names it. An account can have up
to 100 active projects by default; see Projects.
Coming from OpenAI?
An OpenAI chat fine-tuning file is JSONL: one conversation per line, as
{"messages": [{"role": ..., "content": ...}]}. The same conversation is one
chat here, with two differences: the text goes in text rather than content,
and a run selects chats by tag rather than by file.
| OpenAI fine-tuning file | ReOpenly |
|---|---|
One line, {"messages": [...]} | One chat object in POST .../chats/bulk |
role: system, user or assistant | The same role |
content as a string | text |
content as a list of parts, tool_calls, tool messages | Not converted by the script below: it skips those conversations |
Other message fields, such as weight | Not carried over |
| The file you pass to the job | The tags you pass as dataset_tags |
This script reads training.jsonl, converts each conversation, and sends them
to POST .../chats/bulk 500 at a time, tagged openai-import, so a run can
select them with "dataset_tags": ["openai-import"]. It needs requests and
REOPENLY_API_KEY in the environment:
import json
import os
import requests
URL = "https://reopenly.com/api/v1/projects/{owner_slug}/{project_slug}/chats/bulk"
HEADERS = {"Authorization": f"Bearer {os.environ['REOPENLY_API_KEY']}"}
ROLES = {"system", "user", "assistant"}
def convert(number, record):
messages = []
for message in record["messages"]:
content = message.get("content")
if message.get("role") not in ROLES or not isinstance(content, str):
return None
messages.append({"role": message["role"], "text": content})
return {"name": f"openai-{number}", "tags": ["openai-import"], "messages": messages}
chats, skipped = [], 0
with open("training.jsonl", encoding="utf-8") as lines:
for number, line in enumerate(lines, 1):
if not line.strip():
continue
chat = convert(number, json.loads(line))
if chat is None:
skipped += 1
else:
chats.append(chat)
for start in range(0, len(chats), 500):
batch = chats[start : start + 500]
response = requests.post(URL, headers=HEADERS, json=batch, timeout=120)
if not response.ok:
raise SystemExit(f"Stopped at chat {start + 1}: {response.text}")
print(response.json())
print(f"Skipped conversations: {skipped}")
Each batch is checked as a whole, so a refused batch adds nothing, but the
batches before it are already saved. If the script stops, fix the file and send
only the remaining batches: sending the whole file again adds the earlier chats
a second time. The limits above apply to the whole project. If
your conversations already carry a system message, do not also send a
system_prompt when you train: the job refuses the two together.
For question and answer pairs in a CSV file, use an import instead.
Save your requests automatically
A text project can save a share of your own requests to its OpenAI-compatible
chat and text completion endpoints as chats. Turn it on for an existing project
by setting inference_save_percent, a fraction from 0 to 1 (0.25 saves
about one request in four, 0 turns saving off):
curl -X PUT "https://reopenly.com/api/v1/projects/acme/support" \
-H "Authorization: Bearer $REOPENLY_API_KEY" \
-H "Content-Type: application/json" \
--data '{"inference_save_percent": 0.25}'
Only the fields you send change; see Projects.
Each saved request becomes a chat with source: "api" and two tags:
inference, and model:<model>, where <model> is the model value the
request sent (for example model:support-assistant). It holds the messages you
sent and the answer you received. Only requests you make as the project owner
are saved: calls from accounts you shared a model with, and public callers,
are never saved. A failed generation is not saved, and embedding projects
never save requests.
To retrain on saved requests, review them on the dataset screen, then select their tag when you start a run (see Training jobs):
{
"dataset_tags": ["model:support-assistant"],
"model_name": "ReOpenly/Qwen3.5-9B",
"num_train_epochs": 3
}
Use ["inference"] instead to select every saved request in the project. To
add saved requests from a file instead, see Dataset imports.
Browse and filter
The list always uses bounded cursor pages. Numbered page and page_size
parameters are not part of this contract:
GET .../chats?limit=25
GET .../chats?limit=25&cursor=<next_cursor>
GET .../chats?limit=25&before=<previous_cursor>
GET .../chats?limit=25&boundary=last
cursor, before and boundary are mutually exclusive and opaque. Cursors
belong to this project. Responses include next_cursor, previous_cursor,
is_last_page, total_count, total_count_capped and search_applied.
Counts are capped at 10,000 rather than scanning an arbitrarily large dataset.
Filters run before pagination:
searchmatches chat names and message text. Terms shorter than two characters are not applied, and terms longer than 128 characters answer422. To search, preferPOST .../chats/searchwith the same fields in a JSON body ({"search": "refund", "tags": ["inbox"], "limit": 25}): a URL is written to access logs and proxies, and a search is your data.searchin the GET URL still works and is deprecated.tagskeeps chats that carry any of the named tags.untagged=truekeeps chats with no tag at all. Withtags, it keeps chats that carry any of the named tags or no tag. It is a filter setting, not a tag name, so a tag you happen to call "No tag" is just a tag.sourceskeeps chats with any of the named sources:csv,api,editororplayground. An unknown value answers422.categorieskeeps chats whose import category matches, ignoring case.
Repeat a parameter to pass several values:
GET .../chats?limit=25&sources=api&tags=inference
GET .../chats/categories returns at most 50 category facets with counts,
most common first. It accepts the same tags, untagged and sources
filters. To narrow it by text, send q with them to
POST .../chats/categories/search (q in the GET URL is deprecated).
Act on many chats at once
Two endpoints delete chats or change their tags over a selection:
POST .../chats/bulk-delete
POST .../chats/bulk-tags
A selection is one of two things:
chat_ids: up to 1,000 chats by id. If any of them is not a chat of this project, the request answers404 chat_not_foundand nothing changes.filter: the same filters as the list (search,tags,untagged,sources,categories), with optionalexclude_ids(up to 1,000) for the chats you unticked. An emptyfilterselects every chat in the project.
Send expected_count with the number you showed the user. If the selection now
has a different size, for example because a saved request arrived after you
counted, the request answers 409 chat_selection_changed with the current
matched count, and nothing changes.
Delete every untagged chat except two:
{
"filter": {"untagged": true},
"exclude_ids": [812, 907],
"expected_count": 1238
}
Tag every chat a search finds, and take another tag off them:
{
"filter": {"search": "refund", "tags": ["inbox"]},
"add_tags": ["refunds"],
"remove_tags": ["inbox"]
}
add_tags creates a tag that does not exist yet. remove_tags must name
existing tags, or the request answers 404 tag_not_found with the missing
names in detail.tags. Each list holds up to 32 names, and a tag cannot be in
both.
The response is the same for both endpoints:
{"action": "delete", "matched": 1238, "affected": 1000, "remaining": 238}
matched is the size of the selection when the call started. affected is how
many chats this call deleted, or how many had their tags changed (a chat that
already had the tags is matched but not affected). Each call changes at most
1,000 chats, in one transaction, so remaining says how many chats of the
selection still need the action. Send the same request again, without
expected_count, until remaining is 0.
The search rule is stricter here than in the list: a term shorter than two
characters answers 422 search_too_short instead of being ignored, because
ignoring it would act on every chat the other filters match. A term over 128
characters answers 422 search_too_long.
Deleting a chat this way is the same as deleting it on its own: its messages and tags go with it and the project's counts drop by the same amount. Chats still inside a running import cannot be selected. A training job that already froze its input keeps the deleted chats in its own copy.
Editing and training
Editing, retagging or deleting a chat, one at a time or in bulk, changes the current dataset, but never rewrites an already-created training job. Before it starts, every job freezes its selected input and train/evaluation membership. Use the job dataset endpoints when you need the exact historical input rather than the current chat.
Reference
GET /api/v1/projects/{owner_slug}/{project_slug}/chats
POST /api/v1/projects/{owner_slug}/{project_slug}/chats
POST /api/v1/projects/{owner_slug}/{project_slug}/chats/bulk
POST /api/v1/projects/{owner_slug}/{project_slug}/chats/bulk-delete
POST /api/v1/projects/{owner_slug}/{project_slug}/chats/bulk-tags
GET /api/v1/projects/{owner_slug}/{project_slug}/chats/{chat_id}
PUT /api/v1/projects/{owner_slug}/{project_slug}/chats/{chat_id}
DELETE /api/v1/projects/{owner_slug}/{project_slug}/chats/{chat_id}
GET /api/v1/projects/{owner_slug}/{project_slug}/chats/categories
GET /api/v1/projects/{owner_slug}/{project_slug}/tags
List and detail responses include a computed message_count, updated_at,
and source. source is csv, api, editor, playground or example
(a chat written by Start from an example). It is null
on chats created before sources were recorded: that means the origin was not
recorded, not that the chat has none. The server sets source from how the
chat was written, so a client cannot choose it, and names or tags are never
used to guess it. A chat saved from the Playground has source: "playground".