diff --git a/openapi.yaml b/openapi.yaml index 020ed4da..6731e0fa 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -26,7 +26,7 @@ tags: - name: Fine-tuning description: Manage fine-tuning jobs to tailor a model to your specific training data. - name: Batch - description: Create large batches of API requests to run asyncronously. + description: Create large batches of API requests to run asynchronously. - name: Files description: Files are used to upload documents that can be used with features like Assistants and Fine-tuning. - name: Images @@ -2413,6 +2413,79 @@ paths: "batch_description": "Nightly eval job", } } + get: + operationId: listBatches + tags: + - Batch + summary: List your organization's batches. + parameters: + - in: query + name: after + required: false + schema: + type: string + description: Identifier for the last batch from the previous pagination request. + - name: limit + in: query + description: Number of batches to retrieve. + required: false + schema: + type: integer + default: 20 + responses: + '200': + description: Batch listed successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ListBatchesResponse' + x-oaiMeta: + name: List batch + group: batch + returns: A list of paginated [Batch](/docs/api-reference/batch/object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/batches?limit=2 \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" + response: &batch_object | + { + "object": "list", + "data": [ + { + "id": "batch_abc123", + "object": "batch", + "endpoint": "/v1/completions", + "errors": null, + "input_file_id": "file-abc123", + "completion_window": "24h", + "status": "completed", + "output_file_id": "file-cvaTdG", + "error_file_id": "file-HOWS94", + "created_at": 1711471533, + "in_progress_at": 1711471538, + "expires_at": 1711557933, + "finalizing_at": 1711493133, + "completed_at": 1711493163, + "failed_at": null, + "expired_at": null, + "cancelling_at": null, + "cancelled_at": null, + "request_counts": { + "total": 100, + "completed": 95, + "failed": 5 + }, + "metadata": { + "customer_id": "user_123456789", + "batch_description": "Nightly job", + } + }, + { ... }, + ], + "has_more": true + } /batches/{batch_id}: get: @@ -11535,7 +11608,22 @@ components: name: The request output object example: | {"id": "batch_req_wnaDys", "custom_id": "request-2", "response": {"status_code": 200, "request_id": "req_c187b3", "body": {"id": "chatcmpl-9758Iw", "object": "chat.completion", "created": 1711475054, "model": "gpt-3.5-turbo", "choices": [{"index": 0, "message": {"role": "assistant", "content": "2 + 2 equals 4."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 24, "completion_tokens": 15, "total_tokens": 39}, "system_fingerprint": null}}, "error": null} - + ListBatchesResponse: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Batch" + has_more: + type: boolean + object: + type: string + enum: [list] + required: + - object + - data + - has_more security: - ApiKeyAuth: [] @@ -11661,7 +11749,7 @@ x-oaiMeta: - id: batch title: Batch description: | - Create large batches of API requests to run asyncronously. + Create large batches of API requests to run asynchronously. navigationGroup: endpoints sections: - type: endpoint @@ -11673,6 +11761,9 @@ x-oaiMeta: - type: endpoint key: cancelBatch path: cancel + - type: endpoint + key: listBatches + path: list - type: object key: Batch path: object