Guides
- Quickstart
- Quickstarts by language
- Migration guides
- Authentication and keys
- Key protection
- Models, aliases and fallbacks
- Automatic model choice (silicon/auto)
- Chat completions
- Streaming
- Structured outputs and tools
- Logprobs
- Vision
- Responses, Claude and Ollama
- Embeddings, rerank, audio, images
- Files and batches
- Documents and search
- LoRA adapters
- Project tags and costs
- Prefix caching
- Headers, rate limits and spend caps
- Errors
- Versioning and the sandbox
- Privacy and retention
- Verifiable receipts
- Data residency
- Pricing
- Billing
- Pay per request (x402)
- On-chain oracle
- Agent credit (backed compute lines)
- Status
- SDKs
- Swift SDK
- Integrations
- Run a node
- Linux agent
- Mac mini fleets
- Compute API
- Architecture
- Changelog
- Glossary
API reference
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
- GET/v1/batches
- POST/v1/batches
- GET/v1/batches/{batch_id}
- POST/v1/batches/{batch_id}/cancel
- GET/v1/batches/{batch_id}/output
- GET/v1/batches/{batch_id}/errors
- GET/v1/files
- POST/v1/files
- GET/v1/files/{file_id}
- DELETE/v1/files/{file_id}
- GET/v1/files/{file_id}/content
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.
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" }}'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){ "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.
| Parameter | In | Type | Description |
|---|---|---|---|
| batch_id* | path | string |
Responses: 200 Successful Response, 422 Validation Error
Cancel Batch
| Parameter | In | Type | Description |
|---|---|---|---|
| batch_id* | path | string |
Responses: 200 Successful Response, 422 Validation Error
Batch Output
JSONL, one line per finished request.
| Parameter | In | Type | Description |
|---|---|---|---|
| batch_id* | path | string |
{"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.
| Parameter | In | Type | Description |
|---|---|---|---|
| batch_id* | path | string |
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.
| Parameter | In | Type | Description |
|---|---|---|---|
| purpose | query | string | null | |
| limit | query | integer | |
| after | query | string | null | |
| order | query | string |
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]`), or a document for a vector store (`purpose=assistants` or `user_data`).
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.
curl -X POST https://api.siliconnetwork.io/v1/files \ -H "Authorization: Bearer sn_live_..." \ -F "file=@requests.jsonl" \ -F "purpose=batch"{ "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
| Parameter | In | Type | Description |
|---|---|---|---|
| file_id* | path | string |
curl https://api.siliconnetwork.io/v1/files/file-... \ -H "Authorization: Bearer sn_live_..."Responses: 200 Successful Response, 422 Validation Error
Delete File
| Parameter | In | Type | Description |
|---|---|---|---|
| file_id* | path | string |
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.
| Parameter | In | Type | Description |
|---|---|---|---|
| file_id* | path | string |
Responses: 200 Successful Response, 422 Validation Error