For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DiscordPlatform
DocumentationIntegrationsAPI referenceSDKsChangelog
DocumentationIntegrationsAPI referenceSDKsChangelog
  • API Reference
      • POSTCreate a dataset
      • POSTList datasets
      • GETRetrieve a dataset
      • PATCHUpdate a dataset
      • DELDelete a dataset
      • POSTCreate a dataset log
      • POSTList dataset logs
      • GETRetrieve a dataset log
      • PATCHUpdate a dataset log
      • DELDelete a dataset log
      • POSTBulk create dataset logs
      • POSTRun evaluators on a dataset
      • GETList dataset evaluation runs
      • PUTReplace a dataset log
      • POSTImport existing logs into a dataset
      • DELRemove logs from a dataset
      • GETGet dataset logs summary
      • POSTGet filtered dataset logs summary
  • Reference
    • Filters API Reference
LogoLogo
DiscordPlatform
API ReferenceDatasets

Create a dataset log

POST
https://api.respan.ai/api/datasets/:dataset_id/logs/
POST
/api/datasets/:dataset_id/logs/
$curl -X POST https://api.respan.ai/api/datasets/dataset_id/logs/ \
> -H "Authorization: Bearer sk_live_xxxxx" \
> -H "Content-Type: application/json" \
> -d '{
> "input": {
> "customer_id": "cust_12345",
> "message": "I need help with my subscription"
> },
> "output": {
> "response": "I would be happy to help with your subscription."
> },
> "metadata": {
> "model": "gpt-4o",
> "log_type": "chat"
> },
> "metrics": {
> "prompt_tokens": 25,
> "completion_tokens": 18,
> "cost": 0.002,
> "latency": 1.8
> }
>}'
1{
2 "message": "Dataset log created successfully",
3 "unique_id": "2844b4f401854250aec6ee1ffd8f38be"
4}

Create a single dataset log from unified-format input/output data.

Was this page helpful?
Previous

List dataset logs

Next
Built with

Path parameters

dataset_idstringRequired

Dataset ID. Use _saved_logs for the virtual saved-logs collection.

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY.

Request

This endpoint expects an object.
inputanyRequired
outputanyOptional
metadataobjectOptional
metricsobjectOptional

Response

Dataset log created.
messagestring
unique_idstring

Errors

401
Unauthorized Error