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="")Pass the X-BatchIn-Lane HTTP header with any OpenAI-compatible client, or configure default lane policies on your API keys.
Direct official priority queue, zero quantization loss, uncompromised deep reasoning IQ.
Ultra-fast first-token response (<140ms) with 160+ tok/s high-throughput persistent multiplexing.
Up to 50% wholesale cost reduction for asynchronous, non-blocking offline batch workloads.
Automated multi-node health circuit breaking with zero-downtime hedged failover.
Code Sample: quality_first
X-BatchIn-Lane: quality_first# Python (OpenAI SDK Drop-in)
from openai import OpenAI
client = OpenAI(
base_url="https://api.batchin.tech/v1",
api_key="your_batchin_api_key",
default_headers={"X-BatchIn-Lane": "quality_first"}
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Design an async lock-free queue in Rust."}],
)
print(response.choices[0].message.content)Point baseURL to BatchIn and use the live model catalog, workspace rate card, and signed receipt evidence.
Use BatchIn inside Cursor to replace expensive Claude/GPT subscriptions with ultra-fast DeepSeek V4 & Qwen 3.8 Max.
# Cursor IDE Configuration Guide:
# 1. Open Cursor Settings (Cmd+, or Ctrl+,) -> Models
# 2. Toggle "OpenAI API Key" to ON
# 3. Click "Override OpenAI Base URL" and enter:
https://api.batchin.tech/v1
# 4. In "OpenAI API Key", paste your BatchIn API Key:
bk_your_batchin_api_key
# 5. Under "Model Names", add:
deepseek-v4-pro # 1.8T MoE for complex architecture & deep reasoning
qwen3.8-max # 1M context for full-repo understanding
deepseek-v4-flash # Use measured latency from your workspace telemetrySee 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.
Get current user profile for authenticated API key.
curl -X GET https://api.batchin.tech/v1/users/me \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Create a new API key with optional rate limit and monthly budget.
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 | Key name |
| rate_limit_rpm | number | No | Requests per minute limit |
| monthly_budget_cents | number | No | Monthly budget in cents |
List all API keys for current user.
curl -X GET https://api.batchin.tech/v1/keys \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Delete one API key by id.
curl -X DELETE https://api.batchin.tech/v1/keys/{id} \
-H "Authorization: Bearer $BATCHIN_API_KEY" \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes | API key id |
Text and multi-turn chat completion with SSE streaming support.
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 | Model ID |
| messages | array | Yes | Chat message array |
| temperature | number | No | Sampling temperature |
| max_tokens | number | No | Max output tokens |
| stream | boolean | No | Enable streaming |
Responses API compatibility layer with non-streaming response objects, SSE streaming events, and runtime receipt headers.
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 | Model ID |
| input | string|array | Yes | Input text or message array |
| max_output_tokens | number | No | Max output tokens |
| stream | boolean | No | Return Responses events as text/event-stream. |
OpenAI-compatible text completions with prefix/suffix FIM-style passthrough.
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 | Completion model id |
| prompt | string|array | Yes | Prompt or prefix content |
| suffix | string | No | FIM suffix |
| max_tokens | number | No | Max completion tokens |
Convert text into embeddings.
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 | Embedding model id |
| input | string|array | Yes | Text input to embed |
Convert text into synthesized speech with standard TTS-compatible speech engines.
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 | Speech model id |
| input | string | Yes | Text to synthesize |
| voice | string | No | Voice preset |
| response_format | string | No | Audio response format |
Transcribe speech or audio files into text, with compact or verbose segment-aware output.
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 | Audio file upload |
| model | string | Yes | Transcription model id |
| language | string | No | Language code |
| prompt | string | No | Transcription prompt |
| response_format | string | No | Response format |
| temperature | number|string | No | Sampling temperature |
Submit video generation jobs through the unified Model API video entry.
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": "doubao-seedance-2-0-260128",
"duration_seconds": 5,
"resolution": "1080p"
}'| Name | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Video generation prompt |
| model | string | No | Video model ID (defaults to doubao-seedance-2-0-260128) |
| duration_seconds | integer | No | Duration in seconds (default: 5) |
| resolution | string | No | Resolution (720p, 1080p) |
Generate images via OpenAI Images API standard.
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 | Image generation prompt |
| model | string | No | Image model ID |
| n | integer | No | Number of images |
| size | string | No | Resolution (1024x1024) |
List all active models with their status, context length, and pricing.
curl -X GET https://api.batchin.tech/v1/models \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Submit batch jobs with mixed-model tasks and priorities.
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 | Task array (each task can set its own model) |
| priority | string(high|low|fill) | No | Scheduling priority |
| webhook_url | string(url) | No | Webhook callback URL |
List batch jobs for current user.
curl -X GET https://api.batchin.tech/v1/batches \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Get batch detail including task results.
curl -X GET https://api.batchin.tech/v1/batches/{id} \
-H "Authorization: Bearer $BATCHIN_API_KEY" \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes | Batch id |
Cancel a pending or running batch job.
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 | Batch id |
Create an Alipay checkout session for Chinese-site credit top-up.
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 | Top-up amount in CNY cents |
| locale | string | No | Chinese locale, zh-CN or zh-HK |
Create Stripe checkout session for credit top-up.
curl -X POST https://api.batchin.tech/v1/topup/stripe/checkout \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount_cents": 5000
}'| Name | Type | Required | Description |
|---|---|---|---|
| amount_cents | number | Yes | Top-up amount in cents |
Get top-up transaction history.
curl -X GET https://api.batchin.tech/v1/topup/history \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Get supported USDC chains and deposit addresses.
curl -X GET https://api.batchin.tech/v1/topup/usdc/chains \
-H "Authorization: Bearer $BATCHIN_API_KEY" \List request-level usage logs.
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 | Page size (1-500) |
| offset | query:number | No | Offset |
Get total requests, tokens, and cost summary.
curl -X GET https://api.batchin.tech/v1/usage/summary \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Aggregate usage by model dimension.
curl -X GET https://api.batchin.tech/v1/usage/by-model \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Create verifiable audit record and signature.
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 | Input text |
| output_text | string | Yes | Output text |
| model_id | string | Yes | Model id |
| node_id | string | No | Masked execution node identifier |
Fetch audit details by audit_id.
curl -X GET https://api.batchin.tech/v1/vaas/{id} \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes | Audit id |
Verify audit signature validity.
curl -X GET https://api.batchin.tech/v1/vaas/{id}/verify \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes | Audit id |
Return the audit evidence pack used for browser verification and export workflows.
curl -X GET https://api.batchin.tech/v1/vaas/{id}/evidence \| Name | Type | Required | Description |
|---|---|---|---|
| id | path:uuid | Yes | Audit id |
Get public key used for browser-side signature verification.
curl -X GET https://api.batchin.tech/v1/vaas/pubkey/current \List native runtime traces with route, prompt-version, and audit linkage.
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 | Page size (1-100) |
Fetch one native runtime trace by trace_id.
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 | Trace ID |
Return prompt registries with promoted versions, latest observed versions, and version details.
curl -X GET https://api.batchin.tech/v1/prompts \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Return automatic sampled-replay regression runs with sample counts, similarity, and latency summaries.
curl -X GET https://api.batchin.tech/v1/prompt-regressions \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Return automatic experiments for candidate prompt versions, including replay state and auto-promotion results.
curl -X GET https://api.batchin.tech/v1/experiments \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Accept OTLP/HTTP JSON or protobuf traces and merge spans into the unified trace view.
curl -X POST https://api.batchin.tech/v1/otlp/traces \
-H "Authorization: Bearer $BATCHIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"resourceSpans": []
}'Export spans from the unified trace view as OTLP protobuf or JSON.
curl -X GET https://api.batchin.tech/v1/otlp/export \
-H "Authorization: Bearer $BATCHIN_API_KEY" \Service health probe endpoint.
curl -X GET https://api.batchin.tech/health \Split one million records into JSONL tasks, execute by priority tiers, and ingest callbacks automatically.
Combine embeddings, retrieval, reranking, and generation with observability and rollback controls.
Capture verifiable audit evidence at input, output, and human-review checkpoints with Ed25519 verification.