MarsAI · MODEL API
Unified API
for AI model inference
OpenAI-compatible. Change one line of base_url to reach GPT, Claude, Gemini and top open models. Multi-model routing and automatic failover keep you stable at any volume.
POST /v1/chat/completionsmodel "claude-opus-4-8"stream truetools [ … ]gpt-5.1128msclaude-opus-4-8142msgemini-3-pro136msdeepseek-v3.289ms01·THE API
One OpenAI-compatible API
Point the endpoint at MarsAI and your existing code, SDKs and libraries run unchanged. One interface covers chat, streaming, tool calls and multimodal — Python, TypeScript, curl.
from openai import OpenAI client = OpenAI( base_url="https://api.openai.com/v1",+ base_url="https://api.marsai.com/v1", # change only this line api_key="sk-marsai-****",) res = client.chat.completions.create( model="claude-opus-4-8", # same syntax for any model messages=[{"role": "user", "content": "Hello"}],)
One-line integration
OpenAI-compatible — change base_url, leave the SDK alone.
Streaming
SSE token-by-token; long answers render instantly.
Tool calls
Native function-calling / tools — ready for agent orchestration.
Multimodal
Text, vision and embeddings on one endpoint.
02·ROUTING
Smart routing, opt in when you need it
By default you call a model directly; turn on smart routing to auto-optimize by quality, cost or latency. Failover is always automatic — you never have to write it.
From the moment you connect, requests are routed automatically
/v1/chat/completions03·MODELS
One catalog, every major model
Frontier closed and top open models side by side, picked on demand. Below are representative models; the full catalog updates continuously and lives in the console.
| Model | Provider | Modality | Tier |
|---|---|---|---|
| gpt-5.1 | OpenAI | Text · Vision | Premium |
| claude-opus-4-8 | Anthropic | Text · Vision | Premium |
| gemini-3-pro | Text · Vision | Premium | |
| grok-4 | xAI | Text | Premium |
| deepseek-v3.2 | DeepSeek | Text | Open |
| qwen3-max | Alibaba | Text · Vision | Open |
| llama-4-maverick | Meta | Text · Vision | Open |
| kimi-k2 | Moonshot AI | Text | Open |
300+ models · 40+ providers · always growing
04·TIERS
Frontier for ease, open source for savings
Premium gives you convenience and reliability; open source gives you savings. Teams that need top quality but must control cost at scale can mix both tiers.
GPT · Claude · Gemini, etc.
Same price as the vendor, never a markup. We profit from unified billing, not your token spread.
- Vendor price, 0 markup (verifiable line by line).
- One API, one bill.
- Configurable routing and fallback, unified quota.
Llama · Qwen · DeepSeek, etc.
Self-hosted plus optimized inference. The spread becomes your savings — higher throughput, lower unit price.
- Up to 60% cheaper than comparable closed models ().
- High throughput, low unit price.
- Private data, dedicated deployment available.
05·RELIABILITY
Stable under agent load
We build reliability into the infrastructure instead of leaving it to you. High-concurrency, long-running, throughput-critical agent loads are all backstopped by this layer.
Upstream errors reroute to healthy nodes or backup models — fully transparent to your agent.
Transient errors retry automatically — no fallback logic in your agent code.
Identical requests can hit cache — retries and repeats aren't double-billed.
Concurrency scales with load — long-running and batch inference stay stable.
06·OBSERVABILITY
Usage, cost, logs — all in one view
Every call is metered and traceable. The console lays out usage, cost and health; keys and rate limits are self-service (illustrative below).
Usage dashboard
Requests, tokens, latency — broken down by model and time.
Cost breakdown
Spend per model and per key, reconcilable line by line.
Keys & limits
Self-issue multiple keys, set quota and rate limits per key.
07·SECURITY
Your data is yours, we're just the pipe
Request data is never used for training, everything is encrypted, and upstream keys are held by us. For production deployments with data-boundary and compliance requirements.
No training
Your requests and responses are never used for any training.
Encrypted
Encrypted in transit and at rest.
Keys held by us
Provider keys are held by us, never exposed to your code.
Real company
MarsAI LIMITED, a registered U.S. company (Colorado, 2023).
08·FAQ
Common questions
Q1Is Premium really no markup?
No markup. GPT / Claude / Gemini pass through at vendor price, verifiable line by line; we profit from unified billing, not your token spread.
Q2How does failover work?
Fully automatic. On upstream errors we reroute to healthy nodes or fallback models — transparent to your agent, tasks never stop.
Q3Will you train on my data?
Never. Request and response data is not used for any model training.
Q4How do I migrate from OpenAI?
One line. Point base_url at MarsAI — the API is fully OpenAI-compatible.
Q5Why is the open tier cheaper?
Because it's self-hosted. We self-host and optimize inference, and the spread becomes your savings — up to 60% cheaper than comparable closed models ().
Let one API own the model layer
Contact us to get started. Change one line of base_url and your agent reaches 300+ models.
