# Astra AI Gateway > Production-grade, OpenAI-compatible AI gateway by Tantra AI Labs (India). One endpoint, 42+ models — text, vision, image generation, and video generation — with pay-as-you-go wallet billing, guaranteed structured output (JSON Schema), and live balance metadata in every response. Base API URL: `https://api.modelrouter.in/v1` Dashboard: `https://modelrouter.in` Provider: `modelrouter.in` (single branded provider; upstreams hidden) Auth: `Authorization: Bearer sk-...` or `X-Astra-Key: sk-...` Operator: Tantra AI Labs — Nanded, Maharashtra, India (founded by Aditya Wakharkar) Status page data: `GET /api/status` Full API reference: `https://modelrouter.in/download/astra-api-docs.md` ## Models (42+) - GLM-5.3-Flash — flagship Zhipu GLM, reasoning-capable, best value - DeepSeek-V4.1-Flash — fast general/chat (`deepseek-v4-flash` alias also works) - deepseek-v4-pro, deepseek-reasoner — heavier reasoning tasks - Qwen3.8, Qwen3-Max, Qwen3-Coder, qwen3.5-397b — Alibaba Qwen family - kimi-k3, kimi-k2.7-code — Moonshot Kimi, strong at code - minimax-m3, MiniMaxAI/MiniMax-M2.7 — MiniMax - gemini-2.5-flash, gemini-3.x-flash — Google Gemini - gpt-oss-120b — open-weights GPT-class - dall-e-3, flux-image, image-model — image generation - MiniMax-H3 — video generation ($0.10/second) - qwen3-tts — text to speech, 683 voices, Hindi+8 languages, WAV 24kHz, max 10,000 chars (FREE) - whisper-small, whisper-medium — speech to text, 99 languages (FREE) Full live list: `GET /v1/models` with any API key. ## Pricing (pay-as-you-go wallet) - Text: from $0.06/M input tokens (GLM-5.3-Flash); DeepSeek-V4.1-Flash $0.165/M input - Images: dall-e-3 $0.03/image · flux-image $0.0112/image · image-model $0.0112/image - Video: $0.10/second of output video (5s = $0.50, 10s = $1.00) - Every response body includes an `astra` block with live `balance_usd` — no guessing when to recharge - Balance check: `GET /v1/key/info` returns exact remaining balance and usage by modality ## Endpoints - `POST /v1/chat/completions` — OpenAI-format chat; streaming; structured output (see below) - `POST /v1/messages` — Anthropic Claude-format chat (same models, `x-api-key` auth) - `POST /v1/images/generations` — text-to-image (b64_json or url response) - `POST /v1/videos` — text-to-video job (async) - `GET /v1/videos/{task_id}` — poll video job status; returns signed `url` when done - `GET /v1/videos/{video_id}/content` — download the rendered MP4 - `GET /v1/models` — list all models available to the key - `GET /v1/key/info` — key metadata: balance, used, plan, model list, usage by modality - `GET /v1/info` — account info: status, plan, logins, wallet - `GET /v1/dashboard/billing/subscription` and `/usage` — OpenAI-compatible billing endpoints All endpoints accept `Authorization: Bearer sk-...`, `X-Astra-Key: sk-...`, or `x-api-key: sk-...`. ## Structured Output (JSON Schema) Guaranteed schema-valid JSON via vLLM guided decoding. Add `response_format` to any chat call: ```json { "model": "/data/models/GLM-5.3-Flash", "messages": [{"role": "user", "content": "Create person record: Ravi, 30, Mumbai"}], "max_tokens": 2000, "response_format": { "type": "json_schema", "json_schema": { "name": "person", "strict": true, "schema": { "type": "object", "properties": { "name": {"type": "string"}, "age": {"type": "integer"}, "city": {"type": "string"} }, "required": ["name", "age", "city"], "additionalProperties": false } } } } ``` Response (`choices[0].message.content`) is pure JSON matching the schema — no code fences, no prose: ```json {"name": "Ravi", "age": 30, "city": "Mumbai"} ``` Important notes: - Use `"strict": true` and `"additionalProperties": false` for full schema enforcement - Use `"type": "json_object"` for simple "must be JSON" mode without a schema - Reasoning models (GLM-5.3-Flash) spend tokens thinking first — set `max_tokens >= 2000` (reasoning uses ~400-500 before the JSON is emitted) - Works identically on the Claude endpoint `/v1/messages` - Works in streaming mode too — schema applies to the accumulated output ## Video Generation (async, 3 steps) Step 1 — submit: ```json POST /v1/videos {"model": "/data/Models/MiniMax-H3", "prompt": "a sailboat on blue waves", "seconds": "5", "aspect_ratio": "16:9"} → {"task_id": "task_...", "status": "queued"} ``` Step 2 — poll (renders in ~2.5 min for 5s, ~7 min for 10s): ```json GET /v1/videos/{task_id} → {"status": "completed", "progress": 100, "file_name": "video_gen_....mp4", "url": "/media/video_gen_....mp4?exp=...&sig=..."} ``` Step 3 — play or download: the `url` field is a signed, browser-playable link on the gateway domain (1-hour validity, no auth needed for playback). ## Response Metadata (`astra` block) Every chat/models/response body includes live wallet state — use it to know exactly when to recharge: ```json "astra": { "gateway": "modelrouter.in", "balance_usd": "12.3571", "used_usd": "26.5082", "plan": "default/prepaid", "models_count": "42", "providers": "modelrouter.in", "requests": "544" } ``` Error responses use `type: "astra_error"` (e.g. invalid key, model not found, insufficient balance). Errors are OpenAI-compatible in shape. ## Quick Start ```bash curl https://api.modelrouter.in/v1/chat/completions \ -H "Authorization: Bearer $ASTRA_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "deepseek-v4-flash", "messages": [{"role": "user", "content": "Hello"}]}' ``` Works with any OpenAI SDK: set `base_url = "https://api.modelrouter.in/v1"` and `api_key = "sk-..."`.