List Batch

Supported Providers
  • OpenAI

List your organization's batches.

get
Authorizations
Query parameters
afterstringOptional

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

limitintegerOptional

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Default: 20
Responses
200
Batch listed successfully.
application/json
get
curl https://api.portkey.ai/v1/batches?limit=2 \
  -H "x-portkey-api-key: $PORTKEY_API_KEY" \
  -H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
  -H "Content-Type: application/json"
200

Batch listed successfully.

{
  "data": [
    {
      "id": "text",
      "object": "batch",
      "endpoint": "text",
      "errors": {
        "object": "text",
        "data": [
          {
            "code": "text",
            "message": "text",
            "param": "text",
            "line": 1
          }
        ]
      },
      "input_file_id": "text",
      "completion_window": "text",
      "status": "validating",
      "output_file_id": "text",
      "error_file_id": "text",
      "created_at": 1,
      "in_progress_at": 1,
      "expires_at": 1,
      "finalizing_at": 1,
      "completed_at": 1,
      "failed_at": 1,
      "expired_at": 1,
      "cancelling_at": 1,
      "cancelled_at": 1,
      "request_counts": {
        "total": 1,
        "completed": 1,
        "failed": 1
      },
      "metadata": {}
    }
  ],
  "first_id": "batch_abc123",
  "last_id": "batch_abc456",
  "has_more": true,
  "object": "list"
}

Last updated

Was this helpful?