S3

Write trace JSON files to S3, R2, MinIO, and compatible endpoints

S3 broadcast is useful for durable storage and lakehouse workflows. Each trace is stored as JSON and can be queried with Athena, DuckDB, Snowflake external tables, or Spark.

broadcast-s3-config.json
{
  "destination": "s3",
  "enabled": true,
  "bucket_name": "therouter-traces",
  "region": "us-east-2",
  "access_key_id": "AKIA...",
  "secret_access_key": "<secret>",
  "custom_endpoint": "",
  "path_template": "openrouter-traces/{date}",
  "sampling_rate": 1
}
cURL
curl https://api.therouter.ai/v1/chat/completions   -H "Authorization: Bearer $THEROUTER_API_KEY"   -H "Content-Type: application/json"   -H "X-TheRouter.ai-Broadcast: true"   -d '{
    "model":"openai/gpt-4.1",
    "messages":[{"role":"user","content":"Generate release summary"}],
    "trace":{"trace_name":"S3 Archival Test","pipeline":"daily-batch"}
  }'
Least-privilege credentials
Use credentials restricted to write objects in the target bucket path. Avoid broad account-level access keys for observability pipelines.