A I Batch
Batch AI operations for non-urgent processing with 50% cost savings via Anthropic Message Batches API
Enqueue Batch Job
Authorization
HTTPBearer In: header
Request Body
application/json
Type of batch job
"portfolio_summary" | "risk_report" | "strategy_backtest" | "sentiment_analysis" | "model_evaluation" | "trading_analytics"Job payload/parameters
Job priority (0-100, higher = more urgent)
500 <= value <= 100Don't run until this time (optional delay)
Unique key for idempotent job creation
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/batch/enqueue" \ -H "Content-Type: application/json" \ -d '{ "job_type": "portfolio_summary", "payload": {} }'{
"success": true,
"job": {
"id": "string",
"job_type": "portfolio_summary",
"status": "pending",
"priority": 0,
"custom_id": "string",
"batch_id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"run_after": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"tokens_used": 0,
"error_message": "string"
},
"message": "string",
"estimated_completion": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}List Batch Jobs
Authorization
HTTPBearer In: header
Query Parameters
50Response Body
application/json
application/json
curl -X GET "https://loading/api/v1/batch/jobs"{
"jobs": [
{
"id": "string",
"job_type": "portfolio_summary",
"status": "pending",
"priority": 0,
"custom_id": "string",
"batch_id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"run_after": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"tokens_used": 0,
"error_message": "string"
}
],
"total_count": 0,
"pending_count": 0,
"processing_count": 0
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Batch Job
Authorization
HTTPBearer In: header
Path Parameters
Response Body
application/json
application/json
curl -X GET "https://loading/api/v1/batch/jobs/string"{
"id": "string",
"job_type": "portfolio_summary",
"status": "pending",
"priority": 0,
"custom_id": "string",
"batch_id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"run_after": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"tokens_used": 0,
"error_message": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Cancel Batch Job
Authorization
HTTPBearer In: header
Path Parameters
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/batch/jobs/string/cancel"{
"property1": true,
"property2": true
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Batch Stats
Authorization
HTTPBearer In: header
Response Body
application/json
curl -X GET "https://loading/api/v1/batch/stats"{
"total_jobs_queued": 0,
"pending_jobs": 0,
"processing_jobs": 0,
"completed_jobs": 0,
"failed_jobs": 0,
"total_tokens_used": 0,
"total_cost_usd": 0,
"total_savings_usd": 0,
"avg_processing_time_hours": 0
}Get Job Result
Authorization
HTTPBearer In: header
Path Parameters
Response Body
application/json
application/json
curl -X GET "https://loading/api/v1/batch/jobs/string/result"{}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Flush Batch Jobs
Authorization
HTTPBearer In: header
Request Body
application/json
Maximum jobs to include in batch
1001 <= value <= 10000Only include specific job types (optional)
Minimum priority to include
00 <= value <= 100Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/batch/internal/flush" \ -H "Content-Type: application/json" \ -d '{}'{
"success": true,
"batch_id": "string",
"jobs_count": 0,
"estimated_tokens": 0,
"message": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Poll Batch Results
Authorization
HTTPBearer In: header
Request Body
application/json
Anthropic batch ID to poll
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/batch/internal/poll" \ -H "Content-Type: application/json" \ -d '{ "batch_id": "string" }'{
"success": true,
"batch_id": "string",
"status": "string",
"results": [
{
"job_id": "string",
"job_type": "portfolio_summary",
"status": "succeeded",
"result": {},
"error": "string",
"tokens_used": 0,
"processing_time_ms": 0
}
],
"jobs_processed": 0,
"jobs_remaining": 0,
"message": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}