noosfera/auto
Routine tool turns go to flash-class models; the sticky cache stays intact.
Chat Completions, Responses, Anthropic Messages and Batches on one endpoint, with per-key caps, deterministic routing and zero prompt storage.
Point any OpenAI SDK, Anthropic SDK or coding CLI at Noosfera with your nsk_ key. Requests run only on paid commercial API keys and dedicated GPUs, never on consumer OAuth subscriptions, and no prompt is stored.
Download and inspect init.sh with TLS 1.2+, then run --dry-run or apply. Secrets are isolated in 0600 ~/.config/noosfera/env.sh (env.fish for fish), while your shell profile (~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish) receives only a non-secret noosfera source block. Pass --with-sandbox with NOOSFERA_CLOUD_KEY to include Early Access sandbox variables.
curl -fsSL --proto '=https' --tlsv1.2 https://noosfera.si/init.sh -o init.sh && sh init.shcurl -fsSL --proto '=https' --tlsv1.2 https://noosfera.si/init.sh -o init.sh && sh init.sh --dry-run| Surface | Method & Path | Purpose |
|---|---|---|
| Chat Completions | POST /v1/chat/completions | OpenAI-compatible chat, function tools, reasoning effort, SSE streaming |
| Responses | POST /v1/responses | OpenAI stateless Responses API with namespaced tools & reasoning items |
| Anthropic Messages | POST /v1/messages | Anthropic Messages wire & Claude Code CLI with thinking & prompt caching |
| Token Counter | POST /v1/messages/count_tokens | Zero-cost local input token estimation matching /v1/messages |
| Batch API | POST /v1/batches | Asynchronous bulk processing at 0.6× standard rate (40% off-peak discount) |
| Model Catalog | GET /v1/models | Returns all enabled models and context limits available to your key |
Authenticate OpenAI and Batch requests with Authorization: Bearer $NOOSFERA_KEY. Anthropic SDKs and Claude Code may send either Authorization: Bearer or x-api-key.
| Header | Direction | Behavior |
|---|---|---|
Authorization / x-api-key | Request | Required API key (Bearer nsk_... or x-api-key: nsk_...) |
x-gateway-conversation | Request | Stable session ID (1–128 chars) for sticky prompt-cache pinning |
x-gateway-no-trace | Request | Set to 1 to explicitly refuse trace capture on any key tier |
x-noosfera-request-id | Response | Unique request ID matching your counts-only usage ledger row |
x-noosfera-quota-ux-state | Response | Surfaces hidden, calm_notice, or mode_hemat when pace rules apply |
Every error is JSON with a stable code and a readable message, plus the top-level type the official OpenAI and Anthropic SDKs expect. Refusals (402, 429, 503) are sent as real HTTP statuses before any SSE stream opens, so SDK retry logic works unchanged.
{ "type": "error", "error": { "type": "rate_limit_error", "code": "key_daily_limit_reached", "message": "daily USD limit reached for this key; resets at 00:00 UTC" }}
Drop-in OpenAI Chat Completions endpoint supporting system/developer messages, function calling (tools and tool_choice), reasoning_effort, max_tokens / max_completion_tokens, and usage.prompt_tokens_details.cached_tokens reporting.
| Field | Type | Notes |
|---|---|---|
model | string | Concrete model ID (e.g. deepseek-v4.1-flash, gemini-3.5-flash-lite) or policy (noosfera/auto, noosfera/speed, noosfera/eco) |
messages | array | Required list of system, developer, user, assistant, and tool turns |
stream | boolean | When true, emits chat.completion.chunk SSE frames ending in data: [DONE] |
tools | array | OpenAI function tool definitions ({ type: "function", function: ... }) |
reasoning_effort | string | Optional: none, minimal, low, medium, high, or xhigh |
curl https://inference.noosfera.si/v1/chat/completions \ -H "Authorization: Bearer $NOOSFERA_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "noosfera/auto", "stream": true, "messages": [ {"role": "system", "content": "Reply with concise diffs only."}, {"role": "user", "content": "Fix the null check in parseToken."} ] }'
from openai import OpenAI client = OpenAI( base_url="https://inference.noosfera.si/v1", api_key=os.environ["NOOSFERA_KEY"],) reply = client.chat.completions.create( model="noosfera/auto", messages=[{"role": "user", "content": "Summarize this PR."}],)
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://inference.noosfera.si/v1", apiKey: process.env.NOOSFERA_KEY,}); const reply = await client.chat.completions.create({ model: "deepseek-v4.1-flash", messages: [{ role: "user", content: "Summarize this PR." }],});
Implements the OpenAI Responses API (resp_* IDs) in strictly stateless mode so no conversation history is retained server-side. Send the full turn list in input on every turn; previous_response_id is rejected with 400 unsupported_previous_response.
| Field | Type | Behavior |
|---|---|---|
input | string | array | String prompt or items (message, function_call, function_call_output) |
instructions | string | Leading system instructions for the model |
tools | array | Function tools and namespaced function tools (type: "namespace") |
reasoning | object | { "effort": "minimal" | "low" | "medium" | "high" | "xhigh" } |
max_output_tokens | integer | Maximum tokens to generate within the selected model's limit |
curl https://inference.noosfera.si/v1/responses \ -H "Authorization: Bearer $NOOSFERA_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "noosfera/auto", "instructions": "Be terse and verify edge cases.", "input": "Explain how atomic budget holds prevent overspend." }'
res = client.responses.create( model="noosfera/auto", instructions="Be terse and verify edge cases.", input="Explain how atomic budget holds prevent overspend.",)print(res.output_text)
Full Anthropic Messages compatibility (msg_* IDs) with tool_use / tool_result, thinking (enabled with budget_tokens ≥ 1024, adaptive, or disabled), cache_control (ephemeral 5m / 1h TTL), stop_sequences, text/base64 document blocks, and in-conversation system reminder turns.
Anthropic SDKs and Claude Code append /v1/messages automatically. Set ANTHROPIC_BASE_URL="https://inference.noosfera.si" (without a trailing /v1) and clear ANTHROPIC_API_KEY="" so Claude Code sends your ANTHROPIC_AUTH_TOKEN cleanly. Requested claude-sonnet-* and claude-haiku-* names resolve to enabled commercial API-key models.
export ANTHROPIC_BASE_URL="https://inference.noosfera.si"export ANTHROPIC_AUTH_TOKEN="$NOOSFERA_KEY"export ANTHROPIC_API_KEY=""export ANTHROPIC_MODEL="noosfera/auto" claude
curl https://inference.noosfera.si/v1/messages \ -H "x-api-key: $NOOSFERA_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "noosfera/auto", "max_tokens": 1024, "system": [{"type": "text", "text": "You are a code reviewer.", "cache_control": {"type": "ephemeral"}}], "messages": [{"role": "user", "content": "Review this migration."}] }'
curl https://inference.noosfera.si/v1/messages/count_tokens \ -H "x-api-key: $NOOSFERA_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-5", "messages": [{"role": "user", "content": "How many tokens is this prompt?"}] }' → {"input_tokens": 14}
Evals, migrations and overnight reviews at 0.6× list rate (40% off). Batches are tenant-isolated, and their prompts are not kept once a batch completes or expires.
| Method & Route | Description |
|---|---|
POST /v1/batches | Submit a JSON requests array or JSONL batch payload with endpoint and completion_window |
GET /v1/batches | List batches owned by the authenticated tenant |
GET /v1/batches/:id | Inspect batch status (validating, in_progress, completed, cancelled) and results; returns 404 across tenants |
POST /v1/batches/:id/cancel | Cancel an active batch and immediately release remaining budget hold |
curl https://inference.noosfera.si/v1/batches \ -H "Authorization: Bearer $NOOSFERA_KEY" \ -H "Content-Type: application/json" \ -d '{ "endpoint": "/v1/chat/completions", "completion_window": "24h", "requests": [ { "custom_id": "pr-412-a", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "noosfera/eco", "messages": [{"role": "user", "content": "Check SQL migrations"}]} } ] }'
{ "id": "batch_01J9X...", "object": "batch", "endpoint": "/v1/chat/completions", "status": "in_progress", "discount_multiplier": 0.6, "request_counts": {"total": 1, "completed": 0, "failed": 0}}
No LLM router sits in front of your turn. Noosfera reads deterministic request signals in under a millisecond (estimated input size, max_tokens, tool schemas, attachments) and walks a ladder of eligible commercial models.
With sticky: true and x-gateway-conversation, a multi-turn loop stays on the same model and upstream slot for 2 hours, so the provider’s prompt cache stays warm. If that rung throttles or fails before the first token, the request moves to the next rung.
noosfera/autoRoutine tool turns go to flash-class models; the sticky cache stays intact.
noosfera/speedPicks the rung with the lowest time to first token.
noosfera/ecoCheapest hemat_ok models, for sweeps, triage and batches.
noosfera/auto, noosfera/speed, and noosfera/eco (as well as legacy aliases auto:flash, auto:fast, and auto:hemat) never route buyer keys to consumer OAuth subscriptions or contributor training tiers. You can also pass any concrete model from GET /v1/models (such as deepseek-v4.1-flash, gemini-3.5-flash-lite, glm-5.3-flash, or claude-sonnet-5-5; requested claude-sonnet-*, claude-opus-*, and claude-haiku-* names also alias cleanly).
Firecracker microVMs on bare metal for coding agents, test runners and browser tasks. Existing E2B SDK code switches over with two environment variables.
Sandboxes at cloud.noosfera.si are in Early Access and disabled by default in init.sh. Pass --with-sandbox with NOOSFERA_CLOUD_KEY set when you want E2B_DOMAIN and E2B_API_KEY configured.
| Metric | Value | Details |
|---|---|---|
| Active Compute Rate | $0.028/hr | 4 vCPU / 8 GiB microVM ($0.0055/vCPU-hr + $0.00075/GiB-hr), billed per active second |
| Idle Auto-Pause | $0.00/hr | Automatically snapshots memory/disk state after 5 minutes idle; zero charge while paused |
| Drop-in Environment | E2B_DOMAIN + E2B_API_KEY | Set E2B_DOMAIN=cloud.noosfera.si and pass your sandbox API key |
| Action | Endpoint |
|---|---|
| Create / List | POST /v2/sandboxes, GET /v2/sandboxes (also /sandboxes) |
| Inspect / Delete | GET /sandboxes/:id, DELETE /sandboxes/:id |
| Pause / Resume / Timeout | POST /sandboxes/:id/pause, POST /sandboxes/:id/resume, POST /sandboxes/:id/timeout |
| Run Commands | POST /sandboxes/:id/commands (cmd, cwd, envs, timeoutMs) |
| Filesystem & Previews | GET/PUT/POST/DELETE /sandboxes/:id/files, GET /sandboxes/:id/ports/:port |
| Usage Meter & Health | GET /v1/meters, GET /v1/health |
export E2B_DOMAIN="cloud.noosfera.si" export E2B_API_KEY="$NOOSFERA_CLOUD_KEY" python3 -c 'from e2b_code_interpreter import Sandboxwith Sandbox.create() as sb: print(sb.commands.run("bun --version").stdout)'
curl -X POST https://cloud.noosfera.si/v2/sandboxes \ -H "X-API-Key: $NOOSFERA_CLOUD_KEY" \ -H "Content-Type: application/json" \ -d '{"cpuCount": 4, "memoryMB": 8192, "idleTimeoutSec": 300}' curl -X POST https://cloud.noosfera.si/sandboxes/sbx_123/commands \ -H "X-API-Key: $NOOSFERA_CLOUD_KEY" \ -H "Content-Type: application/json" \ -d '{"cmd": "npm test", "cwd": "/home/user/repo"}'
Every turn takes a serialized pre-flight hold in integer micro-dollars (1 USD = 1,000,000 micro-USD), so a fleet of concurrent agents cannot overrun a key or the wallet.
| Control | Default | Behavior When Hit |
|---|---|---|
| Monthly Per-Key Cap | Up to $50/key (beta ceiling, configurable for orgs) | Returns 429 key_limit_reached; refused turns cost $0 |
| Daily UTC Key Cap | Optional per-key USD limit | Returns 429 key_daily_limit_reached until 00:00 UTC |
| Wallet Balance Hold | Pre-flight worst-case bound | Returns 402 insufficient_balance with available_usd & required_usd |
| Concurrent In-Flight | 4 turns per tenant (up to 16 ceiling) | Prevents parallel fan-out storms; excess bursts return 429 |
| Max Request Payload | 8 MiB on /v1/* | Oversized payloads return 413 too_large |
| Rolling Pace Windows | Optional 5-hour / weekly plan cap | Shifts routine turns to honest Eco Mode (x-noosfera-mode: hemat) |
Standard buyer and organization keys store no prompt or completion. Request logs keep counts and billing fields only; any optional trace path runs a deterministic secret and Indonesian PII scrubber first.
The ledger schema, the NIK/NPWP/card/secret rules, and OAuth isolation, field by field.
Read Data Retention →x-gateway-no-trace: 1Turns recording off for that request, whatever the key’s settings.
Scrubber rules →