B2BB2B LLM

Files and Batch workflow

Upload line-oriented requests, submit a batch and collect per-item outcomes.

No current prepared translation is available. The English source is shown without machine translation.

The Files/Batch compatibility interface accepts JSONL input for supported Responses, Chat Completions and embeddings endpoints. Every item runs through the gateway's normal routing and settlement; a provider-native batch service is not invoked.

Prepare input

Use unique custom_id values and one POST operation per line. All item URLs must match the batch's chosen endpoint. Example work.jsonl:

{"custom_id":"case-001","method":"POST","url":"/v1/responses","body":{"model":"gpt-5.4","input":"Label this request: invoice copy."}}
{"custom_id":"case-002","method":"POST","url":"/v1/responses","body":{"model":"gpt-5.4","input":"Label this request: change delivery date."}}

Request: upload and create

curl https://api.b2b-llm.com/v1/files \
  -H "Authorization: Bearer $B2B_API_KEY" -F purpose=batch -F [email protected]

Use the returned file ID:

curl https://api.b2b-llm.com/v1/batches \
  -H "Authorization: Bearer $B2B_API_KEY" -H 'Content-Type: application/json' \
  -d '{"input_file_id":"file-EXAMPLE","endpoint":"/v1/responses","completion_window":"24h","metadata":{"workflow":"support-triage"}}'

Response

{"id":"batch_EXAMPLE","object":"batch","status":"in_progress","input_file_id":"file-EXAMPLE","output_file_id":null,"error_file_id":null,"request_counts":{"total":2,"completed":0,"failed":0}}

Collect and cancel

GET /v1/batches/BATCH_ID
GET /v1/batches?limit=20&after=BATCH_ID
POST /v1/batches/BATCH_ID/cancel
GET /v1/files/FILE_ID
GET /v1/files/FILE_ID/content
GET /v1/files?purpose=batch&order=desc&limit=100
DELETE /v1/files/FILE_ID

Download completed output/error files and match each JSONL row by custom_id. Do not assume input order. Cancellation applies to work not yet executing; in-flight items can still finish.

Limits and retention

A batch supports up to 50,000 items; the default uploaded-file limit is 200 MiB, with a separate normal request-body limit for each item. No item may contain streaming or nested async. completion_window is 24h. File and job storage quotas apply independently of the company's wallet. Use returned expiration metadata and remove unneeded, unreferenced files through the supported operation.

Upload/create needs positive-balance and spend admission. Existing file/job reads and controls use credential eligibility without requiring positive funds. Each claimed item rechecks admission. At-least-once lease recovery is not exactly-once provider execution. Billing applies the saved batch coefficient to actual item charges; native async does not use it. Temporary Playground credentials cannot create or access durable batch/files resources.

Images are not Batch items

Company image generation and editing are excluded from this compatibility queue. A separate Images intent preserves the company actor, price approval and no-repeat dispatch boundary. Old image items may finish with images_dedicated_api_required; review prior activity before a user deliberately submits any new request. The batch coefficient is not an image tariff.

Audio transcription is available only through the dedicated transcription API, not this queue. An audio path executed through the generic queue is rejected with audio_dedicated_api_required; do not requeue it as a new paid intent.

Dedicated Video operations are not accepted by this generic queue. Use the JSON Video API with its own Idempotency-Key and operation history; an attempted legacy Video dispatch fails with video_dedicated_api_required before a supplier request. Video API.