Pular para o conteúdo principal
POST
/
api
/
v1
/
llm
/
batches
Python (SDK)
from openapi import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.llm.batches.create(input_file_id="file_abc123", endpoint="/v1/chat/completions", metadata={
        "description": "evaluation job",
    })

    # Handle response
    print(res)
{
  "id": "batch_aa87e2b1112a455b8deabed784372198",
  "object": "batch",
  "endpoint": "/v1/chat/completions",
  "errors": null,
  "input_file_id": "file_abc123",
  "completion_window": "24h",
  "status": "completed",
  "output_file_id": "file_def456",
  "error_file_id": null,
  "created_at": 1704067200,
  "in_progress_at": 1704067260,
  "expires_at": 1704153600,
  "finalizing_at": 1704070800,
  "completed_at": 1704070860,
  "failed_at": null,
  "expired_at": null,
  "cancelling_at": null,
  "cancelled_at": null,
  "request_counts": {
    "total": 3,
    "completed": 3,
    "failed": 0
  },
  "metadata": {
    "description": "evaluation job"
  }
}

Autorizações

Authorization
string
header
obrigatório

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Corpo

application/json
input_file_id
string
obrigatório
endpoint
enum<string>
obrigatório
Opções disponíveis:
/v1/chat/completions,
/v1/embeddings,
/v1/images/generations
completion_window
any
obrigatório
metadata
object

Resposta

200 - application/json

OK

id
string
obrigatório
object
any
obrigatório
endpoint
string
obrigatório
input_file_id
string
obrigatório
completion_window
string
obrigatório
status
enum<string>
obrigatório
Opções disponíveis:
validating,
failed,
in_progress,
finalizing,
completed,
expired,
cancelling,
cancelled
created_at
integer
obrigatório
Intervalo obrigatório: -9007199254740991 <= x <= 9007199254740991
request_counts
object
obrigatório
errors
object
output_file_id
string | null
error_file_id
string | null
in_progress_at
integer | null
Intervalo obrigatório: -9007199254740991 <= x <= 9007199254740991
expires_at
integer | null
Intervalo obrigatório: -9007199254740991 <= x <= 9007199254740991
finalizing_at
integer | null
Intervalo obrigatório: -9007199254740991 <= x <= 9007199254740991
completed_at
integer | null
Intervalo obrigatório: -9007199254740991 <= x <= 9007199254740991
failed_at
integer | null
Intervalo obrigatório: -9007199254740991 <= x <= 9007199254740991
expired_at
integer | null
Intervalo obrigatório: -9007199254740991 <= x <= 9007199254740991
cancelling_at
integer | null
Intervalo obrigatório: -9007199254740991 <= x <= 9007199254740991
cancelled_at
integer | null
Intervalo obrigatório: -9007199254740991 <= x <= 9007199254740991
metadata
object