MarsAI
Sign inGet Started

Docs

5M FREE CREDITS — VERIFY & CLAIM

One gateway, every frontier model. OpenAI & Anthropic compatible — keep your SDKs, change one URL. Works with the MarsAI desktop app, the MarsCLI agent, IDE tools and anything that speaks OpenAI.

Base URL
https://test.marsai.click/v1

Quick start

  1. Create an account — free, no credits at signup.
  2. Verify & claim — verify Discord + Telegram in your dashboard and 5M Free Credits land instantly (valid 7 days). Verification also unlocks key creation.
  3. Get a key — Dashboard → API keys → sk-mars-....
  4. Point your client at https://test.marsai.click/v1 and make a call:
curl
curl https://test.marsai.click/v1/chat/completions \
  -H "Authorization: Bearer sk-mars-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"marsai-auto","messages":[{"role":"user","content":"Hello, Mars"}]}'

MarsCLI — coding agent in your terminal

MarsCLI is our agentic coding CLI. Install it, run it, sign in once with the browser device-code flow — no key management. Accounts on Free Credits use MarsCLI for paid models.

shell
npm install -g @mars_ai/marscli@latest
mars

First run opens the device-code sign-in (browser). Then mars is your TUI, mars --help lists everything. Full manual on the Mars CLI page.

MarsAI Desktop — the agent as an app

The same coding agent as a native desktop app for Windows x64, macOS (Apple Silicon) and Linux (x64 & arm64). API-key-first: paste a sk-mars-... key and your MarsAI credits — including the 5M Free Credit verification bonus — work everywhere. Pick models per message. Your code stays on your machine.

release files
mars-win-x64-<version>.exe        # Windows installer
mars-mac-arm64-<version>.dmg       # macOS (Apple Silicon)
mars-linux-amd64-<version>.deb     # Debian / Ubuntu
mars-linux-x86_64-<version>.rpm    # Fedora / RHEL / openSUSE
mars-linux-x64-<version>.pacman    # Arch
mars-linux-x86_64-<version>.AppImage  # any Linux
  • Windows: SmartScreen shows "Unknown publisher" (not code-signed yet) — More info → Run anyway. Installs to %LOCALAPPDATA%\Programs\MarsAI.
  • macOS: not notarized yet — right-click → Open, or System Settings → Privacy & Security → Open Anyway.
  • Linux: .deb/.rpm/.pacman install dependencies; AppImage needs libgtk-3, libnss3, libatk-bridge, libasound2.
  • Self-updating on all three platforms — Settings → Updates.
  • Sign in: create a key at Dashboard → API keys, paste it in the sidebar footer or Settings.

Authentication

Bearer token (OpenAI style) or x-api-key (Anthropic style) — both accepted on every endpoint:

header
Authorization: Bearer sk-mars-YOUR_KEY
header
x-api-key: sk-mars-YOUR_KEY

Keys are created in the Dashboard. Treat them like passwords — they bill your credits.

Endpoints

Two native shapes, fully translated in both directions:

routes
POST /chat/completions      # OpenAI shape (tools, vision, JSON mode)
POST /responses              # OpenAI Responses shape (Codex CLI, GPT-5 clients)
POST /messages               # Anthropic shape (system, tools, vision)
GET  /models                 # list your available models
POST /embeddings             # embeddings

Streaming

Standard SSE. Add "stream": true — OpenAI clients get OpenAI chunks, Anthropic clients get message_start / content_block_delta events, Responses clients get response.output_text.delta / response.completed events. Provider names are never exposed.

curl
curl https://test.marsai.click/v1/chat/completions \
  -H "Authorization: Bearer sk-mars-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"marsai-auto","stream":true,"messages":[{"role":"user","content":"Count to 5"}]}'

List models

curl
curl https://test.marsai.click/v1/models -H "Authorization: Bearer sk-mars-YOUR_KEY"

SDK examples

Python — OpenAI

python
pip install openai

from openai import OpenAI
client = OpenAI(
    base_url="https://test.marsai.click/v1",
    api_key="sk-mars-YOUR_KEY",
)
resp = client.chat.completions.create(
    model="marsai-auto",
    messages=[{"role": "user", "content": "Hello, Mars"}],
)
print(resp.choices[0].message.content)

Python — Anthropic

python
pip install anthropic

import anthropic
client = anthropic.Anthropic(
    base_url="https://test.marsai.click/v1",
    api_key="sk-mars-YOUR_KEY",
)
msg = client.messages.create(
    model="marsai-auto",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello, Mars"}],
)
print(msg.content[0].text)

Node — OpenAI

javascript
npm install openai

import OpenAI from "openai";
const client = new OpenAI({
  baseURL: "https://test.marsai.click/v1",
  apiKey: "sk-mars-YOUR_KEY",
});
const resp = await client.chat.completions.create({
  model: "marsai-auto",
  messages: [{ role: "user", content: "Hello, Mars" }],
});
console.log(resp.choices[0].message.content);

Node — Anthropic

javascript
npm install @anthropic-ai/sdk

import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
  baseURL: "https://test.marsai.click/v1",
  apiKey: "sk-mars-YOUR_KEY",
});
const msg = await client.messages.create({
  model: "marsai-auto",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello, Mars" }],
});
console.log(msg.content[0].text);

Connect your tools

Anything with an OpenAI- or Anthropic-compatible base URL plugs straight in. Paste, authenticate, go.

Claude Code

Point Claude Code at our Anthropic-compatible endpoint and map its model slots to your models:

bash
export ANTHROPIC_BASE_URL="https://test.marsai.click/v1"
export ANTHROPIC_AUTH_TOKEN="sk-mars-YOUR_KEY"
export ANTHROPIC_DEFAULT_OPUS_MODEL="marsai-auto"
export ANTHROPIC_DEFAULT_SONNET_MODEL="marsai-auto"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="marsai-auto"
claude

OpenCode

Run opencode auth login, choose "Other", paste your key and base URL — or set it in opencode.json:

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "marsai": {
      "npm": "@ai-sdk/openai-compatible",
      "options": { "baseURL": "https://test.marsai.click/v1" },
      "models": { "marsai-auto": {} }
    }
  }
}

Codex CLI

Responses API works natively — set wire_api = "responses" in ~/.codex/config.toml:

toml
model_provider = "marsai"
model = "marsai-auto"

[model_providers.marsai]
name = "MarsAI"
base_url = "https://test.marsai.click/v1"
wire_api = "responses"
env_key = "MARSAI_API_KEY"
bash
export MARSAI_API_KEY="sk-mars-YOUR_KEY"

Cline / Kilo Code / Roo Code

In the VS Code extension, pick the OpenAI Compatible provider:

ini
API Provider:  OpenAI Compatible
Base URL:      https://test.marsai.click/v1
API Key:       sk-mars-YOUR_KEY

Cursor

Settings → Models → paste key, then override the base URL:

ini
OpenAI API Key:        sk-mars-YOUR_KEY
Override Base URL:     https://test.marsai.click/v1

Zed

Set OPENAI_API_KEY=sk-mars-... in your environment, then in settings.json:

json
{
  "language_models": {
    "openai": {
      "api_url": "https://test.marsai.click/v1",
      "available_models": [
        { "name": "marsai-auto", "display_name": "MarsAI Auto", "max_tokens": 128000 }
      ]
    }
  }
}

Continue

Add a model block to ~/.continue/config.yaml:

yaml
models:
  - model: marsai-auto
    title: MarsAI Auto
    provider: openai
    apiBase: https://test.marsai.click/v1
    apiKey: sk-mars-YOUR_KEY
    roles: [chat, edit, apply]

Aider

Standard OpenAI env vars, then launch with your model:

bash
export OPENAI_API_BASE=https://test.marsai.click/v1
export OPENAI_API_KEY=sk-mars-YOUR_KEY
aider --model openai/marsai-auto

Goose

Run goose configure, choose the OpenAI provider, paste base URL and key:

ini
Provider:  OpenAI
Base URL:  https://test.marsai.click/v1
API Key:   sk-mars-YOUR_KEY

Windsurf / any OpenAI client

Any tool with a custom OpenAI base URL works. In Windsurf: Settings → Models:

ini
API Key:   sk-mars-YOUR_KEY
Base URL:  https://test.marsai.click/v1

Credits & billing

  • Free Credits always burn first: verify Discord + Telegram and claim 5M credits valid 7 days. Redeem codes and referral rewards top them up.
  • Premium Credits burn next — bought with credit plans (Wallet money never pays for API calls).
  • Each model has a burn multiplier — billed credits = tokens × burn. Claude frontier models bill by direction instead: input and output each price per 1M tokens (see Model pricing). Multipliers under 1× burn slower.
  • Free models cost nothing — they never touch either balance.
  • HTTP 402 = out of credits. Redeem a code or buy a plan in Billing; remaining balances and invoices live there too.
  • Free accounts are full API citizens - create API keys, run any model that accepts Free Credits, capped at 30 requests/min and 200 requests/day. Paid packs raise limits (from 60 req/min on entry tiers up to 240 req/min and 5,000 req/day). HTTP 429 means a limit was hit; HTTP 402 means out of credits.

Errors & limits

CodeMeaning
400Bad request — check JSON body and model name
401Missing or invalid key
402Insufficient credits — top up in Billing
403Model not available to your account tier
429Rate limit (plan default 60 RPM) or upstream capacity — retry with backoff
5xxUpstream error, reason surfaced in the response body

Errors pass through with their real reason so your retries are informed — no silent provider swapping. Questions? Contact or ask on Discord.