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.

api.marsai.com/v1200 OK
REQUESTPOST /v1/chat/completionsmodel "claude-opus-4-8"stream truetools [ … ]
ROUTED · BEST PATH
OpenAIgpt-5.1128ms
Anthropicclaude-opus-4-8142ms
Googlegemini-3-pro136ms
DeepSeekdeepseek-v3.289ms
300+ Models1line To integrate99.5% Uptime

01·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.

PYTHONNODE.JSCURL
main.py
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

api.marsai.com/v1200 OK
GATEWAY
Unified endpoint/v1/chat/completions
OpenAIgpt-5.1128ms
Anthropicclaude-opus-4-8142ms
Googlegemini-3-pro136ms
DeepSeekdeepseek-v3.289ms
Metallama-4-maverick113ms
Alibabaqwen3-max96ms
Smart routing (optional): turn it on to route quality-first, cost-first or latency-first — configure once, and it stays in effect.
Failover chains: a failing primary auto-switches to a backup, a healthy node takes over, the task continues.
Per-call override: want a specific model for one call? Name it in the request — override the default anytime.

03·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.

ModelProviderModalityTier
gpt-5.1OpenAIText · VisionPremium
claude-opus-4-8AnthropicText · VisionPremium
gemini-3-proGoogleText · VisionPremium
grok-4xAITextPremium
deepseek-v3.2DeepSeekTextOpen
qwen3-maxAlibabaText · VisionOpen
llama-4-maverickMetaText · VisionOpen
kimi-k2Moonshot AITextOpen

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.

PREMIUM DIRECT
Frontier closed models

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.
Best for: top quality, peace of mind
OPEN SELF-HOSTED
Optimized open inference

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.
Best for: cutting cost at scale, batch inference

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.

Auto
Failover

Upstream errors reroute to healthy nodes or backup models — fully transparent to your agent.

Built-in
Retries

Transient errors retry automatically — no fallback logic in your agent code.

Idempotent
Cache

Identical requests can hit cache — retries and repeats aren't double-billed.

Elastic
Concurrency

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).

console.marsai.com · overviewLIVE
Requests today284,591▲ 12%
Spend today$142.80so far
Avg latency128 ms▼ 6%
Error rate0.04%30d
Requests · last 24hreq/h

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.