# MyTechAPI > Unified AI API gateway — one API key for chat (LLM), image, video and audio generation. OpenAI-compatible. Billed in credits (1 credit = RM0.0000001). Base URL: https://mytechapi.my ## Quick start - [Getting started](https://mytechapi.my/docs.md): account, API key, first request - [Media API tutorial](https://mytechapi.my/docs/media.md): generate image/video/audio without the Playground — submit, poll, download - [Models and prices](https://mytechapi.my/models): live catalogue with per-model pricing - [Hermes Agent integration](https://mytechapi.my/docs/hermes.md): connect as a native MCP server ## MCP server & CLI Local stdio MCP server and CLI — zero npm dependencies, Node 18+. Download: [myt-mcp.mjs](https://mytechapi.my/myt-mcp.mjs) ```bash export MYTECH_API_KEY="YOUR_MYTECH_API_KEY" node myt-mcp.mjs list --modality video node myt-mcp.mjs run mytech/veo-3.1-text-to-video-quality-1080p \ --input '{"prompt":"a cat on a rooftop","duration":6}' --max-credits 100000000 node myt-mcp.mjs mcp # start MCP server on stdio ``` MCP tools: `mytech_list_models`, `mytech_model_spec`, `mytech_credit_balance`, `mytech_submit_task`, `mytech_task_status`, `mytech_chat`. Register in Claude Desktop / Cursor (`mcp.json` or `claude_desktop_config.json`): ```json { "mcpServers": { "mytechapi": { "command": "node", "args": ["/absolute/path/to/myt-mcp.mjs", "mcp"], "env": { "MYTECH_API_KEY": "YOUR_MYTECH_API_KEY" } } } } ``` Environment: `MYTECH_API_KEY`, `MYTECH_BASE_URL`, `MYTECH_MAX_CREDITS` (per-task ceiling, 0 = disabled), `MYTECH_OUTPUT_DIR`. `--max-credits` checks the live catalogue price before sending and refuses if the estimate exceeds the ceiling. Exit code `3` = blocked. ## API reference - Chat completions — `POST /v1/chat/completions` - Media generation — `POST /v1/generations` - Poll job status — `GET /v1/generations?job_id=...` - List models — `GET /v1/models?modality=chat|image|video|audio|all` - Credit balance — `GET /v1/credits` All endpoints require the header `Authorization: Bearer `. Chat keys start with `sk-`. Use a legacy media key for generation endpoints. Format follows OpenAI, so the official OpenAI SDK works by pointing `base_url` at `https://mytechapi.my/v1`. **Note:** `GET /v1/models` returns chat models only by default, so coding agents are not flooded with media models. Pass `?modality=video` (or `image`, `audio`, `all`) to list media models. ## Important for web apps Never call this API from browser JavaScript — the key would be exposed. Call it from your server (Node, Python, PHP, Laravel, Go, ...) and proxy from your frontend. Store the key in an environment variable such as `.env`. The API does not send CORS headers, which is deliberate. ## Errors 401 missing_api_key · 401 invalid_api_key · 402 insufficient_credit · 404 model_not_found · 429 rate_limit_exceeded Failed media jobs refund held credits in full, automatically.