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

Bulk create dataset logs

POST
https://api.respan.ai/api/datasets/:dataset_id/logs/bulk/
POST
/api/datasets/:dataset_id/logs/bulk/
$curl -X POST https://api.respan.ai/api/datasets/dataset_id/logs/bulk/ \
> -H "Authorization: Bearer sk_live_xxxxx" \
> -H "Content-Type: application/json" \
> -d '{
> "logs": [
> {
> "input": "What is your return policy?",
> "expected_output": "You can return within 30 days",
> "metadata": {
> "category": "support"
> }
> },
> {
> "input": [
> {
> "role": "user",
> "content": "Hello"
> }
> ],
> "output": {
> "role": "assistant",
> "content": "Hi there!"
> },
> "metrics": {
> "tokens": 10,
> "cost": 0.0001
> }
> }
> ]
>}'
1{
2 "success_count": 95,
3 "error_count": 5,
4 "errors": [
5 {
6 "index": 3,
7 "error": "Invalid input format"
8 }
9 ],
10 "total_errors": 5
11}

Create multiple dataset logs in one request from an array of unified-format log objects. Partial success is allowed.

Was this page helpful?
Previous

Run evaluators on a dataset

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.
logslist of objectsRequired

Response

Bulk create completed. Some rows may still contain errors.
success_countinteger
error_countinteger
errorslist of objects
total_errorsinteger

Errors

401
Unauthorized Error