Skip to main content
POST
/
v1
/
batches
Create a native provider batch
curl --request POST \
  --url https://gomodel.example.com/v1/batches \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "completion_window": "<string>",
  "endpoint": "<string>",
  "input_file_id": "<string>",
  "metadata": {},
  "requests": [
    {
      "body": {},
      "custom_id": "<string>",
      "method": "<string>",
      "url": "<string>"
    }
  ]
}
'
{
  "cancelled_at": 123,
  "cancelling_at": 123,
  "completed_at": 123,
  "completion_window": "<string>",
  "created_at": 123,
  "endpoint": "<string>",
  "failed_at": 123,
  "id": "<string>",
  "in_progress_at": 123,
  "input_file_id": "<string>",
  "metadata": {},
  "object": "<string>",
  "provider": "<string>",
  "provider_batch_id": "<string>",
  "request_counts": {
    "completed": 123,
    "failed": 123,
    "total": 123
  },
  "results": [
    {
      "custom_id": "<string>",
      "error": {
        "message": "<string>",
        "type": "<string>"
      },
      "index": 123,
      "model": "<string>",
      "provider": "<string>",
      "response": "<unknown>",
      "status_code": 123,
      "url": "<string>"
    }
  ],
  "status": "<string>",
  "usage": {
    "input_cost": 123,
    "input_tokens": 123,
    "output_cost": 123,
    "output_tokens": 123,
    "total_cost": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Body

application/json

Batch request

completion_window
string
endpoint
string
input_file_id
string
metadata
object
requests
object[]

Response

OK

cancelled_at
integer
cancelling_at
integer
completed_at
integer
completion_window
string
created_at
integer
endpoint
string
failed_at
integer
id
string
in_progress_at
integer
input_file_id
string
metadata
object
object
string
provider
string
provider_batch_id
string
request_counts
object
results
object[]
status
string
usage
object

Gateway extension: optional usage/result snapshots persisted by the gateway.