Skip to main content
POST
https://api.keywordsai.co
/
api
/
request-logs
/
batch
/
create
Create logs (batch)
curl --request POST \
  --url https://api.keywordsai.co/api/request-logs/batch/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "logs": [
    {}
  ]
}
'
The batch logging endpoint allows you to log multiple requests at once using the universal input/output design. This endpoint accepts any span type (chat, embedding, workflow, etc.) and processes them efficiently in batches.
You can log up to 5000 requests at once, and the maximum size of the request is 100MB.

Request body

logs
array
required
Array of log objects. Each log object follows the same structure as the single log creation endpoint.Each log object supports:
  • Universal input and output fields (recommended)
  • Legacy prompt_messages and completion_message fields (backward compatible)
  • Any log_type: "chat", "embedding", "workflow", "task", etc.
See the Create Log documentation for complete field specifications and log types for log_type details.

Key features

  • Supports all span types: Chat, embedding, workflow, transcription, etc.
  • Mixed types in one batch: Log different span types in a single request
  • Automatic field extraction: System extracts type-specific fields based on log_type
  • Legacy format support: Both old and new formats work in the same batch

Response

Returns an array of created log IDs or error details for each log in the batch.
{
  "results": [
    {
      "id": "log_abc123...",
      "status": "success"
    },
    {
      "id": "log_def456...",
      "status": "success"
    }
  ]
}