Docs

API reference

Batches and files

Asynchronous, discounted inference for work that can wait: upload a JSONL file (or send the requests inline), create a batch, collect the results within the completion window. The OpenAI batch flow works unchanged.

Base URL https://api.siliconnetwork.io

List Batches

The batches created with this key's org, newest first.

Responses: 200 Successful Response, 422 Validation Error

Create Batch

Either input_file_id (a JSONL file uploaded with POST /v1/files, purpose batch) or the requests inline, never both. Up to 10,000 requests and 32 MB per batch, completion_window 24h, endpoints /v1/chat/completions and /v1/embeddings. Billed at half price.

silicon - zsh
curl -X POST https://api.siliconnetwork.io/v1/batches \
  -H "Authorization: Bearer sn_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "endpoint": "/v1/chat/completions",
  "completion_window": "24h",
  "requests": [
    {
      "custom_id": "row-1",
      "method": "POST",
      "url": "/v1/chat/completions",
      "body": {
        "model": "llama-3.2-3b",
        "messages": [
          {
            "role": "user",
            "content": "Summarize: ..."
          }
        ]
      }
    },
    {
      "custom_id": "row-2",
      "method": "POST",
      "url": "/v1/chat/completions",
      "body": {
        "model": "llama-3.2-3b",
        "messages": [
          {
            "role": "user",
            "content": "Summarize: ..."
          }
        ]
      }
    }
  ],
  "metadata": {
    "job": "nightly-summaries"
  }
}'
request.py
from siliconnetwork import SiliconNetwork

client = SiliconNetwork()
data, meta = client.request("POST", "/v1/batches", json={
  "endpoint": "/v1/chat/completions",
  "completion_window": "24h",
  "requests": [
    {
      "custom_id": "row-1",
      "method": "POST",
      "url": "/v1/chat/completions",
      "body": {
        "model": "llama-3.2-3b",
        "messages": [
          {
            "role": "user",
            "content": "Summarize: ..."
          }
        ]
      }
    },
    {
      "custom_id": "row-2",
      "method": "POST",
      "url": "/v1/chat/completions",
      "body": {
        "model": "llama-3.2-3b",
        "messages": [
          {
            "role": "user",
            "content": "Summarize: ..."
          }
        ]
      }
    }
  ],
  "metadata": {
    "job": "nightly-summaries"
  }
})
print(data, meta.request_id)
response
{
  "id": "batch_...",
  "object": "batch",
  "endpoint": "/v1/chat/completions",
  "status": "validating",
  "created_at": "2026-09-04T09:00:00Z",
  "expires_at": "2026-09-05T09:00:00Z",
  "request_counts": { "total": 2, "completed": 0, "failed": 0 },
  "metadata": { "job": "nightly-summaries" }
}

Responses: 201 Successful Response, 422 Validation Error

Get Batch

Status values: validating, in_progress, completed, failed, cancelling, cancelled, expired.

ParameterInTypeDescription
batch_id*pathstring

Responses: 200 Successful Response, 422 Validation Error

Cancel Batch

ParameterInTypeDescription
batch_id*pathstring

Responses: 200 Successful Response, 422 Validation Error

Batch Output

JSONL, one line per finished request.

ParameterInTypeDescription
batch_id*pathstring
response
{"id": "req_...", "custom_id": "row-1", "response": {"status_code": 200, "body": {"id": "chatcmpl_...", "choices": [...]}}, "error": null}
{"id": "req_...", "custom_id": "row-2", "response": {"status_code": 200, "body": {"...": "..."}}, "error": null}

Responses: 200 Successful Response, 422 Validation Error

Batch Errors

JSONL, one line per request that failed.

ParameterInTypeDescription
batch_id*pathstring

Responses: 200 Successful Response, 422 Validation Error

List Files

Query purpose, limit, after and order, as in the OpenAI API. Closed batches' result files are listed with purpose batch_output.

ParameterInTypeDescription
purposequerystring | null
limitqueryinteger
afterquerystring | null
orderquerystring

Responses: 200 Successful Response, 422 Validation Error

Create File

Upload a batch input file (multipart: `file`, `purpose=batch`, optional `expires_after[anchor]=created_at` and `expires_after[seconds]`).

Multipart: the JSONL file and purpose=batch, optionally expires_after[anchor]=created_at and expires_after[seconds] (3600 to 2592000). Every line is validated before the file is stored.

silicon - zsh
curl -X POST https://api.siliconnetwork.io/v1/files \
  -H "Authorization: Bearer sn_live_..." \
  -F "file=@requests.jsonl" \
  -F "purpose=batch"
response
{ "id": "file-...", "object": "file", "bytes": 1024, "created_at": 1790000000, "expires_at": 1792592000,
  "filename": "requests.jsonl", "purpose": "batch", "status": "processed" }

Responses: 201 Successful Response, 422 Validation Error

Retrieve File

ParameterInTypeDescription
file_id*pathstring
silicon - zsh
curl https://api.siliconnetwork.io/v1/files/file-... \
  -H "Authorization: Bearer sn_live_..."

Responses: 200 Successful Response, 422 Validation Error

Delete File

ParameterInTypeDescription
file_id*pathstring
silicon - zsh
curl -X DELETE https://api.siliconnetwork.io/v1/files/file-... \
  -H "Authorization: Bearer sn_live_..."

Responses: 200 Successful Response, 422 Validation Error

File Content

The file's bytes. Served as an attachment with a fixed content type whatever was uploaded, so a stored file can never render as a page.

Always served as an application/octet-stream attachment.

ParameterInTypeDescription
file_id*pathstring

Responses: 200 Successful Response, 422 Validation Error

Silicon Network›Docs›API›Batches and files37 items