← Back to Home

API Documentation

100% OpenAI-compatible gateway for managed open-weight models and BYOK frontier routing.

Get API Key →

1. Base URL & Authentication

All requests are 100% compatible with the official OpenAI SDK format. Pass your sk-mandyxai-... key in the Authorization header.

Base URL: https://mandyxai.com/api/v1
Header: Authorization: Bearer sk-mandyxai-your-key

2. Core API Endpoints

MethodEndpointDescription
POST/chat/completionsFull URL: https://mandyxai.com/api/v1/chat/completions — supports stream: true SSE and automatic billing/BYOK routing.
GET/modelsFull URL: https://mandyxai.com/api/v1/models — list all available managed and BYOK model IDs with per-token pricing metadata.

Wallet balances, token usage logs, and Stripe top-ups are managed directly in your Console Dashboard.

3. Supported Models & Billing

ModelModel IDBilling ModeRate (In / Out per 1M)
DeepSeek V4.1 Flashdeepseek/deepseek-v4.1-flashManaged Pay-As-You-Go$0.18 / $0.72
DeepSeek V4.1 Prodeepseek/deepseek-v4.1-proManaged Pay-As-You-Go$0.79 / $2.38
Gemma 4 31Bgoogle/gemma-4-31bManaged Pay-As-You-Go$0.17 / $0.48
Qwen3 Next 80Bqwen/qwen3-next-80b-a3b-instructManaged Pay-As-You-Go$0.18 / $1.44
Anthropic Claude Sonnet-5.5anthropic/claude-sonnet-5.5BYOK (Zero Markup)Your Provider Key
OpenAI GPT-5.6openai/gpt-5.6BYOK (Zero Markup)Your Provider Key
Google Gemini 2.5 Progoogle/gemini-2.5-proBYOK (Zero Markup)Your Provider Key

4. Quickstart Code Examples

Python (Official OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://mandyxai.com/api/v1",
    api_key="sk-mandyxai-your-api-key",
)

res = client.chat.completions.create(
    model="deepseek/deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(res.choices[0].message.content)

5. Error Codes & Rate Limits

HTTP StatusError TypeResolution
401 Unauthorizedauthentication_errorMissing, invalid, or revoked sk-mandyxai-... key.
402 Payment Requiredinsufficient_quotaWallet balance depleted or missing BYOK provider key in Dashboard.
429 Too Many Requestsrate_limit_exceededDefault limits: 20 RPM (Free trial) · 300+ RPM (Paid / Topped-up accounts).
502 Bad Gatewayupstream_errorUpstream compute provider temporarily busy; retry with exponential backoff.

6. Bring-Your-Own-Key (BYOK) & IDE Setup

To use frontier models (Claude Sonnet-5.5, GPT-5.6, Gemini 2.5 Pro) with zero token markup, save your provider API keys inside your Console Dashboard. For Cline, Roo Code, or Cursor, select OpenAI Compatible, set Base URL to https://mandyxai.com, and paste your sk-mandyxai-... key.