Production posture
Built for stable production-scale text and multimodal traffic.
Complete docs organized around quick start, API reference, tutorials, and cookbook content.
Production posture
Built for stable production-scale text and multimodal traffic.
Capability mix
Text and multimodal traffic share one Model API contract.
Agent protocols
OpenAI-compatible access, MCP, and llms.txt are exposed together.
Traffic policy
TTFT, backpressure, slow-consumer isolation, and regional rate limits.
OpenAPI
https://api.batchin.tech/openapi.json
API base
https://api.batchin.tech/v1
MCP
https://api.batchin.tech/v1/mcp
Public endpoints
/v1/chat/completions · /v1/responses · /v1/embeddings · /v1/images · /v1/audio/* · /v1/videos
1) Install
pip install openai2) First Request
from openai import OpenAI
client = OpenAI(
base_url="https://api.batchin.tech/v1",
api_key="YOUR_API_KEY"
)
resp = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Hello from BatchIn"}]
)
print(resp.choices[0].message.content)3) Streaming
stream = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Write a fast python async worker"}],
stream=True
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="")See the self-serve path for dedicated endpoints, private throughput usage, billing, and settlement.
Understand dedicated endpoints, private deployment boundaries, key formats, and usage separation before you start a capacity rollout.
Review how BatchIn positions route control, batch lanes, and fallback behavior before moving production traffic.
Open the public verification flow, inspect a signed evidence pack, and reproduce the trust check in the browser.
Review the reserved OTLP ingest/export surface and the planned bridge from native traces into external observability tools.
curl -X GET https://api.batchin.tech/v1/users/me \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X POST https://api.batchin.tech/v1/keys \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production Key",
"rate_limit_rpm": 120,
"monthly_budget_cents": 500000
}'| Name | Type | Required | Description |
|---|---|---|---|
| name | string | No | |
| rate_limit_rpm | number | No | |
| monthly_budget_cents | number | No |
curl -X GET https://api.batchin.tech/v1/keys \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X DELETE https://api.batchin.tech/v1/keys/{id} \
-H "Authorization: Bearer $BATCHIN_API_KEY" \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes |
curl -X POST https://api.batchin.tech/v1/chat/completions \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-max",
"messages": [{"role":"user","content":"Explain attention in 3 bullets"}],
"temperature": 0.7,
"stream": false
}'| Name | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | |
| messages | array | Yes | |
| temperature | number | No | |
| max_tokens | number | No | |
| stream | boolean | No |
curl -X POST https://api.batchin.tech/v1/responses \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-max",
"input": "Explain batch inference in 3 bullets",
"max_output_tokens": 256
}'| Name | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | |
| input | string|array | Yes | |
| max_output_tokens | number | No | |
| stream | boolean | No |
curl -X POST https://api.batchin.tech/v1/completions \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-max",
"prompt": "Complete this sentence: Batch processing helps",
"suffix": "for large workloads.",
"max_tokens": 128
}'| Name | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | |
| prompt | string|array | Yes | |
| suffix | string | No | |
| max_tokens | number | No |
curl -X POST https://api.batchin.tech/v1/embeddings \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bge-m3",
"input": ["batch inference", "retrieval augmented generation"]
}'| Name | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | |
| input | string|array | Yes |
curl -X POST https://api.batchin.tech/v1/audio/speech \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "Welcome to BatchIn",
"voice": "alloy",
"response_format": "mp3"
}'| Name | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | |
| input | string | Yes | |
| voice | string | No | |
| response_format | string | No |
curl -X POST https://api.batchin.tech/v1/audio/transcriptions \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-F "file=@meeting.wav" \
-F "model=whisper-large-v3-turbo" \
-F "response_format=verbose_json" \
-F "language=en"| Name | Type | Required | Description |
|---|---|---|---|
| file | binary | Yes | |
| model | string | Yes | |
| language | string | No | |
| prompt | string | No | |
| response_format | string | No | |
| temperature | number|string | No |
curl -X POST https://api.batchin.tech/v1/videos \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Cyberpunk city night drone tracking shot, neon reflections",
"model": "wan3.0-video",
"duration_seconds": 5,
"resolution": "1080p"
}'| Name | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | |
| model | string | No | |
| duration_seconds | integer | No | |
| resolution | string | No |
curl -X POST https://api.batchin.tech/v1/images/generations \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Minimalist geometric architectural rendering, dusk light",
"model": "doubao-seedream-5-0-260128",
"n": 1,
"size": "1024x1024"
}'| Name | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | |
| model | string | No | |
| n | integer | No | |
| size | string | No |
curl -X GET https://api.batchin.tech/v1/models \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X POST https://api.batchin.tech/v1/batches \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"priority": "fill",
"webhook_url": "https://your-domain.com/webhooks/batchin",
"tasks": [
{"custom_id":"task-1","model":"qwen3.8-max","request_body":{"messages":[{"role":"user","content":"translate this"}]}},
{"custom_id":"task-2","model":"glm-5.3","request_body":{"messages":[{"role":"user","content":"summarize this"}]}}
]
}'| Name | Type | Required | Description |
|---|---|---|---|
| tasks | array | Yes | |
| priority | string(high|low|fill) | No | |
| webhook_url | string(url) | No |
curl -X GET https://api.batchin.tech/v1/batches \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X GET https://api.batchin.tech/v1/batches/{id} \
-H "Authorization: Bearer $BATCHIN_API_KEY" \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes |
curl -X POST https://api.batchin.tech/v1/batches/{id}/cancel \
-H "Authorization: Bearer $BATCHIN_API_KEY" \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes |
curl -X POST https://api.batchin.tech/v1/topup/alipay/checkout \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount_cents": 5000,
"currency": "cny",
"locale": "zh-CN"
}'| Name | Type | Required | Description |
|---|---|---|---|
| amount_cents | number | Yes | |
| locale | string | No |
curl -X GET https://api.batchin.tech/v1/topup/history \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X GET https://api.batchin.tech/v1/usage/logs?limit=50&offset=0 \
-H "Authorization: Bearer $BATCHIN_API_KEY" \| Name | Type | Required | Description |
|---|---|---|---|
| limit | query:number | No | |
| offset | query:number | No |
curl -X GET https://api.batchin.tech/v1/usage/summary \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X GET https://api.batchin.tech/v1/usage/by-model \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X POST https://api.batchin.tech/v1/vaas \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_text": "What is a zero-knowledge proof?",
"output_text": "A cryptographic method...",
"model_id": "qwen3.8-max",
"node_id": "execution-a19c-42ef"
}'| Name | Type | Required | Description |
|---|---|---|---|
| input_text | string | Yes | |
| output_text | string | Yes | |
| model_id | string | Yes | |
| node_id | string | No |
curl -X GET https://api.batchin.tech/v1/vaas/{id} \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes |
curl -X GET https://api.batchin.tech/v1/vaas/{id}/verify \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes |
curl -X GET https://api.batchin.tech/v1/vaas/{id}/evidence \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes |
curl -X GET https://api.batchin.tech/v1/vaas/pubkey/current \curl -X GET https://api.batchin.tech/v1/traces?limit=20 \
-H "Authorization: Bearer $BATCHIN_API_KEY" \| Name | Type | Required | Description |
|---|---|---|---|
| limit | query:number | No |
curl -X GET https://api.batchin.tech/v1/traces/{trace_id} \
-H "Authorization: Bearer $BATCHIN_API_KEY" \| Name | Type | Required | Description |
|---|---|---|---|
| trace_id | path:string | Yes |
curl -X GET https://api.batchin.tech/v1/prompts \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X GET https://api.batchin.tech/v1/prompt-regressions \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X GET https://api.batchin.tech/v1/experiments \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X POST https://api.batchin.tech/v1/otlp/traces \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"resourceSpans": []
}'curl -X GET https://api.batchin.tech/v1/otlp/export \
-H "Authorization: Bearer $BATCHIN_API_KEY" \curl -X GET https://api.batchin.tech/health \