Create a batch job

Creates a batch job for asynchronous processing.

POST
/v1/batches
AuthorizationBearer <token>

Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT. Virtual keys (prefixed with sk-bf-) can also be passed here.

In: header

modelstring

Model in provider/model format

input_file_id?string

OpenAI-style file ID

requests?array<object>

Anthropic-style inline requests

endpoint?string
Value in"/v1/chat/completions" | "/v1/embeddings" | "/v1/completions" | "/v1/responses" | "/v1/messages"
completion_window?string

e.g., "24h"

metadata?object

Empty Object

Response Body

curl -X POST "https://loading/{AI_GATEWAY_URL}/v1/batches" \  -H "Content-Type: application/json" \  -d '{    "model": "string"  }'
{
  "id": "string",
  "object": "string",
  "endpoint": "string",
  "input_file_id": "string",
  "completion_window": "string",
  "status": "validating",
  "request_counts": {
    "total": 0,
    "completed": 0,
    "failed": 0,
    "succeeded": 0,
    "expired": 0,
    "canceled": 0,
    "pending": 0
  },
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "created_at": 0,
  "expires_at": 0,
  "output_file_id": "string",
  "error_file_id": "string",
  "processing_status": "string",
  "results_url": "string",
  "operation_name": "string",
  "extra_fields": {
    "request_type": "string",
    "provider": "openai",
    "model_requested": "string",
    "model_deployment": "string",
    "latency": 0,
    "chunk_index": 0,
    "raw_request": {},
    "raw_response": {},
    "cache_debug": {
      "cache_hit": true,
      "cache_id": "string",
      "hit_type": "string",
      "requested_provider": "string",
      "requested_model": "string",
      "provider_used": "string",
      "model_used": "string",
      "input_tokens": 0,
      "threshold": 0,
      "similarity": 0
    }
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
On this page

On this page

No Headings