Inside Out — AI Proxy

Inside Out

Use AI in your self-hosted Arcellite server without ever storing API keys on your machine. Your server talks to Arcellite's cloud proxy, which forwards requests to the AI provider using Arcellite's keys — metered against your monthly plan quota.

Keys never leave Arcellite's server
4 providers · 20+ models
Token quota per plan

What is Inside Out?

Normally, to use AI in your self-hosted Arcellite server you would paste provider API keys (OpenAI, Anthropic, etc.) directly into your server's environment. Those keys sit on your machine, and if it's ever compromised, the keys are too.

Inside Out flips this model. Your Arcellite server sends AI requests to https://arcellite.com/api/ai/proxy together with your license token. Arcellite validates your license, deducts from your monthly token allowance, and forwards the request to the AI provider — using keys that only ever exist on Arcellite's server.

Traditional (BYO keys)Inside Out (proxy)
Where are API keys?On your server (.env)On Arcellite's server only
Key exposure riskIf server is breached, keys leakZero — keys never touch your machine
Provider billingBilled directly by providerIncluded in your Arcellite plan
Setup effortCreate accounts per provider, manage keysPaste your license token once
Usage visibilityCheck each provider dashboardSingle /api/ai/proxy?license_token= call
Token budgetUnlimited (you pay)Monthly quota by plan (startup / growth / enterprise)

How It Works

The full request lifecycle, step by step.

1

Your server makes a request

Arcellite's AI assistant builds the standard chat payload and adds your license_token and the target provider name, then POSTs to https://arcellite.com/api/ai/proxy.

2

License & quota check

Arcellite's proxy validates your license token against Firestore, looks up your plan, and checks how many tokens you've used this calendar month.

3

Forwarded to the AI provider

The proxy strips your license_token and provider fields, injects the real API key from its own environment, and forwards the cleaned payload to the provider (OpenAI, Anthropic, DeepSeek, or Groq).

4

Usage recorded

Token counts from the provider response are recorded in Firestore under your license token and the current month. This is what the quota check in step 2 reads next time.

5

Response returned with metadata

Your server receives the full provider response plus an _arcellite block showing how many tokens were used in this request, the running monthly total, your limit, and remaining balance.

Zero config on the provider side. You don't need an OpenAI account, an Anthropic account, or any provider API key. All of that is handled at the Arcellite cloud level. You only need your Arcellite license token.

Request flow

Your Arcelliteself-hosted server
Arcellite Proxyarcellite.com/api/ai/proxy
AI ProviderOpenAI / Anthropic / …

Your license token travels to the Arcellite proxy · API keys never reach your server

Supported Providers

These are the AI providers available through the Inside Out proxy.

OpenAIOpenAI-compat
provider: "openai"
gpt-4ogpt-4o-minigpt-4-turbogpt-3.5-turbo
AnthropicAnthropic
provider: "anthropic"
claude-opus-4claude-sonnet-4claude-haiku-4
DeepSeekOpenAI-compat
provider: "deepseek"
deepseek-chatdeepseek-reasoner
GroqOpenAI-compat
provider: "groq"
llama-3.3-70b-versatilellama-3.1-8b-instantmixtral-8x7b-32768
Model names are passed through. Set the model field to whatever the provider accepts. If the provider rejects an unknown model, the proxy returns the provider's error verbatim with the original HTTP status code.

Token Quotas

Monthly limits reset on the 1st of every calendar month (UTC).

Startup

500,000

tokens / month

Growth

2,000,000

tokens / month

Enterprise

10,000,000

tokens / month

Quota exceeded? The proxy returns HTTP 429 with a JSON body describing the overage. Requests stop processing until the 1st of the next month, or you upgrade your plan. You can check remaining tokens at any time using the GET endpoint.

Token counts follow each provider's definition (total_tokens for OpenAI-compatible, input_tokens + output_tokens for Anthropic). The proxy records and charges exactly what the provider reports.

Configuration

How to point your self-hosted Arcellite server to the Inside Out proxy.

In your Arcellite server's environment file, set the proxy URL and your license token. Leave all provider API key fields blank — they are not needed when using Inside Out.

.env (your self-hosted Arcellite server)env
# ── Inside Out: proxy mode ─────────────────────────────────
AI_PROXY_URL=https://arcellite.com/api/ai/proxy
ARCELLITE_LICENSE_TOKEN=arc_live_xxxxxxxxxxxxxxxxxxxx

# Leave ALL provider keys empty when using the proxy:
# AI_KEY_OPENAI=
# AI_KEY_ANTHROPIC=
# DEEPSEEK_API_KEY=
# AI_KEY_GROQ=
Your license token was emailed to you after purchase. You can also find it in the Arcellite founder dashboard. It starts with arc_live_.

That's it. Arcellite's AI assistant will automatically detect AI_PROXY_URL and route all requests through the proxy instead of calling providers directly.

BYO keys still work. Inside Out and bring-your-own-key modes are not mutually exclusive. If AI_PROXY_URL is set, the proxy is used. If a per-provider key is also present, the direct key takes precedence for that provider. Remove provider keys entirely to force all traffic through the proxy.

Check Usage

Query your current month's token consumption at any time.

GET — check token usagebash
curl "https://arcellite.com/api/ai/proxy?license_token=arc_live_xxxx"
Responsejson
{
  "ok": true,
  "plan": "growth",
  "month": "2026-03",
  "tokens_used": 124532,
  "tokens_limit": 2000000,
  "tokens_remaining": 1875468
}

The month field uses YYYY-MM format (UTC). Quotas reset at 00:00 UTC on the 1st of each month.

API Reference

Full specification of the Inside Out proxy endpoint.

POSThttps://arcellite.com/api/ai/proxy

Send an AI request through the proxy. The proxy validates your license, checks quota, and forwards to the provider.

FieldTypeRequiredDescription
license_tokenstringYesYour Arcellite license token (arc_live_…)
providerstringYes"openai" | "anthropic" | "deepseek" | "groq"
modelstringYesProvider model name, e.g. "gpt-4o" or "claude-sonnet-4-5"
messagesarrayYesStandard chat messages array: [{role, content}, …]
max_tokensnumberNoMaximum tokens in the response
temperaturenumberNoSampling temperature (0–2)
systemstringNoSystem prompt (Anthropic only — top-level field)
anyNoAny other provider-specific parameters are passed through unchanged

Response

The proxy returns the full, unmodified provider response body, plus an _arcellite metadata object appended at the top level.

Successful response (200)json
{
  // ── Full provider response (OpenAI example) ──────────────
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hello!" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 12, "completion_tokens": 5, "total_tokens": 17 },

  // ── Arcellite metadata (appended by proxy) ────────────────
  "_arcellite": {
    "tokens_used_this_request": 17,
    "tokens_used_this_month":   124549,
    "tokens_limit":             2000000,
    "tokens_remaining":         1875451
  }
}

Error responses

StatusMeaning
400Missing or invalid license_token / provider field
401License token not found or not active
403Your plan does not include AI token access
429Monthly token quota exhausted — resets on the 1st
503The requested provider is not configured on Arcellite's proxy
4xx / 5xxProvider returned an error — passed through verbatim

Code Examples

Drop-in snippets for common use cases.

Basic request (fetch)

JavaScript / TypeScripttypescript
const res = await fetch("https://arcellite.com/api/ai/proxy", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    license_token: process.env.ARCELLITE_LICENSE_TOKEN,
    provider:      "openai",
    model:         "gpt-4o-mini",
    messages: [
      { role: "user", content: "Summarise this file in 3 bullet points." },
    ],
    max_tokens: 512,
  }),
})

const data = await res.json()
console.log(data.choices[0].message.content)
console.log("Tokens remaining:", data._arcellite.tokens_remaining)

Anthropic provider

JavaScript / TypeScript — Anthropictypescript
const res = await fetch("https://arcellite.com/api/ai/proxy", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    license_token: process.env.ARCELLITE_LICENSE_TOKEN,
    provider:      "anthropic",
    model:         "claude-sonnet-4-5",
    system:        "You are a helpful assistant.",   // top-level for Anthropic
    messages: [
      { role: "user", content: "What is self-hosting?" },
    ],
    max_tokens: 1024,
  }),
})

const data = await res.json()
// Anthropic response shape
console.log(data.content[0].text)

Check usage (Python)

Pythonpython
import os, requests

r = requests.get(
    "https://arcellite.com/api/ai/proxy",
    params={"license_token": os.environ["ARCELLITE_LICENSE_TOKEN"]},
)
usage = r.json()
print(f"Used {usage['tokens_used']:,} / {usage['tokens_limit']:,} tokens this month")
print(f"Remaining: {usage['tokens_remaining']:,}")

cURL — quick test

cURLbash
curl -X POST https://arcellite.com/api/ai/proxy \
  -H "Content-Type: application/json" \
  -d '{
    "license_token": "arc_live_xxxxxxxxxxxxxxxxxxxx",
    "provider": "groq",
    "model": "llama-3.3-70b-versatile",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Security Model

How Inside Out protects your infrastructure.

Keys never leave Arcellite

AI provider API keys are stored as environment variables on Arcellite's server only. They are injected at request time and never returned in any response.

License-bound access

Every proxied request is validated against your license token. Expired, revoked, or invalid tokens are rejected before any upstream call is made.

Hard token quotas

Monthly limits are enforced server-side before the upstream call. Even if your self-hosted server is compromised, the attacker is capped by your plan quota.

What to do if your license token leaks

Contact Arcellite support immediately to revoke and reissue your token. A compromised license token can only spend tokens up to your monthly plan limit.

Best practice: Store your license token as a server-side environment variable (e.g. ARCELLITE_LICENSE_TOKEN). Never hardcode it in source files or expose it to client-side JavaScript.

FAQ

Ready to go keyless?

Get a plan, set two environment variables, and your Arcellite server is AI-powered — with zero API keys on your machine.